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 21-25 of 25 results.

A213183 Initialize a(1)=R=1. Repeat: copy the last R preceding terms to current position; increment R; do twice: append the least integer that has not appeared in the sequence yet.

Original entry on oeis.org

1, 1, 2, 3, 2, 3, 4, 5, 3, 4, 5, 6, 7, 4, 5, 6, 7, 8, 9, 5, 6, 7, 8, 9, 10, 11, 6, 7, 8, 9, 10, 11, 12, 13, 7, 8, 9, 10, 11, 12, 13, 14, 15, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 11, 12
Offset: 1

Views

Author

Alex Ratushnyak, Mar 05 2013

Keywords

Comments

Every positive integer k occurs floor((k+3)/2) times: 1 and 2 occur twice, 3 and 4 thrice, 5 and 6 four times, and so on.

Examples

			a(1) = 1  -- initial value
a(2) = 1  -- copied one last term
a(3)=2, a(4)=3  -- appended two terms
a(5)=2, a(6)=3  -- copied two last terms
a(7)=4, a(8)=5  -- appended two terms
a(9)=3, a(10)=4, a(11)=5  -- copied three last terms
a(12)=6, a(13)=7  -- appended two terms
a(14)=4, a(15)=5, a(16)=6, a(17)=7  -- copied four last terms
a(18)=8, a(19)=9  -- appended two terms, and so on.
Comments from _N. J. A. Sloane_, Apr 28 2020, following a suggestion from _Paul Curtz_: (Start)
With an initial -1, 0, this may also be regarded as a triangle read by rows:
  -1;
   0,  1;
   1,  2,  3;
   2,  3,  4,  5;
   3,  4,  5,  6,  7;
   4,  5,  6,  7,  8,  9;
   5,  6,  7,  8,  9, 10, 11;
   6,  7,  8,  9, 10, 11, 12, 13;
  ...
or as an array read by upward antidiagonals:
  -1,  1,  3,  5,  7,  9, 11, ...
   0,  2,  4,  6,  8, 10, ...
   1,  3,  5,  7,  9, ...
   2,  4,  6,  8, ...
   3,  5,  7, ...
   4,  6, ...
   5, ...
  ...
(End)
		

Crossrefs

If we prefix this with -1, 0, and then add 1 to every term, we get A051162.

Programs

  • Python
    a = [1]*992
    R = 1
    i = 2
    while i<900:
            for t in range(R):
                    a[i] = a[i-R]
                    i += 1
            R += 1
            a[i] = a[i-1] + 1
            i += 1
            a[i] = a[i-1] + 1
            i += 1
    for i in range(1,99):
            print(a[i], end=',')

A230445 Triangle read by rows: T(n,m) = 3^m*2^(n-m)-1, the number of neighbors in an n-dimensional cubic array.

Original entry on oeis.org

0, 1, 2, 3, 5, 8, 7, 11, 17, 26, 15, 23, 35, 53, 80, 31, 47, 71, 107, 161, 242, 63, 95, 143, 215, 323, 485, 728, 127, 191, 287, 431, 647, 971, 1457, 2186, 255, 383, 575, 863, 1295, 1943, 2915, 4373, 6560, 511, 767, 1151, 1727, 2591, 3887, 5831, 8747, 13121
Offset: 0

Views

Author

Ron R. King, Oct 18 2013

Keywords

Comments

Let n be the dimension of the cubic array.
Let m be the "placement depth" of the cell within the array. m = (number of horizontal or vertical neighbors)-n. 0 <= m <= n.
Let T(n,m) represent the number of neighbors (horizontally, vertically, or diagonally) a cell has in an n-dimensional cube that has at least 3^n cells.
The sequence forms a triangle structure similar to Pascal’s triangle: T(0,0) in row one, T(1,0), T(1,1) in row two, etc.
The triangle in A094615 is a subtriangle. - Philippe Deléham, Oct 31 2013
In a finite n-dimensional hypercube lattice, the sequence gives the number of nodes situated at a Chebyshev distance of 1 for a node, situated on an m-cube bound, which is not on an (m-1)-cube bound. The number of m-cube bounds for n-cube is given by A013609. In cellular automata theory, the cell surrounding with Chebyshev distance 1 is called Moore's neighborhood. For von Neumann neighborhood (with Manhattan distance 1), an analogous sequence is represented by A051162. - Dmitry Zaitsev, Oct 22 2015

Examples

			Triangle starts:
n \ m  0    1    2    3    4    5     6     7     8     9    10 ...
0:     0
1:     1    2
2:     3    5    8
3:     7   11   17   26
4:    15   23   35   53   80
5:    31   47   71  107  161  242
6:    63   95  143  215  323  485   728
7:   127  191  287  431  647  971  1457  2186
8:   255  383  575  863 1295 1943  2915  4373  6560
9:   511  767 1151 1727 2591 3887  5831  8747 13121 19682
10: 1023 1535 2303 3455 5183 7775 11663 17495 26243 39365 59048
... (reformatted (and extended) by _Wolfdieter Lang_, May 04 2022)
For a 3-d cube, at a corner, the number of horizontal and vertical neighbors is 3, hence m = 3-3 = 0.
Along the edge, the number of horizontal and vertical neighbors is 4, hence m = 4-3 = 1.
In a face, the number of horizontal and vertical neighbors is 5, hence m = 5-3 = 2.
In the interior, the number of horizontal and vertical neighbors is 6, hence m = 6-3 = 3.
T(3,2) = 17 because a cell on the face of a 3-d cube has 17 neighbors.
		

Crossrefs

Sequence numbers are 1 less than A036561.

Programs

  • C
    void a10(){int p3[10], p2[10], n, m, a; p3[0]=1; p2[0]=1;
    for(n=1;n<10;n++){ p2[n]=p2[n-1]*2; p3[n]=p3[n-1]*3;
      for(m=0;m<=d;m++){ a=p3[m]*p2[n-m]-1; printf("%d ",a); }
      printf("\n"); } } /* Dmitry Zaitsev, Oct 23 2015 */
  • Mathematica
    Table[3^m 2^(n - m) - 1, {n, 0, 9}, {m, 0, n}] // Flatten (* Michael De Vlieger, Oct 23 2015 *)

Formula

T(n,m) = 3^m*2^(n-m)-1, 0 <= m <= n.
T(n,0) = 2^n-1. (A000225)
T(n,n) = 3^n-1. (A024023)
T(n,m) = (3*T(n,m-1)+1)/2, first part of the Collatz sequence for the number 2^n-1, for n >= 1.
T(n,m) = (T(n-1,m) + T(n,m+1))/2, 0 <= m <= n-1.
T(n,m) = 1 + T(n-1,m-1) + T(n,m-1), 1 <= m <= n.
m = T2(n,k)-n, where T2(n,k) is A051162.
From Wolfdieter Lang, May 04 2022: (Start)
G.f. for column m: G(m, x) = x^m*(3^m - 1 - (3^m - 2)*x)/((1 - 2*x)*(1 - x)).
G.f. for row polynomials R(n, x) = Sum_{m=1..n} T(n, m)*x^m, for n >= 0: G(z, x) = z*(1 + (2 - 5*z)*x)/((1 - 2*z)*(1 - z)*(1 - 3*x*z)*(1 - x*z)).
(End)

A354388 Table read upward by antidiagonals: the n-th row gives the sums of each weakly decreasing nonnegative integer sequence of length n, listed in lexicographic order.

Original entry on oeis.org

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

Views

Author

Peter Kagey, May 24 2022

Keywords

Examples

			For n = 3, the weakly decreasing nonnegative integer sequences of length 3 listed in lexicographic order are (0,0,0), (1,0,0), (1,1,0), (1,1,1), (2,0,0), (2,1,0), (2,1,1), ....
The sums of these sequences correspond to row 3.
The table begins:
   1 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, ...
   2 | 0, 1, 2, 2, 3, 4, 3, 4, 5, 6,  4,  5,  6,  7,  8, ...
   3 | 0, 1, 2, 3, 2, 3, 4, 4, 5, 6,  3,  4,  5,  5,  6, ...
   4 | 0, 1, 2, 3, 4, 2, 3, 4, 5, 4,  5,  6,  6,  7,  8, ...
   5 | 0, 1, 2, 3, 4, 5, 2, 3, 4, 5,  6,  4,  5,  6,  7, ...
   6 | 0, 1, 2, 3, 4, 5, 6, 2, 3, 4,  5,  6,  7,  4,  5, ...
   7 | 0, 1, 2, 3, 4, 5, 6, 7, 2, 3,  4,  5,  6,  7,  8, ...
   8 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 2,  3,  4,  5,  6,  7, ...
   9 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,  2,  3,  4,  5,  6, ...
  10 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,  2,  3,  4,  5, ...
  11 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,  2,  3,  4, ...
  12 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,  2,  3, ...
  ...| ...
		

Crossrefs

Cf. A001477 (row 1), A051162 (row 2, when read by rows), A070770 (row 3), A070771 (row 4), A070772 (row 5).

A216209 Triangle read by rows: T(n,k) = n+k with 0 <= k <= 2*n.

Original entry on oeis.org

0, 1, 2, 3, 2, 3, 4, 5, 6, 3, 4, 5, 6, 7, 8, 9, 4, 5, 6, 7, 8, 9, 10, 11, 12, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21
Offset: 0

Views

Author

Alex Ratushnyak, Mar 12 2013

Keywords

Comments

The left half together with the central column is the A051162 triangle.
Row sums of the reciprocals of the terms in the above triangle converge to log(3). See link to Eric Naslund's answer. [Mats Granvik, Apr 07 2013]
The first time that the numbers of the triplet 3k+1, 3k+2, 3k+3 appear in the sequence is for a(k^2+4*k+1) = 3*k+1, a(k^2+4*k+2) = 3*k+2, a(k^2+4*k+3) = 3*k+3 for k >= 0. - Bernard Schott, Jun 09 2019

Examples

			Triangle begins:
                     0
                  1  2  3
               2  3  4  5  6
            3  4  5  6  7  8  9
         4  5  6  7  8  9 10 11 12
      5  6  7  8  9 10 11 12 13 14 15
   6  7  8  9 10 11 12 13 14 15 16 17 18
7  8  9 10 11 12 13 14 15 16 17 18 19 20 21
		

Crossrefs

Programs

  • Maple
    seq(seq(n+k, k=0..2*n), n=0..12); # Ridouane Oudra, Jun 08 2019

Formula

a(n) = floor(sqrt(n)) - floor(sqrt(n))^2 + n. - Ridouane Oudra, Jun 08 2019

A236459 Regular triangle: T(n, k) Manhattan distance between n and k in a left-aligned triangle with next M natural numbers in row M.

Original entry on oeis.org

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

Views

Author

Michel Marcus, Jan 26 2014

Keywords

Comments

First column is A051162. Right diagonal is all zeros.

Examples

			Triangle where distances are measured begins:
1
2 3
4 5 6
7 8 9 10
Distance between 1 and 1 is 0, hence T(1, 1) = 0.
Distance between 2 and 1 is 1, and between 2 and 2 is 0. Hence second row of this triangle is 1, 0.
Triangle starts:
0;
1, 0;
2, 1, 0;
2, 1, 2, 0;
3, 2, 1, 1, 0;
		

Crossrefs

Cf. A236345.

Programs

  • PARI
    getxy(n) = {y = sqrtint(2*n); if (n<=y*(y+1)/2, y--); x = n - y*(y+1)/2; [x, y];}
    trg(nn) = {i= 1; for (n = 1, nn, v = getxy(n); for (k = 1, n, nv = getxy(k); print1(abs(nv[1]-v[1])+abs(nv[2]-v[2]), ", ");); print(););}
Previous Showing 21-25 of 25 results.