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

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A360530 a(n) is the smallest positive integer k such that n can be expressed as the arithmetic mean of k nonzero squares. 3
 1, 3, 3, 1, 2, 3, 3, 3, 1, 2, 3, 3, 2, 3, 3, 1, 2, 3, 3, 2, 4, 3, 3, 3, 1, 2, 3, 3, 2, 3, 3, 3, 3, 2, 3, 1, 2, 3, 3, 2, 2, 3, 3, 3, 2, 3, 3, 3, 1, 2, 3, 2, 2, 3, 3, 3, 3, 2, 3, 3, 2, 3, 3, 1, 2, 3, 3, 2, 4, 3, 3, 3, 2, 2, 3, 3, 4, 3, 3, 2, 1, 2, 3, 4, 2, 3, 3 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 COMMENTS a(n) is the smallest number k such that n*k can be expressed as the sum of k nonzero squares. REFERENCES J. H. Conway, The Sensual (Quadratic) Form, M.A.A., 1997, p. 140. LINKS Yifan Xie, Table of n, a(n) for n = 1..10000 Wikipedia, Lagrange's four-square theorem Index entries for sequences related to sums of squares FORMULA a(n) <= 4. Proof: With Lagrange's four-square theorem, if 4*n is not the sum of 4 positive squares (see A000534), then it is easy to express 3*n as the sum of 3 positive squares. - Yifan Xie and Thomas Scheuerle, Apr 29 2023 EXAMPLE For n = 2, if k = 1, 2*1 = 2 is a nonsquare; if k = 2, 2*2 = 4 cannot be expressed as the sum of 2 nonzero squares; if k = 3, 2*3 = 6 = 2^2+1^2+1^2, so a(2) = 3. PROG (PARI) findsquare(k, m) = if(k == 1, issquare(m), for(j=1, m, if(j*j+k > m, return(0), if(findsquare(k-1, m-j*j), return(1))))); a(n) = for(t = 1, n+1, if(findsquare(t, n*t), return(t))); CROSSREFS Cf. A000290, A000378, A000404, A000408, A000414, A000534, A047700. Cf. A362068 (allows zeros), A362110 (distinct). Sequence in context: A225331 A004550 A096836 * A096995 A255941 A010264 Adjacent sequences: A360527 A360528 A360529 * A360531 A360532 A360533 KEYWORD nonn,easy AUTHOR Yifan Xie, Apr 05 2023 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 October 4 19:37 EDT 2023. Contains 365888 sequences. (Running on oeis4.)