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

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A351830 Distance from the n-th square pyramidal number (sum of the first n positive squares) to the nearest square. 6
0, 0, 1, 2, 5, 6, 9, 4, 8, 4, 15, 22, 25, 22, 9, 15, 25, 21, 7, 30, 46, 53, 49, 32, 0, 49, 40, 41, 30, 91, 46, 12, 9, 15, 4, 26, 77, 114, 25, 91, 61, 105, 15, 122, 129, 66, 22, 1, 1, 24, 76, 157, 170, 37, 131, 141, 91, 139, 165, 15, 174, 247, 150, 80, 39, 29 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
COMMENTS
As noted by Conway and Sloane (1999), the only zero terms appear at n = 0, n = 1 and n = 24, and the n = 24 case allows for the Lorentzian construction of the Leech lattice through the A351831 vector.
The zero terms are equivalently the subject of the "pile of cannonballs" problem posed by Lucas and solved by Watson. - Peter Munn, Aug 03 2023
REFERENCES
W. Ljunggren, New solution of a problem proposed by E. Lucas, Norsk Mat. Tidsskr. 34 (1952), pp 65-72.
David Wells, The Penguin Dictionary of Curious and Interesting Numbers, Penguin Books, 1987, entry 24, p 101.
LINKS
Richard E. Borcherds, How to construct the Leech lattice, YouTube video, 2022.
J. H. Conway and N. J. A. Sloane, Lorentzian forms for the Leech lattice, Bulletin (New Series) of the American Mathematical Society, Volume 6, Number 2, March 1982.
J. H. Conway and N. J. A. Sloane, Sphere Packings, Lattices and Groups, 3rd edition, Springer, New York, NY, 1999, pp. 524-528.
E. Lucas, Problem 1180, Nouvelles Ann. Math. (2) 14 (1875), p 336.
G. N. Watson, The problem of the square pyramid, Messenger of Mathematics 48 (1918), pp. 1-22.
Wikipedia, Leech lattice.
FORMULA
From Paolo Xausa, Jul 05 2022: (Start)
a(n) = A053188(A000330(n)).
a(n) = abs(A000330(n) - A353295(n)). (End)
EXAMPLE
a(4) = 5 because the sum of the first 4 positive squares is 1 + 4 + 9 + 16 = 30, the nearest square is 25 and 30 - 25 = 5. - Paolo Xausa, Jul 05 2022
MATHEMATICA
nterms=66; Array[Abs[(s=#(#+1)(2#+1)/6)-Round[Sqrt[s]]^2]&, nterms, 0]
PROG
(Python)
from math import isqrt
def a(n):
t = n*(n+1)*(2*n+1)//6
r = isqrt(t)
return min(t - r**2, (r+1)**2 - t)
print([a(n) for n in range(66)]) # Michael S. Branicky, Feb 21 2022
CROSSREFS
Sequence in context: A136369 A305511 A269472 * A244272 A007573 A285663
KEYWORD
nonn,easy
AUTHOR
Paolo Xausa, Feb 21 2022
EXTENSIONS
Name edited by Peter Munn, Aug 04 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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 26 21:53 EDT 2024. Contains 372004 sequences. (Running on oeis4.)