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

A056558 Third tetrahedral coordinate, i.e., tetrahedron with T(t,n,k)=k; succession of growing finite triangles with increasing values towards bottom right.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Jun 26 2000

Keywords

Comments

Alternatively, write n = C(i,3)+C(j,2)+C(k,1) with i>j>k>=0; sequence gives k values. See A194847 for further information about this interpretation.
If {(X,Y,Z)} are triples of nonnegative integers with X>=Y>=Z ordered by X, Y and Z, then X=A056556(n), Y=A056557(n) and Z=A056558(n).
This is a 'Matryoshka doll' sequence with alpha=0 (cf. A000292 and A000178). - Peter Luschny, Jul 14 2009

Examples

			First triangle: [0]; second triangle: [0; 0 1]; third triangle: [0; 0 1; 0 1 2]; ...
		

References

  • D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.2.1.3, Eq. (20), p. 360.

Crossrefs

Together with A056559 and A056560 might enable reading "by antidiagonals" of cube arrays as 3-dimensional analog of A002262 and A025581 with square arrays. Also cf. A000292, A056556, A056557.
See also A194847, A194848, A194849.

Programs

  • Haskell
    import Data.List (inits)
    a056558 n = a056558_list !! n
    a056558_list = concatMap (concat . init . inits . enumFromTo 0) [0..]
    -- Reinhard Zumkeller, Jun 01 2015
    
  • Maple
    seq(seq(seq(i,i=0..k),k=0..n),n=0..6); # Peter Luschny, Sep 22 2011
  • Mathematica
    Table[i, {k, 0, 7}, {j, 0, k}, {i, 0, j}] // Flatten  (* Robert G. Wilson v, Sep 27 2011 *)
  • PARI
    T(t,n,k)=k \\ Charles R Greathouse IV, Feb 22 2017
    
  • Python
    from math import isqrt, comb
    from sympy import integer_nthroot
    def A056558(n): return (r:=n-comb((m:=integer_nthroot(6*(n+1),3)[0])+(n>=comb(m+2,3))+1,3))-comb((k:=isqrt(m:=r+1<<1))+(m>k*(k+1)),2) # Chai Wah Wu, Nov 04 2024

Formula

a(n) = n-A056556(n)*(A056556(n)+1)*(A056556(n)+2)/6-A056557(n)*(A056557(n)+1)/2 = n-A000292(A056556(n)-1)-A000217(A056557(n)) = A056557(n)-A056560(n).
a(n+1) = A056556(n)==a(n) ? 0 : A056557(n)==a(n) ? 0 : a(n)+1. - Graeme McRae, Jan 09 2007

A194847 Write n = C(i,3)+C(j,2)+C(k,1) with i>j>k>=0; sequence gives i values.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Sep 03 2011

Keywords

Comments

Each n >= 0 has a unique representation as n = C(i,3)+C(j,2)+C(k,1) with i>j>k>=0. This is the combinatorial number system of degree t = 3, where we get [A194847, A194848, A056558]. For degree t = 2 we get [A002024, A002262] and A138036.

Examples

			The i,j,k coordinates for n equal to 0 through 10 are:
0, [2, 1, 0]
1, [3, 1, 0]
2, [3, 2, 0]
3, [3, 2, 1]
4, [4, 1, 0]
5, [4, 2, 0]
6, [4, 2, 1]
7, [4, 3, 0]
8, [4, 3, 1]
9, [4, 3, 2]
10, [5, 1, 0]
		

References

  • D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.2.1.3, Eq. (20), p. 360.

Crossrefs

The [i,j,k] values are [A194847, A194848, A056558], or equivalently [A056556+2, A056557+1, A056558]. See A194849 for the union list of triples.
Cf. also A002024, A002262, A138036.

Programs

  • Maple
    # Given x and a list a, returns smallest i such that x >= a[i].
    whereinlist:=proc(x,a)  local i:
    if whattype(a) <> list then ERROR(`a not a list`); fi:
    for i from 1 to nops(a) do if x < a[i] then break; fi; od:
    RETURN(i-1); end:
    t3:=[seq(binomial(n,3),n=0..50)];
    t2:=[seq(binomial(n,2),n=0..50)];
    t1:=[seq(binomial(n,1),n=0..50)];
    for n from 0 to 200 do
    i3:=whereinlist(n,t3);
    i2:=whereinlist(n-t3[i3],t2);
    i1:=whereinlist(n-t3[i3]-t2[i2],t1);
    L[n]:=[i3-1,i2-1,i1-1];
    od:
    [seq(L[n][1],n=0..200)];
  • Python
    from math import comb
    from sympy import integer_nthroot
    def A194847(n): return (m:=integer_nthroot(6*(n+1),3)[0])+(n>=comb(m+2,3))+1 # Chai Wah Wu, Nov 05 2024

Formula

Equals A056556(n) + 2.

A194882 Write n = C(i,4)+C(j,3)+C(k,2)+C(l,1) with i>j>k>l>=0; sequence gives i values.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Sep 04 2011

Keywords

Comments

Each n >= 0 has a unique representation as n = C(i,4)+C(j,3)+C(k,2)+C(l.1) with i>j>k>l>=0. This is the combinatorial number system of degree t = 4, where we get [A194882, A194883, A194884, A127324]. For degree t = 3 see A194847.

References

  • D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.2.1.3, Eq. (20), p. 360.

Crossrefs

Programs

  • Python
    from math import comb
    from sympy import integer_nthroot
    def A194882(n): return (m:=integer_nthroot(24*(n+2),4)[0]+1)+(n>=comb(m+1,4)) # Chai Wah Wu, Dec 10 2024

Formula

a(n) = m if n < binomial(m+1,4) and a(n) = m+1 otherwise where m = 1+floor((24*(n+2))^(1/4)). - Chai Wah Wu, Dec 10 2024

A194883 Write n = C(i,4)+C(j,3)+C(k,2)+C(l,1) with i>j>k>l>=0; sequence gives j values.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Sep 04 2011

Keywords

Comments

Each n >= 0 has a unique representation as n = C(i,4)+C(j,3)+C(k,2)+C(l.1) with i>j>k>l>=0. This is the combinatorial number system of degree t = 4, where we get [A194882, A194883, A194884, A127324]. For degree t = 3 see A194847.

References

  • D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.2.1.3, Eq. (20), p. 360.

Crossrefs

A194884 Write n = C(i,4)+C(j,3)+C(k,2)+C(l,1) with i>j>k>l>=0; sequence gives k values.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Sep 04 2011

Keywords

Comments

Each n >= 0 has a unique representation as n = C(i,4)+C(j,3)+C(k,2)+C(l.1) with i>j>k>l>=0. This is the combinatorial number system of degree t = 4, where we get [A194882, A194883, A194884, A127324]. For degree t = 3 see A194847.

References

  • D. E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.2.1.3, Eq. (20), p. 360.

Crossrefs

Showing 1-5 of 5 results.