cp's OEIS Frontend

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.

Showing 1-7 of 7 results.

A104246 Minimal number of tetrahedral numbers (A000292(k) = k(k+1)(k+2)/6) needed to sum to n.

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Eric W. Weisstein, Feb 26 2005

Keywords

Comments

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
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
If we use the greedy algorithm for this, we get A281367. - N. J. A. Sloane, Jan 30 2017
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

References

  • Dickson, L. E., History of the Theory of Numbers, Vol. 2: Diophantine Analysis. New York: Dover, 1952, see p. 13.

Crossrefs

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).
See also A102798-A102806, A102855-A102858, A193101, A193105, A281367 (the "triangular nachos" numbers).
Cf. A061336 (analog for triangular numbers).

Programs

  • Maple
    tet:=[seq((n^3-n)/6,n=1..20)];
    LAGRANGE(tet,8, 120); # the LAGRANGE transform of a sequence is defined in A193101. - N. J. A. Sloane, Jul 15 2011
    # alternative
    N := 10000:
    L := [seq(0,i=1..N)] :
    # put 1's where tetrahedral numbers reside
    for i from 1 to N do
        Aj := A000292(i) ;
        if Aj <= N then
            L := subsop(Aj=1,L) ;
        end if;
    end do:
    for a from 1 do
        # select positions of a's, skip forward by all available Aj and
        # if that addresses a not-yet-set position in the array put a+1 there.
        for i from 1 to N do
            if op(i,L) =a then
                for j from 1 do
                    Aj := A000292(j) ;
                    if i+Aj <=N and op(i+Aj,L) = 0 then
                        L := subsop(i+Aj=a+1,L) ;
                    end if;
                    if i +Aj > N then
                        break ;
                    end if;
                end do:
            end if;
        end do:
        # if all L[] are non-zero, terminate the loop
        allset := true;
        for i from 1 to N do
            if op(i,L) = 0 then
                allset := false ;
                break ;
            end if;
        end do:
        if allset then
            break ;
        end if;
    end do:
    seq( L[i],i=1..N) ; # R. J. Mathar, Jun 06 2025
  • PARI
    \\ available on request. - M. F. Hasler, Mar 06 2017
    
  • PARI
    seq(N) = {
      my(a = vector(N, k, 8), T = k->(k*(k+1)*(k+2))\6);
      for (n = 1, N,
        my (k1 = sqrtnint((6*n)\8, 3), k2 = sqrtnint(6*n, 3));
        while(n < T(k2), k2--); if (n == T(k2), a[n] = 1; next());
        for (k = k1, k2, a[n] = min(a[n], a[n - T(k)] + 1))); a;
    };
    seq(102)  \\ Gheorghe Coserea, Mar 14 2017

Extensions

Edited by N. J. A. Sloane, Jul 15 2011
Edited by M. F. Hasler, Mar 06 2017

A102795 Let f(n) = A104246(n) be the minimal number of nonzero tetrahedral numbers that add to n; sequence gives numbers n for which f(n) = 2.

Original entry on oeis.org

2, 5, 8, 11, 14, 21, 24, 30, 36, 39, 40, 45, 55, 57, 60, 66, 70, 76, 85, 88, 91, 94, 104, 112, 119, 121, 124, 130, 140, 155, 166, 168, 169, 175, 176, 185, 200, 204, 221, 224, 230, 240, 249, 255, 276, 285, 287, 290, 296, 304, 306, 321, 330, 340, 342
Offset: 1

Views

Author

Jud McCranie, Feb 26 2005

Keywords

Crossrefs

A102857 Sum of 1, 2 or 3 distinct tetrahedral numbers.

Original entry on oeis.org

0, 1, 4, 5, 10, 11, 14, 15, 20, 21, 24, 25, 30, 31, 34, 35, 36, 39, 40, 45, 46, 49, 55, 56, 57, 59, 60, 61, 65, 66, 67, 70, 76, 77, 80, 84, 85, 86, 88, 89, 91, 92, 94, 95, 98, 101, 104, 105, 108, 111, 114, 119, 120, 121, 123, 124, 125, 129, 130, 131, 134, 139
Offset: 1

Views

Author

Jud McCranie, Mar 01 2005

Keywords

Crossrefs

Cf. A102856 (subsequence), A102802 (subsequence 3 dist. posit.).

Programs

  • Mathematica
    Module[{nn=10,tetra},tetra=Table[(n(n+1)(n+2))/6,{n,nn}];Rest[Union[ Total/@ Subsets[tetra,3]]]] (* Harvey P. Dale, Nov 17 2017 *)

Extensions

a(1)=0 prepended. - R. J. Mathar, Jun 05 2025

A102855 Minimal number of distinct nonzero tetrahedral numbers needed to represent n, or -1 if no such representation is possible.

Original entry on oeis.org

1, -1, -1, 1, 2, -1, -1, -1, -1, 1, 2, -1, -1, 2, 3, -1, -1, -1, -1, 1, 2, -1, -1, 2, 3, -1, -1, -1, -1, 2, 3, -1, -1, 3, 1, 2, -1, -1, 2, 3, -1, -1, -1, -1, 2, 3, -1, -1, 3, 4, -1, -1, -1, -1, 2, 1, 2, -1, 3, 2, 3, -1, -1, -1, 3, 2, 3, -1, 4, 3, 4, -1, -1, -1, -1, 2, 3, -1, -1
Offset: 1

Views

Author

Jud McCranie, Mar 01 2005

Keywords

Crossrefs

Programs

  • Maple
    N:= 100; # for a(1)..a(N)
    ft:= t -> t*(t+1)*(t+2)/6:
    tets:= map(ft, [$1..floor((6*N)^(1/3))]:
    f:= proc(n,tmax) option remember;
       local res, s;
       if member(n, tets) and n < tmax then return 1 fi;
       min(seq(1 + procname(n-s,s), s=select(`<`,tets,min(n,tmax))));
    end proc:
    subs(infinity=-1,map(f, [$1..N],infinity)); # Robert Israel, Dec 29 2019
  • Mathematica
    M = 100; (* number of terms *)
    ft[t_] := t(t+1)(t+2)/6;
    tets = ft /@ Range[1, Floor[(6M)^(1/3)]];
    f[n_, tmax_] := f[n, tmax] = If[MemberQ[tets, n] && n < tmax, 1, Min[ Table[1 + f[n-s, s], {s, Select[tets, # < Min[n, tmax]&]}]]];
    f[#, Infinity]& /@ Range[1, M] /. Infinity -> -1 (* Jean-François Alcover, Aug 05 2022, after Robert Israel *)

A102856 Sum of 1 or 2 distinct tetrahedral numbers.

Original entry on oeis.org

0, 1, 4, 5, 10, 11, 14, 20, 21, 24, 30, 35, 36, 39, 45, 55, 56, 57, 60, 66, 76, 84, 85, 88, 91, 94, 104, 119, 120, 121, 124, 130, 140, 155, 165, 166, 169, 175, 176, 185, 200, 204, 220, 221, 224, 230, 240, 249, 255, 276, 285, 286, 287, 290, 296, 304, 306
Offset: 1

Views

Author

Jud McCranie, Mar 01 2005

Keywords

Crossrefs

Cf. A102801 (sums if 2 distinct positive)

Programs

  • Maple
    N:= 1000: # for terms <= N
    R:= 0:
    for i from 1 do
      ti:= i*(i+1)*(i+2)/6;
      if ti > N then break fi;
      for j from 0 to i-1 do
         v:= ti + j*(j+1)*(j+2)/6;
         if v > N then break fi;
         R:= R, v;
      od;
    od:
    sort(convert({R},list)); # Robert Israel, Jan 16 2024
  • Mathematica
    Module[{nn=12, tetra}, tetra=Table[(n(n+1)(n+2))/6, {n, nn}]; Union[ Total/@ Subsets[tetra, 2]]] (* James C. McMahon, Jan 12 2024 *)

Extensions

a(1) = 0 prepended by James C. McMahon, Jan 15 2024

A102858 Sum of 1, 2, or 4 distinct tetrahedral numbers.

Original entry on oeis.org

0, 1, 4, 5, 10, 11, 14, 15, 20, 21, 24, 25, 30, 31, 34, 35, 36, 39, 40, 45, 46, 49, 50, 55, 56, 57, 59, 60, 61, 65, 66, 67, 69, 70, 71, 76, 77, 80, 81, 84, 85, 86, 87, 88, 89, 90, 91, 92, 94, 95, 96, 98, 99, 101, 102, 104, 105, 108, 109, 111, 112, 114, 115, 118
Offset: 1

Views

Author

Jud McCranie, Mar 01 2005

Keywords

Crossrefs

Cf. A102856 (subsequence).

Extensions

a(1)=0 prepended. - R. J. Mathar, Jun 05 2025

A352350 a(n) is the largest number that is not the sum of distinct n-gonal pyramidal numbers.

Original entry on oeis.org

558, 1528, 2266, 3362, 5117, 6157, 9808, 9947, 13904, 17340, 17187, 19912, 27719
Offset: 3

Views

Author

Ilya Gutkovskiy, Mar 12 2022

Keywords

Crossrefs

Showing 1-7 of 7 results.