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 A104246 #71 Jun 06 2025 10:25:30 %S A104246 1,2,3,1,2,3,4,2,3,1,2,3,4,2,3,4,5,3,4,1,2,3,4,2,3,4,5,3,4,2,3,4,5,3, %T A104246 1,2,3,4,2,2,3,4,3,3,2,3,4,4,3,3,4,5,4,4,2,1,2,3,3,2,3,4,4,3,3,2,3,4, %U A104246 4,2,3,4,5,3,3,2,3,4,4,3,4,5,5,1,2,3,4,2,3,3,2,3,4,2,3,3,4,3,4,4,3,4 %N A104246 Minimal number of tetrahedral numbers (A000292(k) = k(k+1)(k+2)/6) needed to sum to n. %C A104246 According to Dickson, Pollock conjectures that a(n) <= 5 for all n. Watson shows that a(n) <= 8 for all n, and Salzer and Levine show that a(n) <= 5 for n <= 452479659. - _N. J. A. Sloane_, Jul 15 2011 %C A104246 Possible correction of the first comment by Sloane 2011: it appears to me from the linked reference by Salzer and Levine 1968 that 452479659 is instead the upper limit for sums of five Qx = Tx + x, where Tx are the tetrahedral numbers we want. They also mention an upper limit for sums of five Tx, which is: a(n) <= 5 for n <= 276976383. - _Ewoud Dronkert_, May 30 2024 %C A104246 If we use the greedy algorithm for this, we get A281367. - _N. J. A. Sloane_, Jan 30 2017 %C A104246 Could be extended with a(0) = 0, in analogy to A061336. Kim (2003, first row of table "d = 3" on p. 73) gives max {a(n)} = 5 as a "numerical result", but the value has no "* denoting exact values" (see Remark at end of paper), which means this could be incorrect. - _M. F. Hasler_, Mar 06 2017, edited Sep 22 2022 %D A104246 Dickson, L. E., History of the Theory of Numbers, Vol. 2: Diophantine Analysis. New York: Dover, 1952, see p. 13. %H A104246 Lars Blomberg, <a href="/A104246/b104246.txt">Table of n, a(n) for n = 1..10000</a> %H A104246 Hyun Kwang Kim, <a href="http://DOI.org/10.1090/S0002-9939-02-06710-2">On regular polytope numbers</a>, Proc. Amer. Math. Soc. 131 (2003), pp. 65-75. %H A104246 F. Pollock, <a href="https://doi.org/10.1098/rspl.1843.0223">On the Extension of the Principle of Fermat's Theorem of the Polygonal Numbers to the Higher Orders of Series Whose Ultimate Differences Are Constant. With a New Theorem Proposed, Applicable to All the Orders</a>, Abs. Papers Commun. Roy. Soc. London 5, 922-924, 1843-1850. %H A104246 H. E. Salzer and N. Levine, <a href="https://doi.org/10.1090/S0025-5718-1958-0099756-3">Table of Integers Not Exceeding 1000000 that are Not Expressible as the Sum of Four Tetrahedral Numbers</a>, Math. Comp. 12, 141-144, 1958. %H A104246 H. E. Salzer and N. Levine, <a href="https://doi.org/10.1090/S0025-5718-1968-0224578-6">Proof that every integer <= 452,479,659 is a sum of five numbers of the form Q_x = (x^3+5x)/6, x >= 0</a>, Math. Comp., (1968), 191-192. %H A104246 N. J. A. Sloane, <a href="/transforms.txt">Transforms</a>. %H A104246 G. L. Watson, <a href="https://doi.org/10.1112/jlms/s1-27.2.217">Sums of eight values of a cubic polynomial</a>, J. London Math. Soc., 27 (1952), 217-224. %H A104246 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/TetrahedralNumber.html">Tetrahedral Number</a>. %p A104246 tet:=[seq((n^3-n)/6,n=1..20)]; %p A104246 LAGRANGE(tet,8, 120); # the LAGRANGE transform of a sequence is defined in A193101. - _N. J. A. Sloane_, Jul 15 2011 %p A104246 # alternative %p A104246 N := 10000: %p A104246 L := [seq(0,i=1..N)] : %p A104246 # put 1's where tetrahedral numbers reside %p A104246 for i from 1 to N do %p A104246 Aj := A000292(i) ; %p A104246 if Aj <= N then %p A104246 L := subsop(Aj=1,L) ; %p A104246 end if; %p A104246 end do: %p A104246 for a from 1 do %p A104246 # select positions of a's, skip forward by all available Aj and %p A104246 # if that addresses a not-yet-set position in the array put a+1 there. %p A104246 for i from 1 to N do %p A104246 if op(i,L) =a then %p A104246 for j from 1 do %p A104246 Aj := A000292(j) ; %p A104246 if i+Aj <=N and op(i+Aj,L) = 0 then %p A104246 L := subsop(i+Aj=a+1,L) ; %p A104246 end if; %p A104246 if i +Aj > N then %p A104246 break ; %p A104246 end if; %p A104246 end do: %p A104246 end if; %p A104246 end do: %p A104246 # if all L[] are non-zero, terminate the loop %p A104246 allset := true; %p A104246 for i from 1 to N do %p A104246 if op(i,L) = 0 then %p A104246 allset := false ; %p A104246 break ; %p A104246 end if; %p A104246 end do: %p A104246 if allset then %p A104246 break ; %p A104246 end if; %p A104246 end do: %p A104246 seq( L[i],i=1..N) ; # _R. J. Mathar_, Jun 06 2025 %o A104246 (PARI) \\ available on request. - _M. F. Hasler_, Mar 06 2017 %o A104246 (PARI) %o A104246 seq(N) = { %o A104246 my(a = vector(N, k, 8), T = k->(k*(k+1)*(k+2))\6); %o A104246 for (n = 1, N, %o A104246 my (k1 = sqrtnint((6*n)\8, 3), k2 = sqrtnint(6*n, 3)); %o A104246 while(n < T(k2), k2--); if (n == T(k2), a[n] = 1; next()); %o A104246 for (k = k1, k2, a[n] = min(a[n], a[n - T(k)] + 1))); a; %o A104246 }; %o A104246 seq(102) \\ _Gheorghe Coserea_, Mar 14 2017 %Y A104246 Cf. A000292 (tetrahedral numbers, indices of 1s), A102795 (indices of 2s), A102796 (indices of 3s), A102797 (indices of 4s), A000797 (numbers that need 5 tetrahedral numbers). %Y A104246 See also A102798-A102806, A102855-A102858, A193101, A193105, A281367 (the "triangular nachos" numbers). %Y A104246 Cf. A061336 (analog for triangular numbers). %K A104246 nonn %O A104246 1,2 %A A104246 _Eric W. Weisstein_, Feb 26 2005 %E A104246 Edited by _N. J. A. Sloane_, Jul 15 2011 %E A104246 Edited by _M. F. Hasler_, Mar 06 2017