%I #16 Sep 08 2022 08:46:08
%S 268,411,606,657,1269,3411,6981,8844,9133,10509,28862,46818,75163,
%T 81668,88733,89238,107047,111968,125793,143382,150522,155317,179343,
%U 185363,214547,222173,241710,269051,305333,367830,397387,492258,634251,719379,724315,763267
%N Numbers n such that the difference between the greatest prime divisor of n^2 + 1 and the sum of the other distinct prime divisors is equal to +-1.
%H Amiram Eldar, <a href="/A244194/b244194.txt">Table of n, a(n) for n = 1..1000</a>
%e 268 is in the sequence because 268^2 + 1 = 5^2*13^2*17 and 17 - (13 + 5) = 17 - 18 = -1;
%e 411 is in the sequence because 411^2 + 1 = 2 * 13 * 73 * 8 and 89 - (2 + 13 + 73) = 89 - 88 = 1.
%t fpdQ[n_]:=Module[{f=Transpose[FactorInteger[n^2+1]][[1]]},Max[f]-Total[Most[f]]==1];gpdQ[n_]:=Module[{g=Transpose[FactorInteger[n^2+1]][[1]]},Max[g]-Total[Most[g]]==-1];Union[Select[Range[2,10^6],fpdQ ],Select[Range[2,10^6],gpdQ ]]
%t d1Q[n_]:=Module[{c=TakeDrop[FactorInteger[n^2+1][[All,1]],-1]},Abs[ c[[1]] - Total[c[[2]]]]=={1}]; Select[Range[800000],d1Q] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Aug 06 2018 *)
%o (Magma) sol:=[]; m:=1; for n in [6..770000] do fp:=PrimeDivisors(n^2+1); big:=Max(fp); if #fp ge 2 and Abs(2*big-&+fp) eq 1 then sol[m]:=n; m:=m+1; end if; end for; sol; // _Marius A. Burtea_, Aug 27 2019
%Y Cf. A002522.
%K nonn
%O 1,1
%A _Michel Lagneau_, Jun 22 2014
|