%I #19 Feb 12 2015 15:10:25
%S 1,6,22,54,68,164,166,336,388,454,588,854,886,1086,1122,1124,1636,
%T 1710,1828,2182,2356,2468,2702,2960,3046,3048,3708,3748,3770,4036,
%U 4054,4655,5106,5394,5636,6502,7108,7368,7956,8324,9170,9188,9412,9438,9471,9726
%N n - (sum of prime factors of n) is a positive square.
%C Contains 4p for odd prime p if 3p-2 is a square, in particular if p is in A122430. - _Robert Israel_, Apr 13 2014
%H Robert Israel, <a href="/A216894/b216894.txt">Table of n, a(n) for n = 1..2121</a>
%e 54 = 2*3^3 and 54 -(2+3) = 49 is a square, hence 54 is in the sequence.
%p filter:= proc(x) local y;
%p y:= x - add(i, i=numtheory:-factorset(x));
%p y > 0 and issqr(y)
%p end proc;
%p N:= 10000; # to get all entries <= N
%p A216894:= select(filter,[$1..N]); # _Robert Israel_, Apr 13 2014
%t nspfQ[n_]:=Module[{c=n-Total[Transpose[FactorInteger[n]][[1]]]},c>0 && IntegerQ[ Sqrt[c]]]; Join[{1},Select[Range[10000],nspfQ]] (* _Harvey P. Dale_, Feb 12 2015 *)
%Y Cf. A008472.
%K nonn
%O 1,2
%A _Michel Lagneau_, Sep 19 2012
|