login
Integers n that are the sum of three nonzero squares while n*(n+1) is not.
1

%I #20 Mar 13 2017 10:56:03

%S 12,19,44,51,76,83,108,115,140,147,172,179,204,211,236,243,268,275,

%T 300,307,332,339,364,371,396,403,428,435,460,467,492,499,524,531,556,

%U 563,588,595,620,627,652,659,684,691,716,723,748,755,780,787,812,819,844,851,876,883,908,915

%N Integers n that are the sum of three nonzero squares while n*(n+1) is not.

%C Values of a^2 + b^2 + c^2 such that (a^2 + b^2 + c^2)^2 + a^2 + b^2 + c^2 is not of the form x^2 + y^2 + z^2 where a, b, c, x, y, z are nonzero integers.

%C First differences of this sequence are 7, 25, 7, 25, 7, 25, 7, 25, 7, 25, ...

%H Colin Barker, <a href="/A272100/b272100.txt">Table of n, a(n) for n = 1..1000</a>

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,-1).

%F From _Colin Barker_, Apr 30 2016: (Start)

%F a(n) = (32*n-17-9*(-1)^n)/2.

%F a(n) = 16*n-13 for n even.

%F a(n) = 16*n-4 for n odd.

%F a(n) = a(n-1)+a(n-2)-a(n-3) for n>3.

%F G.f.: x*(12+7*x+13*x^2) / ((1-x)^2*(1+x)).

%F (End)

%e 12 is a term because 12 = 2^2 + 2^2 + 2^2 = A000408(5) and 12*13 = A002378(12) = 156 is not in A000408.

%t Select[Range[10^3], Length[PowersRepresentations[#, 3, 2] /. {0, __} -> Nothing] > 0 && Length[PowersRepresentations[# (# + 1), 3, 2] /. {0, __} -> Nothing] == 0 &] (* _Michael De Vlieger_, Apr 20 2016, Version 10.2 *)

%t LinearRecurrence[{1,1,-1},{12,19,44},60] (* _Harvey P. Dale_, Mar 13 2017 *)

%o (PARI) isA000408(n) = my(a, b) ; a=1 ; while(a^2+1<n, b=1 ; while(b<=a && a^2+b^2<n, if(issquare(n-a^2-b^2), return(1) ) ; b++ ; ) ; a++ ; ) ; return(0);

%o lista(nn) = for(n=1, nn, if(isA000408(n) && !isA000408(n*(n+1)), print1(n, ", ")));

%o (PARI) Vec(x*(12+7*x+13*x^2)/((1-x)^2*(1+x)) + O(x^50)) \\ _Colin Barker_, Apr 30 2016

%Y Cf. A000408, A002378.

%K nonn,easy

%O 1,1

%A _Altug Alkan_, Apr 20 2016