This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A351830 #37 May 08 2025 02:21:44 %S A351830 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, %T A351830 41,30,91,46,12,9,15,4,26,77,114,25,91,61,105,15,122,129,66,22,1,1,24, %U A351830 76,157,170,37,131,141,91,139,165,15,174,247,150,80,39,29 %N A351830 Distance from the n-th square pyramidal number (sum of the first n positive squares) to the nearest square. %C A351830 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. %C A351830 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 %D A351830 W. Ljunggren, New solution of a problem proposed by E. Lucas, Norsk Mat. Tidsskr. 34 (1952), pp 65-72. %D A351830 David Wells, The Penguin Dictionary of Curious and Interesting Numbers, Penguin Books, 1987, entry 24, p 101. %H A351830 Paolo Xausa, <a href="/A351830/b351830.txt">Table of n, a(n) for n = 0..9999</a> %H A351830 Michael A. Bennett, <a href="http://www.math.ubc.ca/~bennett/paper21.pdf">Lucas' Square Pyramid Problem Revisited</a>. %H A351830 Richard E. Borcherds, <a href="https://www.youtube.com/watch?v=ycpmMnO3-Uk">How to construct the Leech lattice</a>, YouTube video, 2022. %H A351830 J. H. Conway and N. J. A. Sloane, <a href="https://doi.org/10.1090/S0273-0979-1982-14985-0">Lorentzian forms for the Leech lattice</a>, Bulletin (New Series) of the American Mathematical Society, Volume 6, Number 2, March 1982. %H A351830 J. H. Conway and N. J. A. Sloane, <a href="https://doi.org/10.1007/978-1-4757-6568-7">Sphere Packings, Lattices and Groups</a>, 3rd edition, Springer, New York, NY, 1999, pp. 524-528. %H A351830 Anji Dong, Katerina Saettone, Kendra Song, and Alexandru Zaharescu, <a href="https://arxiv.org/abs/2505.04166">An Equidistribution Result for Differences Associated to Square Pyramidal Numbers II</a>, arXiv:2505.04166 [math.NT], 2025. %H A351830 E. Lucas, <a href="http://www.numdam.org/item/NAM_1875_2_14__336_0/">Problem 1180</a>, Nouvelles Ann. Math. (2) 14 (1875), p 336. %H A351830 G. N. Watson, <a href="http://archive.org/stream/messengerofmathe4849cambuoft#page/n9/mode/2up">The problem of the square pyramid</a>, Messenger of Mathematics 48 (1918), pp. 1-22. %H A351830 Wikipedia, <a href="https://en.wikipedia.org/wiki/Leech_lattice">Leech lattice</a>. %F A351830 From _Paolo Xausa_, Jul 05 2022: (Start) %F A351830 a(n) = A053188(A000330(n)). %F A351830 a(n) = abs(A000330(n) - A353295(n)). (End) %e A351830 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 %t A351830 nterms=66;Array[Abs[(s=#(#+1)(2#+1)/6)-Round[Sqrt[s]]^2]&,nterms,0] %o A351830 (Python) %o A351830 from math import isqrt %o A351830 def a(n): %o A351830 t = n*(n+1)*(2*n+1)//6 %o A351830 r = isqrt(t) %o A351830 return min(t - r**2, (r+1)**2 - t) %o A351830 print([a(n) for n in range(66)]) # _Michael S. Branicky_, Feb 21 2022 %Y A351830 Cf. A000290, A000330, A053188, A351831, A353295, A354330, A363284. %K A351830 nonn,easy %O A351830 0,4 %A A351830 _Paolo Xausa_, Feb 21 2022 %E A351830 Name edited by _Peter Munn_, Aug 04 2023