login
Nonsquare n such that n*(n+1)/2 is the sum of two nonzero squares.
1

%I #33 Jul 19 2016 08:42:13

%S 17,40,52,72,73,80,89,97,116,136,145,148,180,193,232,233,241,244,260,

%T 288,292,305,313,337,360,369,388,404,409,424,449,457,481,520,521,544,

%U 548,577,584,585,592,612,628,640,656,673,697,724,745,772,793,800

%N Nonsquare n such that n*(n+1)/2 is the sum of two nonzero squares.

%C Sequence focuses on the nonsquare numbers in order to eliminate trivial solutions (A000217(n^2) = (n^2 + n^4)/2 = ((n + n^2)/2)^2 + ((n - n^2)/2)^2).

%C A073412 is a subsequence. Additionally, (A073412(n), A073412(n) + 1) gives consecutive pairs of this sequence that are (72, 73), (232, 233), (520, 521), (584, 585), ...

%C Proof:

%C Note that (a^2 + b^2)*(c^2 + d^2)/2 = ((a*c + b*d)^2 + (a*d - b*c)^2)/2 = ((a*c + b*d + a*d - b*c)/2)^2 + ((a*c + b*d - a*d + b*c)/2)^2 and A073412(n) + k is not a square by definition of it for 0 <= k <= 2. So this explains the reason of the fact that A073412(n) and A073412(n) + 1 are always members of this sequence. Furthermore, if there is a consecutive pair in this sequence, the lesser of pair must be in A073412 since n, n+1 and n+2 must be the sum of two nonzero squares, if n*(n+1)/2 and (n+1)*(n+2)/2 are the sum of two nonzero squares and n, n+1, n+2 are nonsquares. So exactly (A073412(n), A073412(n) + 1) gives consecutive pairs of this sequence.

%H Charles R Greathouse IV, <a href="/A274555/b274555.txt">Table of n, a(n) for n = 1..10000</a>

%e 17 is a term because 17 is not a square and 17*(17+1)/2 = 153 = 3^2 + 12^2.

%o (PARI) isA000404(n) = for( i=1, #n=factor(n)~%4, n[1, i]==3 && n[2, i]%2 && return); n && ( vecmin(n[1, ])==1 || (n[1, 1]==2 && n[2, 1]%2));

%o lista(nn) = for(n=1, nn, if(!issquare(n) && isA000404(n*(n+1)/2), print1(n, ", ")));

%o (PARI) has(n)=my(f=factor(n)); for(i=1,#f~, if(f[i,1]%4>2 && f[i,2]%2, return(0))); if(#select(p->p%4==1, f[,1]), 2, 1)

%o is(n)=my(t); if(n%4>1 || issquare(n), return(0)); t=has(numerator(n/2)); t && if(t>1, has(numerator((n+1)/2)), t=has(numerator((n+1)/2)); t && (valuation(n*(n+1),2)%2==0 || t>1)) \\ _Charles R Greathouse IV_, Jul 19 2016

%Y Cf. A000037, A000217, A000404, A073412, A274686.

%K nonn,easy

%O 1,1

%A _Altug Alkan_, Jul 06 2016