OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..1000
EXAMPLE
268 is in the sequence because 268^2 + 1 = 5^2*13^2*17 and 17 - (13 + 5) = 17 - 18 = -1;
411 is in the sequence because 411^2 + 1 = 2 * 13 * 73 * 8 and 89 - (2 + 13 + 73) = 89 - 88 = 1.
MATHEMATICA
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 ]]
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Jun 22 2014
STATUS
approved