login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Every number is the sum of 4 squares; these are the numbers n for which the first square can be taken to be any positive square < n.
6

%I #25 Jan 27 2018 11:06:44

%S 0,1,2,3,4,5,6,7,9,10,12,13,14,15,17,18,20,21,22,25,26,28,30,33,34,36,

%T 38,41,42,45,46,49,50,52,54,57,58,60,62,65,66,68,70,73,74,78,81,82,84,

%U 86,89,90,94,97,98,100,102,105,106,110,114,118,122,126,129,130

%N Every number is the sum of 4 squares; these are the numbers n for which the first square can be taken to be any positive square < n.

%C The only primes of this form are 2, 3, 5, 7, 13, 17, 41, 73, 89, 97, 257, 313, 353, 433.

%C Also, the numbers n such that for no 0 < k < sqrt(n), n-k^2 is in A004215, i.e., of the form 4^i(8j+7). The largest odd number in this sequence is a(322) = 945, cf. A063951. - _M. F. Hasler_, Jan 26 2018

%D J. H. Conway, personal communication, Aug 27, 2001.

%H T. D. Noe, <a href="/A063949/b063949.txt">Table of n, a(n) for n = 1..1109</a> (numbers < 4000)

%F Consists of 0, the 54 odd numbers in A063951, 4 times those numbers and all numbers of the form 4m+2.

%F a(n) = 4*(n-110) + 2 for all n > 1054. - _M. F. Hasler_, Jan 26 2018

%t t1 = {1, 3, 5, 7, 9, 13, 15, 17, 21, 25, 33, 41, 45, 49, 57, 65, 73, 81, 89, 97, 105, 129, 145, 153, 169, 177, 185, 201, 209, 217, 225, 257, 273, 297, 305, 313, 329, 345, 353, 385, 425, 433, 441, 481, 513, 561, 585, 609, 689, 697, 713, 817, 825, 945}; Union[{0}, t1, 4*t1, 4*Range[0, 999] + 2] (* _T. D. Noe_, Feb 22 2012 *)

%o (PARI) is_A063949(n)=if(bittest(n,0),is_A063951(n),n%4==2||is_A063951(n/4)||!n) \\ _M. F. Hasler_, Jan 26 2018

%o (PARI) #A063949_vec=select( is_A063949, [0..3780]) /* or: setunion(setunion(concat(0,A063951), 4*A063951),apply(t->t-2,4*[1..945])) */

%o (PARI) A063949(n)=if(n>1054,n*4-438,A063949_vec[n]) \\ _M. F. Hasler_, Jan 26 2018

%Y Cf. A063950, A063951, A063952, A063953, A063954.

%K nonn,easy,nice

%O 1,3

%A _N. J. A. Sloane_, Sep 04 2001