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-9 of 9 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

A056556 First tetrahedral coordinate; repeat m (m+1)*(m+2)/2 times.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Jun 26 2000

Keywords

Comments

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).
From Gus Wiseman, Jul 03 2019: (Start)
Also the maximum number of distinct multiplicities among integer partitions of n. For example, random partitions of 56 realizing each number of distinct multiplicities are:
1: (24,17,6,5,3,1)
2: (10,9,9,5,5,4,4,3,3,2,1,1)
3: (6,5,5,5,4,4,4,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)
4: (28,5,5,3,3,3,2,2,1,1,1,1,1)
5: (13,4,4,4,4,4,3,3,3,2,2,2,2,2,2,1,1)
6: (6,5,5,4,4,4,3,3,3,3,2,2,2,2,2,1,1,1,1,1,1)
The maximum number of distinct multiplicities is 6, so a(56) = 6.
(End)

Examples

			3 is (3+1) * (3+2)/2 = 10 times in the sequence all these occurrences are in consecutive places. The first 3 is at position binomial(3 + 2, 3) = 10, the last one at binomial((3 + 1) + 2, 3) - 1. - _David A. Corneth_, Oct 14 2022
		

Crossrefs

Programs

  • Mathematica
    Table[Table[m, {(m+1)(m+2)/2}], {m, 0, 7}] // Flatten (* Jean-François Alcover, Feb 28 2019 *)
  • PARI
    a(n)=my(t=polrootsreal(x^3+3*x^2+2*x-6*n)); t[#t]\1 \\ Charles R Greathouse IV, Feb 22 2017
    
  • Python
    from math import comb
    from sympy import integer_nthroot
    def A056556(n): return (m:=integer_nthroot(6*(n+1),3)[0])-(nChai Wah Wu, Nov 04 2024

Formula

a(n) = floor(x) where x is the (largest real) solution to x^3 + 3x^2 + 2x - 6n = 0; a(A000292(n)) = n+1.
a(n+1) = a(n)+1 if a(n) = A056558(n), otherwise a(n). - Graeme McRae, Jan 09 2007
a(n) = floor(t/3 + 1/t - 1), where t = (81*n + 3*sqrt(729*n^2 - 3))^(1/3). - Ridouane Oudra, Mar 21 2021
a(n) = floor(t + 1/(3*t) - 1), where t = (6*n)^(1/3), for n>=1. - Ridouane Oudra, Nov 04 2022
a(n) = m if n>=binomial(m+2,3) and a(n) = m-1 otherwise where m = floor((6n+6)^(1/3)). - Chai Wah Wu, Nov 04 2024

Extensions

Incorrect formula deleted by Ridouane Oudra, Nov 04 2022

A056557 Second tetrahedral coordinate.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Jun 26 2000

Keywords

Comments

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

Crossrefs

Programs

  • Python
    from math import isqrt, comb
    from sympy import integer_nthroot
    def A056557(n): return (k:=isqrt(r:=n+1-comb((m:=integer_nthroot(6*(n+1),3)[0])-(nChai Wah Wu, Nov 04 2024

Formula

a(n) = floor((sqrt(8*(n-A056556(n)*(A056556(n)+1)*(A056556(n)+2)/6)+1)-1)/2) = A003056(n-A000292(A056556(n)-1)).
a(n+1) = 0 if A056556(n) = A056558(n); a(n+1) = a(n)+1 if a(n) = A056558(n); otherwise a(n+1) = a(n). - Graeme McRae, Jan 09 2007

A056560 Tetrahedron with T(t,n,k)=n-k; succession of growing finite triangles with increasing values towards bottom left.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Jun 26 2000

Keywords

Examples

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

Crossrefs

Together with A056558 and A056559 might enable reading "by antidiagonals" of cube arrays as 3-dimensional analog of A002262 and A025581 with square arrays.

Formula

a(n) = A056557(n) - A056558(n).

A332662 Put-and-count: An enumeration of N X N where N = {0, 1, 2, ...}. The terms are interleaved x and y coordinates. Or: A row-wise storage scheme for sequences of regular triangles.

Original entry on oeis.org

0, 0, 0, 1, 1, 0, 2, 0, 0, 2, 1, 1, 2, 1, 3, 0, 4, 0, 5, 0, 0, 3, 1, 2, 2, 2, 3, 1, 4, 1, 5, 1, 6, 0, 7, 0, 8, 0, 9, 0, 0, 4, 1, 3, 2, 3, 3, 2, 4, 2, 5, 2, 6, 1, 7, 1, 8, 1, 9, 1, 10, 0, 11, 0, 12, 0, 13, 0, 14, 0, 0, 5, 1, 4, 2, 4, 3, 3, 4, 3, 5, 3, 6, 2, 7, 2
Offset: 0

Views

Author

Peter Luschny, Feb 18 2020

Keywords

Comments

Other enumerations of N X N designed with storage allocation for extensible arrays in mind include A319514 and A319571.

Examples

			Illustrating the linear storage layout of a sequence of regular triangles.
(A) [ 0], [ 2,  3], [ 7,  8,  9], [16, 17, 18, 19], [30, 31, 32, 33, 34], ...
(B) [ 1], [ 5,  6], [13, 14, 15], [26, 27, 28, 29], ...
(C) [ 4], [11, 12], [23, 24, 25], ...
(D) [10], [21, 22], ...
(E) [20], ...
...
The first column is A000292.
The start values of all partial rows (in ascending order) are 0 plus A014370.
The start values of the partial rows in the first row are A005581 (without first 0).
The start values of the partial rows on the main diagonal are A331987.
The end values of all partial rows (in ascending order) are A332023.
The end values of the partial rows in the first row are A062748.
The end values of the partial rows on the main diagonal are A332698.
		

Crossrefs

A332663 (x-coordinates), A056559 (y-coordinates).

Programs

  • Julia
    function a_list(N)
        a = Int[]
        for n in 1:N
            i = 0
            for j in ((k:-1:1) for k in 1:n)
                t = n - j[1]
                for m in j
                    push!(a, i, t)
                    i += 1
    end end end; a end
    a_list(5) |> println
  • Maple
    count := (k, A) -> ListTools:-Occurrences(k, A): t := n -> n*(n+1)/2:
    PutAndCount := proc(N) local L, n, v, c, seq; L := NULL; seq := NULL;
    for n from 1 to N do
       for v from 0 to t(n)-1 do
         # How often did you see v in this sequence before?
         c := count(v, [seq]);
         L := L, v, c; seq := seq, v;
    od od; L end:  PutAndCount(6);
    # Returning 'seq' instead of 'L' gives the x-coordinates (A332663).
  • Mathematica
    t[n_] := n*(n+1)/2;
    PutAndCount[N_] := Module[{L, n, v, c, seq},
    L = {}; seq = {};
    For[n = 1, n <= N, n++,
       For[v = 0, v <= t[n]-1, v++,
          c = Count[seq, v];
          L = Join[L, {v, c}]; seq = Append[seq, v]
    ]]; L];
    PutAndCount[6] (* Jean-François Alcover, Oct 13 2024, after Maple program *)

A127325 Hypertetrahedron with T(W,X,Y,Z) = Y - Z.

Original entry on oeis.org

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

Views

Author

Graeme McRae, Jan 10 2007

Keywords

Comments

Together with A127324, A127326 and A127327 might enable reading "by antidiagonals" of hypercube arrays as 4-dimensional analog of A056558, A056560 and A056559 with cubical arrays.

Examples

			a(23)=1 because A127323(23) - A127324(23) = 1.
See A127327 for a table of A127324, A127325, A127326, A127327.
		

Crossrefs

Formula

a(n) = A127323(n) - A127324(n).

A127326 Hypertetrahedron with T(W,X,Y,Z) = X - Y.

Original entry on oeis.org

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

Views

Author

Graeme McRae, Jan 10 2007

Keywords

Comments

Together with A127324, A127325 and A127327 might enable reading "by antidiagonals" of hypercube arrays as 4-dimensional analog of A056558, A056560 and A056559 with cubical arrays.

Examples

			a(23)=0 because A127322(23) - A127323(23) = 0.
See A127327 for a table of A127324, A127325, A127326, A127327.
		

Crossrefs

Formula

a(n) = A127322(n) - A127323(n).

A127327 Hypertetrahedron with T(W,X,Y,Z) = W - X.

Original entry on oeis.org

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

Views

Author

Graeme McRae, Jan 10 2007

Keywords

Comments

Together with A127324, A127325 and A127326 might enable reading "by antidiagonals" of hypercube arrays as 4-dimensional analog of A056558, A056560 and A056559 with cubical arrays.

Examples

			a(23)=1 because A127321(23) - A127322(23) = 1.
Table of A127324, A127325, A127326, A127327:
   n w,x,y,z
   0 0,0,0,0
   1 0,0,0,1
   2 0,0,1,0
   3 0,1,0,0
   4 1,0,0,0
   5 0,0,0,2
   6 0,0,1,1
   7 0,1,0,1
   8 1,0,0,1
   9 0,0,2,0
  10 0,1,1,0
  11 1,0,1,0
  12 0,2,0,0
  13 1,1,0,0
  14 2,0,0,0
  15 0,0,0,3
  16 0,0,1,2
  17 0,1,0,2
  18 1,0,0,2
  19 0,0,2,1
  20 0,1,1,1
  21 1,0,1,1
  22 0,2,0,1
  23 1,1,0,1
		

Crossrefs

Formula

a(n) = A127321(n) - A127322(n).

A309362 Positions of 0's in A326764 (interpreted as a flat sequence).

Original entry on oeis.org

0, 11, 15, 17, 37, 45, 54, 59, 70, 79, 124, 129, 135, 161, 171, 192, 195, 202, 213, 252, 272, 299, 306, 307, 358, 372, 410, 422, 477, 486, 498, 506, 530, 571, 586, 644, 655, 736, 749, 760, 794, 828, 845, 890, 905, 939, 985, 994, 1087, 1101, 1113, 1168, 1189
Offset: 0

Views

Author

Rémy Sigrist, Jul 25 2019

Keywords

Crossrefs

Programs

  • PARI
    See Links section.

Formula

A326757(n) = A056558(a(n)).
A326758(n) = A056560(a(n)).
A326759(n) = A056559(a(n)).
Showing 1-9 of 9 results.