login
A269931
Integers n such that the sum of squares of the first n primes (A024450) is the sum of 4 but no fewer nonzero squares.
1
4, 12, 20, 28, 29, 36, 44, 49, 52, 57, 60, 68, 73, 76, 84, 92, 100, 105, 108, 116, 124, 132, 140, 148, 153, 156, 161, 164, 172, 180, 188, 189, 196, 201, 204, 212, 220, 228, 236, 244, 252, 260, 268, 276, 281, 284, 289, 292, 300, 308, 316, 324, 329, 332, 340, 345, 348, 356, 364, 372
OFFSET
1,1
COMMENTS
Terms that are not divisible by 4 are 29, 49, 57, 73, 105, 153, 161, 189, 201, 281, 289, 329, 345, 373, 385, 409, 417, 449, 457, 529, 553, 617, 633, 641, 645, ...
Corresponding values of sum of squares of the first n primes are 87, 4727, 30007, 98055, 109936, 239087, 486655, 710844, 874695, 1203356, 1432487, 2210983, 2841372, 3270831, ...
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
4 is a term because 2^2 + 3^2 + 5^2 + 7^2 = 87 and 87 = x^2 + y^2 + z^2 has no solution for integer x, y and z.
5 is not a term because 2^2 + 3^2 + 5^2 + 7^2 + 11^2 = 208 = 8^2 + 12^2.
MATHEMATICA
Select[Range@ 372, Nand[SquaresR[4, #] > 1, Or[SquaresR[3, #] > 1, SquaresR[2, #] > 1, IntegerQ@ Sqrt@ #]] &@ Total[Prime[Range@ #]^2] &] (* Michael De Vlieger, Mar 08 2016 *)
PROG
(PARI) isA004215(n)= my(fouri, j) ; fouri=1 ; while( n >=7*fouri, if( n % fouri ==0, j= n/fouri-7 ; if( j % 8==0, return(1) ) ; ); fouri *= 4 ; ) ; return(0) ;
a024450(n) = sum(k=1, n, prime(k)^2);
for(n=1, 1e3, if(isA004215(a024450(n)), print1(n, ", ")));
(PARI) list(lim)=my(v=List(), n, s); forprime(p=2, , s+=p^2; if(n++>lim, return(Vec(v))); if(s\4^valuation(s, 4)%8==7, listput(v, n))) \\ Charles R Greathouse IV, Mar 08 2016
CROSSREFS
Sequence in context: A227226 A242118 A030387 * A043437 A213258 A369037
KEYWORD
nonn
AUTHOR
Altug Alkan, Mar 08 2016
STATUS
approved