login
Least integer such that a(n)^2 - n is the sum of two nonzero squares.
1

%I #2 Mar 30 2012 17:35:23

%S 5,3,2,4,3,5,4,3,4,7,6,4,5,9,4,5,6,5,6,6,5,11,12,5,7,15,6,8,6,7,8,6,7,

%T 13,6,8,7,21,8,7,9,7,10,12,7,15,8,7,10,9,10,8,9,11,8,9,8,17,30,8,10,9,

%U 8,9,9,13,10,18,9,11,12,9,12,9,10,10,9,15,16,9,10,11,10,10,11,21,12,10,15

%N Least integer such that a(n)^2 - n is the sum of two nonzero squares.

%o (PARI) issum2sq(n) = local(fm, hf); hf=0;fm=factor(n);for(i=1,matsize(fm)[1],if(fm[i,1]==2,if(fm[i,2]%2,hf=1),if(fm[i,1]%4==1,hf=1,if(fm[i, 2]%2,return(0)))));hf

%o minsum2sq(n) = local(k); k=1;while(!issum2sq(k^2-n),k++);k

%o /* Note: the issum2sq function depends on PARI returning -1 as a factor for negative n. */

%Y Cf. A008846, A050795.

%K nonn

%O 0,1

%A _Franklin T. Adams-Watters_, Apr 26 2009