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.
%I A151925 #4 Mar 30 2012 17:38:16 %S A151925 1,2,3,4,2,3,4,5,3,2,3,4,2,3,4,5,2,3,3,4,3,3,4,5,2,2,3,4,2,3,4,5,3,2, %T A151925 3,4,2,3,4,5,2,3,3,4,3,3,4,5,3,2,3,4,2,3,4,5,3,2,3,4,2,3,4,5,2,3,3,4, %U A151925 3,3,4,5,2,2,3,4,3,3,4,5,3,2,3,4,2,3,4,5,2,3,3,4,3,3,4,5,2,3,3 %N A151925 Write n as a sum of positive squares a^2+b^2+c^2+... with gcd(a,b,...) = 1; a(n) = minimal number of squares needed. %C A151925 Similar to A002828, but only now primitive representations are allowed. %C A151925 Of course a(n) >= A002828(n). %C A151925 From Lagrange's theorem, a(n) <= 5 (see also Estermann, Grosswald, Th. 3, p. 176). %C A151925 Furthermore, it appears (and should be easy to prove) that: %C A151925 a(n) = 1 iff n=1 %C A151925 a(n) = 2 iff n in A008784\{1} %C A151925 a(n) = 3 iff n in A151926 %C A151925 a(n) = 4 iff n == 4 or 7 mod 8 %C A151925 a(n) = 5 iff n == 0 mod 8 %D A151925 Estermann, T., On the representations of a number as a sum of squares, Acta Arith., 45 (1937), 93-125. %D A151925 E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985. %H A151925 N. J. A. Sloane, <a href="/A151925/b151925.txt">Table of n, a(n) for n = 1..1000</a> %H A151925 N. J. A. Sloane, <a href="/A151925/a151925.txt">Fortran program</a> %e A151925 ..... n .. a(n) ..<- Numbers when squared add to n -> %e A151925 ----------------------------------------------------- %e A151925 ......1......1......1 %e A151925 ......2......2......1......1 %e A151925 ......3......3......1......1......1 %e A151925 ......4......4......1......1......1......1 %e A151925 ......5......2......1......2 %e A151925 ......6......3......1......1......2 %e A151925 ......7......4......1......1......1......2 %e A151925 ......8......5......1......1......1......1......2 %e A151925 ......9......3......1......2......2 %e A151925 .....10......2......1......3 %e A151925 .....11......3......1......1......3 %e A151925 .....12......4......1......1......1......3 %e A151925 .....13......2......2......3 %e A151925 .....14......3......1......2......3 %e A151925 .....15......4......1......1......2......3 %e A151925 .....16......5......1......1......1......2......3 %e A151925 .....17......2......1......4 %e A151925 .....18......3......1......1......4 %e A151925 .....19......3......1......3......3 %e A151925 .....20......4......1......1......3......3 %K A151925 nonn %O A151925 1,2 %A A151925 _N. J. A. Sloane_ and _Vinay Vaishampayan_, Aug 06 2009, Aug 07 2009