The OEIS is supported by the many generous donors to the OEIS Foundation.

 Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 59th year, we have over 358,000 sequences, and we’ve crossed 10,300 citations (which often say “discovered thanks to the OEIS”). Other ways to Give
 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A006892 Representation as a sum of squares requires n squares with greedy algorithm. (Formerly M0860) 7
 1, 2, 3, 7, 23, 167, 7223, 13053767, 42600227803223, 453694852221687377444001767, 51459754733114686962148583993443846186613037940783223 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 COMMENTS Of course Lagrange's theorem tells us that any positive integer can be written as a sum of at most four squares (cf. A004215). Records in A053610. - Hugo van der Sanden, Jun 24 2015 REFERENCES N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). LINKS Rick L. Shepherd, Table of n, a(n) for n = 1..15 Art of Problem Solving, 2010 AMC 10A Problems/Problem 25 [From Rick L. Shepherd, Jan 28 2014] E. Lemoine, Décomposition d'un nombre entier N en ses puissances nièmes maxima, C. R. Acad. Sci. Paris, Vol. 95, pp. 719-722, 1882 (then next pages). FORMULA For n >= 4, a(n) = a(n-1) + ((a(n-1)+1)/2)^2. - Joe K. Crump (joecr(AT)carolina.rr.com), Apr 16 2000 a(n) = n for n <= 3; for n > 3, a(n) = ((a(n-1)+3)/2)^2 - 2. - Arkadiusz Wesolowski, Mar 30 2013 a(n+2) = 2 * A053630(n) - 3. - Thomas Ordowski, Jul 14 2014 a(n+3) = A053630(n)^2 - 2. - Thomas Ordowski, Jul 19 2014 EXAMPLE Here is why a(5) = 23: start with 23, subtract largest square <= 23, which is 16, getting 7. Now subtract largest square <= 7, which is 4, getting 3. Now subtract largest square <= 3, which is 1, getting 2. Now subtract largest square <= 2, which is 1, getting 1. Now subtract largest square <= 1, which is 1, getting 0. Thus 23 = 16+4+1+1+1. It took 5 steps to get to 0, and 23 is the smallest number which takes 5 steps. - N. J. A. Sloane, Jan 29 2014 PROG (PARI) a(n) = if (n <= 3, n , ((a(n-1)+3)/2)^2 - 2) \\ Michel Marcus, May 25 2013 CROSSREFS Cf. A004215, A053610. Sequence in context: A108176 A111235 A066356 * A296397 A102710 A048824 Adjacent sequences: A006889 A006890 A006891 * A006893 A006894 A006895 KEYWORD nonn AUTHOR EXTENSIONS Four more terms from Rick L. Shepherd, Jan 27 2014 STATUS approved

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

Last modified November 26 20:27 EST 2022. Contains 358362 sequences. (Running on oeis4.)