cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A269931 #17 Mar 08 2016 10:16:04
%S A269931 4,12,20,28,29,36,44,49,52,57,60,68,73,76,84,92,100,105,108,116,124,
%T A269931 132,140,148,153,156,161,164,172,180,188,189,196,201,204,212,220,228,
%U A269931 236,244,252,260,268,276,281,284,289,292,300,308,316,324,329,332,340,345,348,356,364,372
%N 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.
%C A269931 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, ...
%C A269931 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, ...
%H A269931 Charles R Greathouse IV, <a href="/A269931/b269931.txt">Table of n, a(n) for n = 1..10000</a>
%e A269931 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.
%e A269931 5 is not a term because 2^2 + 3^2 + 5^2 + 7^2 + 11^2 = 208 = 8^2 + 12^2.
%t A269931 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 *)
%o A269931 (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) ;
%o A269931 a024450(n) = sum(k=1, n, prime(k)^2);
%o A269931 for(n=1, 1e3, if(isA004215(a024450(n)), print1(n, ", ")));
%o A269931 (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
%Y A269931 Cf. A004215, A024450.
%K A269931 nonn
%O A269931 1,1
%A A269931 _Altug Alkan_, Mar 08 2016