%I #29 Apr 28 2020 06:34:13
%S 4,9,25,30,49,70,84,121,169,198,264,286,289,308,361,468,520,529,646,
%T 841,884,912,961,1224,1369,1566,1672,1681,1748,1798,1849,2209,2576,
%U 2809,2900,3135,3348,3481,3526,3570,3721,4489,5041,5329,5704,5920,6032
%N Composites where the greatest prime factor is the sum of the other prime powers.
%C This is the sequence of positive integers that can be expressed as the product of prime powers, multiplied by the sum of the same prime powers. And the sum of the prime powers is also the greatest prime factor of the composite number.
%C I.e., there is a solution for n=(p1^i1*p2^i2*p3^i3...)*(p1^i1+p2^i2+pi3^i3...); where p1, p2, p3, etc. are distinct primes; and i1, i2, i3, etc. are the corresponding positive exponents.
%C The additional constraint is that the sum of the prime powers must also be the greatest prime factor (gpf) of n.
%C This sequence also contains the square of every prime number.
%H Amiram Eldar, <a href="/A232241/b232241.txt">Table of n, a(n) for n = 1..10000</a>
%e 9 is in the sequence since prod(3^1)*sum(3^1)=(3^1)*(3^1)=3*3=9, and the gpf, 3 is prime.
%e 1224 is in the sequence since (2^3*3^2)*(2^3+3^2)=(8*9)*(8+9)=72*17=1224, and the gpf, 17 is prime.
%e 6032 is in the sequence since (2^4*13^1)*(2^4+13^1)=(16*13)*(16+13)=208*29=6032, and the gpf, 29 is prime.
%t seqQ[n_] := Module[{f = FactorInteger[n]}, If[Length[f] == 1, f[[1, 2]] == 2, f[[-1, 2]] == 1 && f[[-1, 1]] == Plus @@ Power @@@ Most[f]]]; Select[Range[6000], seqQ] (* _Amiram Eldar_, Apr 28 2020 *)
%o (Java) public class Psfi {public static void main(String[] args) {String sequence = ""; for (int n = 2; sequence.length() < 250; n++) {int q = n; int s = 0; for (int d = 2; d <= Math.sqrt(q); d++) {int i = 0; while (q > d && q % d == 0) {i++; q = q / d;} if (i > 0) {s += Math.pow(d, i);} } if (s == q) {sequence += n + ", ";} } System.out.println(sequence);} }
%o (PARI) isok(n) = {if (n>1, my(fa = factor(n), gpf = fa[#fa~, 1], fb = factor(n/gpf)); gpf == sum(i=1, #fb~, fb[i, 1]^fb[i, 2])); } \\ _Michel Marcus_, Nov 21 2013; Apr 28 2020
%Y Variant of A163836.
%K nonn,easy
%O 1,1
%A _John R Phelan_, Nov 20 2013