OFFSET
1,1
LINKS
J. Harrington, L. Jones, A. Lamarche, Representing Integers as the Sum of Two Squares in the Ring Z_n, J. Int. Seq. 17 (2014) # 14.7.4.
EXAMPLE
12 is in the sequence because 12^3 + 1 = 1729 = 7 * 13 * 19 and 19 - (13+7) = 19 - 20 = -1;
17 is in the sequence because 17^3 + 1 = 4914 = 2*3^3*7*13 and 13 - (7+3+2) = 13 - 12 = 1.
MATHEMATICA
fpdQ[n_]:=Module[{f=Transpose[FactorInteger[n^3+1]][[1]]}, Max[f]-Total[Most[f]]==1]; gpdQ[n_]:=Module[{g=Transpose[FactorInteger[n^3+1]][[1]]}, Max[g]-Total[Most[g]]==-1]; Union[Select[Range[2, 5*10^6], fpdQ ], Select[Range[2, 5*10^6], gpdQ ]]
dgQ[n_]:=Module[{f=FactorInteger[n^3+1][[All, 1]], len, a, b}, len= Length[ f]-1; {a, b}=TakeDrop[f, len]; Abs[Total[a]-b[[1]]]==1]; Select[Range[ 25*10^5], dgQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jan 03 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Jun 23 2014
STATUS
approved