Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A100876
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A100876 Least number of squares that sum to prime(n). +0
1
2, 3, 2, 4, 3, 2, 2, 3, 4, 2, 4, 2, 2, 3, 4, 2, 3, 2, 3, 4, 2, 4, 3, 2, 2, 2, 4, 3, 2, 2, 4, 3, 2, 3, 2, 4, 2, 3, 4, 2, 3, 2, 4, 2, 2, 4, 3, 4, 3, 2, 2, 4, 2, 3, 2, 4, 2, 4, 2, 2, 3, 2, 3, 4, 2, 2, 3, 2, 3, 2, 2, 4, 4, 2, 3, 4, 2, 2, 2, 2, 3, 2, 4, 2, 4, 3, 2, 2, 2, 4, 3, 4, 4, 3, 3, 4, 2, 2, 3, 2, 3, 2, 3, 2, 3 (list; graph; listen)
OFFSET

1,1

COMMENT

Note that a(n) <= 4 by Lagrange's four-square theorem. - T. D. Noe (noe(AT)sspectra.com), Jan 10 2005

FORMULA

a(n) = A002828(prime(n)) - T. D. Noe (noe(AT)sspectra.com), Jan 10 2005

EXAMPLE

a(2)=3 because 3=1^2+1^2+1^2;

a(3)=2 because 5=1^2+2^2;

a(4)=4 because 7=2^2+1^2+1^2+1^2.

MATHEMATICA

Needs["NumberTheory`NumberTheoryFunctions`"]; SquareCnt[n_] := If[SumOfSquaresR[1, n]>0, 1, If[SumOfSquaresR[2, n]>0, 2, If[SumOfSquaresR[3, n]>0, 3, 4]]]; Table[p=Prime[n]; SquareCnt[p], {n, 150}] (T. D. Noe)

CROSSREFS

Cf. A002828 (least number of squares needed to represent n).

Sequence in context: A058973 A155520 A105117 this_sequence A089215 A070296 A072645

Adjacent sequences: A100873 A100874 A100875 this_sequence A100877 A100878 A100879

KEYWORD

nonn

AUTHOR

Giovanni Teofilatto (g.teofilatto(AT)tiscalinet.it), Jan 09 2005

EXTENSIONS

More terms from T. D. Noe (noe(AT)sspectra.com), Jan 10 2005

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified December 16 17:18 EST 2009. Contains 170825 sequences.


AT&T Labs Research