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.

Previous Showing 11-20 of 34 results. Next

A306460 Number of ways to write n as x*(2x-1) + y*(y+1)/2 + z*(z+1)*(z+2)/6, where x,y,z are nonnegative integers with x > 0.

Original entry on oeis.org

1, 2, 1, 1, 2, 2, 3, 3, 1, 2, 4, 3, 2, 1, 2, 6, 5, 1, 3, 3, 4, 6, 1, 1, 4, 6, 3, 3, 5, 3, 6, 4, 2, 3, 5, 5, 4, 6, 4, 2, 5, 5, 3, 5, 2, 6, 7, 3, 5, 5, 7, 5, 4, 2, 5, 8, 5, 3, 2, 6, 6, 4, 5, 5, 6, 7, 5, 5, 4, 6, 9, 6, 6, 5, 1, 7, 8, 3, 2, 6, 7, 5, 6, 5, 7, 8, 5, 3, 2, 6, 10, 6, 8, 7, 7, 5, 4, 6, 5, 5
Offset: 1

Views

Author

Zhi-Wei Sun, Feb 17 2019

Keywords

Comments

Conjecture 1: a(n) > 0 for all n > 0. In other words, any positive integer n can be written as the sum of a positive hexagonal number, a triangular number and a tetrahedral number.
We have verified a(n) > 0 for all n = 1..10^7.
Conjecture 2: Let c be 1 or 3. Then each n = 0,1,... can be written as c*x(x+1) + y*(y+1)/2 + z*(z+1)*(z+2)/6 with x,y,z nonnegative integers.
Conjecture 3: Let t(x) = x*(x+1)*(x+2)/6. Then each n = 0,1,... can be written as 2*t(w) + t(x) + t(y) + t(z) with w,x,y,z nonnegative integers.
We have verified Conjecture 3 for all n = 0..2*10^5. Clearly, Conjecture 3 implies Pollock's conjecture which states that any natural number is the sum of five tetrahedral numbers.

Examples

			a(3) = 1 with 3 = 1*(2*1-1) + 1*2/2 + 1*2*3/6.
a(14) = 1 with 14 = 1*(2*1-1) + 2*3/2 + 3*4*5/6.
a(75) = 1 with 75 = 5*(2*5-1) + 4*5/2 + 4*5*6/2.
a(349) = 1 with 349 = 5*(2*5-1) + 24*25/2 + 2*3*4/6.
a(369) = 1 with 369 = 4*(2*4-1) + 10*11/2 + 11*12*13/6.
a(495) = 1 with 495 = 8*(2*8-1) + 20*21/2 + 9*10*11/6.
a(642) = 1 with 642 = 16*(2*16-1) + 16*17/2 + 3*4*5/6.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=f[n]=n(n+1)(n+2)/6;
    TQ[n_]:=TQ[n]=IntegerQ[Sqrt[8n+1]];
    tab={};Do[r=0;Do[If[f[z]>=n, Goto[aa]]; Do[If[TQ[n-f[z]-x(2x-1)],r=r+1],{x,1,(Sqrt[8(n-f[z])+1]+1)/4}];Label[aa],{z,0,n}];tab=Append[tab,r],{n,1,100}];Print[tab]

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 *)

A282172 Expansion of (Sum_{k>=0} x^(k*(k+1)*(k+2)/6))^5.

Original entry on oeis.org

1, 5, 10, 10, 10, 21, 30, 20, 15, 30, 35, 30, 40, 40, 35, 60, 65, 25, 30, 60, 46, 50, 80, 50, 55, 120, 95, 20, 60, 90, 60, 80, 100, 40, 80, 145, 85, 30, 90, 85, 105, 155, 100, 40, 155, 170, 90, 80, 100, 90, 171, 145, 40, 60, 140, 110, 125, 130, 80, 140, 250, 170, 70, 110, 140, 160, 190, 140, 90, 180, 220, 170, 95, 70, 110, 215
Offset: 0

Views

Author

Ilya Gutkovskiy, Feb 07 2017

Keywords

Comments

Number of ways to write n as an ordered sum of 5 tetrahedral (or triangular pyramidal) numbers (A000292).
a(n) > 0 for all n ("Pollock's Conjecture").

Examples

			a(4) = 10 because we have:
[4, 0, 0, 0, 0]
[0, 4, 0, 0, 0]
[0, 0, 4, 0, 0]
[0, 0, 0, 4, 0]
[0, 0, 0, 0, 4]
[1, 1, 1, 1, 0]
[1, 1, 1, 0, 1]
[1, 1, 0, 1, 1]
[1, 0, 1, 1, 1]
[0, 1, 1, 1, 1]
		

Crossrefs

Programs

  • Mathematica
    nmax = 75; CoefficientList[Series[(Sum[x^(k (k + 1) (k + 2)/6), {k, 0, nmax}])^5, {x, 0, nmax}], x]

Formula

G.f.: (Sum_{k>=0} x^(k*(k+1)*(k+2)/6))^5.

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

A338494 Least number of pentagonal pyramidal numbers needed to represent n.

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Oct 30 2020

Keywords

Crossrefs

A338495 Least number of hexagonal pyramidal numbers needed to represent n.

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Oct 30 2020

Keywords

Crossrefs

Programs

  • Maple
    N:= 200: # for a(1)..a(N)
    V:= Vector(N):
    S:= {seq(n*(n+1)*(4*n-1)/6,n=1..floor((N*3/2)^(1/3)))}:
    V[convert(S,list)]:= 1:
    T:= S:
    for m from 2 do
      Tn:= select(`<=`,map(t -> op(t +~ S),T),N) minus T;
      if nops(Tn) = 0 then break fi;
      T:= T union Tn;
      V[convert(Tn,list)]:= m
    od:
    convert(V,list); # Robert Israel, Nov 02 2020

A193101 Minimal number of numbers of the form (m^3+5m)/6 (see A004006) needed to sum to n.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Jul 15 2011

Keywords

Comments

Watson showed that a(n) <= 8 for all n.
It is conjectured that a(n) <= 5 for all n.

Crossrefs

Programs

  • Maple
    # LAGRANGE transform of a sequence {a(n)}
    # Suggested by Lagrange's theorem that at most 4 squares are needed to sum to n.
    # Returns b(n) = minimal number of terms of {a} needed to sum to n for 1 <= n <= M.
    # C = maximal number of terms of {a} to try to build n
    # M = upper limit on n
    # Internally, the initial terms of both a and b are taken to be 0, but since this is a number-theoretic function, the output starts at n=1
    LAGRANGE:=proc(a,C,M)
    local t1,ip,i,j,a1,a2,b,c,N1,N2,Nc;
    if whattype(a) <> list then RETURN([]); fi:
    # sort a, remove duplicates, include 0
    t1:=sort(a);
    a1:=sort(convert(convert(a,set),list));
    if not member(0,a1) then a1:=[0,op(a1)]; fi;
    N1:=nops(a1);
    b:=Array(1..M+1,-1);
    for i from 1 to N1 while a1[i]<=M do b[a1[i]+1]:=1; od;
    a2:=a1; N2:=N1;
    for ip from 2 to C do
    c:={}:
       for i from 1 to N1 while a1[i] <= M do
          for j from 1 to N2 while a1[i]+a2[j] <= M do
    c:={op(c),a1[i]+a2[j]};
                                                    od;
                                           od;
    c:=sort(convert(c,list));
    Nc:=nops(c);
       for i from 1 to Nc do
          if b[c[i]+1] = -1 then b[c[i]+1]:= ip; fi;
                          od;
    a2:=c; N2:=Nc;
                       od;
    [seq(b[i],i=2..M+1)];
    end;
    Q:=[seq((m^3+5*m)/6,m=0..20)];
    LAGRANGE(Q,8,120);

A281367 "Nachos" sequence based on triangular numbers.

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, 3, 4, 5, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6, 4, 5, 2, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6, 4, 5, 2, 3, 4, 5, 3, 4, 5, 6, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 2, 3, 4, 5, 3, 4
Offset: 1

Views

Author

N. J. A. Sloane, Jan 30 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 the present sequence.
If S = squares we get A280053.
If S = powers of 2 we get A100661.
More than the usual number of terms are shown in order to distinguish this sequence from A104246.

Examples

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

Crossrefs

For indices of first occurrences of 1,2,3,4,... see A281368.
Different from A104246.

Programs

  • Maple
    S:=[seq(i*(i+1)/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
    A281367 := proc(n)
        local a,nres,i ;
        a := 0 ;
        nres := n;
        while nres > 0 do
            for i from 1 do
                if A000292(i) > nres then
                    break;
                end if;
            end do:
            nres := nres-A000292(i-1) ;
            a := a+1 ;
        end do:
        a ;
    end proc:
    seq(A281367(n),n=1..80) ; # R. J. Mathar, Mar 05 2017
  • Mathematica
    tri[n_] := n (n + 1) (n + 2)/6;
    A281367[n_] := Module[{a = 0, nres = n, i}, While[nres > 0, For[i = 1, True, i++, If[tri[i] > nres, Break[]]]; nres -= tri[i-1]; a++]; a];
    Table[A281367[n], {n, 1, 99}] (* Jean-François Alcover, Apr 11 2024, after R. J. Mathar *)

A283365 Minimal number of numbers in A000332 = { C(k,4); k=1,2,3,... } whose sum equals n.

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Mar 06 2017

Keywords

Comments

Analog, for A000332 = {C(n,4)}, of A061336 (for triangular numbers A000217) and A104246 (for tetrahedral numbers A000292).

Crossrefs

Cf. A000332 = {C(n,4)}; A061336 (analog for triangular numbers A000217), A104246 (analog for tetrahedral numbers A000292).

Programs

  • PARI
    {a(n,k=4,M=9e9,N=n) = (n <= k || M <= k+1) && return(n); for(m=k,M,binomial(m,k)>n && (M=m) && break); M-- <= k && return(n); my(b=binomial(M,k),c=binomial(M-1,k),NN); forstep( nn=n\b,0,-1, if(N>NN=nn+g(n-nn*b,k,M,N,d),N=NN); n-(nn-1)*b >= (N-nn+1)*c && break); N}

Formula

a(n) <= 8 = a(64) for all n, according to Kim (2003, first row of table "d = 4", p. 74), but this "numerical result" has no "* denoting exact values" (see Remark at end of paper), so it could be incorrect. [Disclaimer added by M. F. Hasler, Sep 22 2022]
Previous Showing 11-20 of 34 results. Next