login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 3
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

Similar to A002828, but only now primitive representations are allowed.

Of course a(n) >= A002828(n).

From Lagrange's theorem, a(n) <= 5 (see also Estermann, Grosswald, Th. 3, p. 176).

Furthermore, it appears (and should be easy to prove) that:

a(n) = 1 iff n=1

a(n) = 2 iff n in A008784\{1}

a(n) = 3 iff n in A151926

a(n) = 4 iff n == 4 or 7 mod 8

a(n) = 5 iff n == 0 mod 8

REFERENCES

Estermann, T., On the representations of a number as a sum of squares, Acta Arith., 45 (1937), 93-125.

E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985.

LINKS

N. J. A. Sloane, Table of n, a(n) for n = 1..1000

N. J. A. Sloane, Fortran program

EXAMPLE

..... n .. a(n) ..<- Numbers when squared add to n ->

-----------------------------------------------------

......1......1......1

......2......2......1......1

......3......3......1......1......1

......4......4......1......1......1......1

......5......2......1......2

......6......3......1......1......2

......7......4......1......1......1......2

......8......5......1......1......1......1......2

......9......3......1......2......2

.....10......2......1......3

.....11......3......1......1......3

.....12......4......1......1......1......3

.....13......2......2......3

.....14......3......1......2......3

.....15......4......1......1......2......3

.....16......5......1......1......1......2......3

.....17......2......1......4

.....18......3......1......1......4

.....19......3......1......3......3

.....20......4......1......1......3......3

CROSSREFS

Sequence in context: A262304 A333609 A273149 * A106653 A173524 A049865

Adjacent sequences:  A151922 A151923 A151924 * A151926 A151927 A151928

KEYWORD

nonn

AUTHOR

N. J. A. Sloane and Vinay Vaishampayan, Aug 06 2009, Aug 07 2009

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 23 12:43 EDT 2021. Contains 347617 sequences. (Running on oeis4.)