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-3 of 3 results.

A281368 Index of first appearance of n in the triangular-based nachos numbers A281367.

Original entry on oeis.org

1, 2, 3, 7, 17, 52, 217, 1757, 35977, 3244071, 2757063867, 68246203026923, 265773420092483210413, 2042495276699414186047172525299, 1376053548027595532701211092865247287361883459, 24062832323766390460579042386921003503968575947499150009246321293279
Offset: 1

Views

Author

N. J. A. Sloane, Jan 30 2017

Keywords

Comments

Using a similar computation as in A280054. - Lars Blomberg, Jan 31 2017

Crossrefs

Extensions

More terms from Lars Blomberg, Jan 31 2017

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

A280053 "Nachos" sequence based on squares.

Original entry on oeis.org

1, 2, 3, 4, 1, 2, 3, 4, 5, 2, 3, 4, 5, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 3, 4, 5, 6, 2, 3, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 3, 4, 5, 6, 2, 3, 4, 5, 6, 3, 4, 5, 6, 7, 4, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 3, 4, 5, 6, 2, 3, 4, 5, 6, 3, 4, 5, 6, 7, 4, 5, 6, 7, 3, 4, 2, 3, 4, 5, 6, 3
Offset: 1

Views

Author

N. J. A. Sloane, Jan 07 2017

Keywords

Comments

The nachos sequence based on a sequence of positive numbers S starting with 1 is defined as follows: To find a(n) we start with a pile of n nachos.
During each phase, we successively remove S(1), then S(2), then S(3), ..., then S(i) nachos from the pile until fewer than S(i+1) remain. Then we start a new phase, successively removing S(1), then S(2), ..., then S(j) nachos from the pile until fewer than S(j+1) remain. Repeat. a(n) is the number of phases required to empty the pile.
Suggested by the Fibonachos sequence A280521, which is the case when S is 1,1,2,3,5,8,13,... (A000045).
If S = 1,2,3,4,5,... we get A057945.
If S = 1,2,3,5,7,11,... (A008578) we get A280055.
If S = triangular numbers we get A281367.
If S = squares we get the present sequence.
If S = powers of 2 we get A100661.
Needs a more professional Maple program.
Comment from Matthew C. Russell, Jan 30 2017 (Start):
Theorem: Any nachos sequence based on a sequence S = {1=s1 < s2 < s3 < ...} is unbounded.
Proof: S is the (infinite) set of numbers that we are allowed to subtract. (In the case of Fibonachos, this is the set of Fibonaccis themselves, not the partial sums.)
Suppose that n is a positive integer, with the number of stages of the process denoted by a(n).
Let s_m be the smallest element of S that is greater than n.
Then, if you start the process at N = n + s1 + s2 + s3 + ... + s_(m-1), you will get stuck when you hit n, and will have to start the process over again. Thus you will take a(n) + 1 stages of the process here, so a(N) = a(n) + 1.
(End)

Examples

			If n = 10, in the first phase we successively remove 1, then 4 nachos, leaving 5 in the pile. The next square is 9, which is bigger than 5, so we start a new phase. We remove 1, then 4 nachos, and now the pile is empty. There were two phases, so a(10)=2.
		

Crossrefs

For indices of first occurrences of 1,2,3,4,... see A280054.

Programs

  • Maple
    S:=[seq(i^2,i=1..1000)];
    phases := proc(n) global S; local a,h,i,j,ipass;
    a:=1; h:=n;
    for ipass from 1 to 100 do
       for i from 1 to 100 do
          j:=S[i];
          if j>h then a:=a+1; break; fi;
          h:=h-j;
          if h=0 then return(a); fi;
                           od;
    od;
    return(-1);
    end;
    t1:=[seq(phases(i),i=1..1000)];
    # 2nd program
    A280053 := proc(n)
        local a,nres,i ;
        a := 0 ;
        nres := n;
        while nres > 0 do
            for i from 1 do
                if A000330(i) > nres then
                    break;
                end if;
            end do:
            nres := nres-A000330(i-1) ;
            a := a+1 ;
        end do:
        a ;
    end proc:
    seq(A280053(n),n=1..80) ; # R. J. Mathar, Mar 05 2017
  • Mathematica
    A280053[n_] := Module[{a, nres, i}, a = 0; nres = n; While[nres > 0, For[i = 1, True, i++, If[i(i+1)(2i+1)/6 > nres, Break[]]]; nres = nres - i(i-1)(2i-1)/6; a++]; a];
    Table[A280053[n], {n, 1, 90}] (* Jean-François Alcover, Mar 16 2023, after R. J. Mathar *)
Showing 1-3 of 3 results.