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 81-86 of 86 results.

A238207 Square array T(n,k), n>=0, k>=0, read by antidiagonals, where T(0,k) is A032766(k) and T(n,k) = 3*T(n-1,k) + 2 for n>0.

Original entry on oeis.org

0, 1, 2, 3, 5, 8, 4, 11, 17, 26, 6, 14, 35, 53, 80, 7, 20, 44, 107, 161, 242, 9, 23, 62, 134, 323, 485, 728, 10, 29, 71, 188, 404, 971, 1457, 2186, 12, 32, 89, 215, 566, 1214, 2915, 4373, 6560, 13, 28, 98, 269, 647, 1700, 3644, 8747, 13121, 19682, 15, 41, 116
Offset: 0

Views

Author

Philippe Deléham, Feb 20 2014

Keywords

Comments

Permutation of nonnegative integers.

Examples

			Square array begins:
0, 1, 3, 4, 6, 7, 9, 10, ...
2, 5, 11, 14, 20, 23, 29, 32, ...
8, 17, 35, 44, 62, 71, 89, 98, ...
26, 53, 107, 134, 188, 215, 269, 296, ...
80, 161, 323, 404, 566, 647, 809, 890, ...
242, 485, 971, 1214, 1700, 1943, 2429, 2672, ...
728, 1457, 2915, 3644, 5102, 5831, 7289, 8018, ...
2186, 4373, 8747, 10934, 15308, 17495, 21869, 24056, ...
...
		

Crossrefs

Formula

T(n,k) = T(0,k)*3^n + T(n,0) where T(0,k) = A032766(k) and T(n,0) = 3^n - 1 = A024023(n).

A265014 Triangle read by rows: T(n,k) = number of neighbors in n-dimensional lattice for generalized neighborhood given with parameter k.

Original entry on oeis.org

2, 4, 8, 6, 18, 26, 8, 32, 64, 80, 10, 50, 130, 210, 242, 12, 72, 232, 472, 664, 728, 14, 98, 378, 938, 1610, 2058, 2186, 16, 128, 576, 1696, 3488, 5280, 6304, 6560, 18, 162, 834, 2850, 6882, 12258, 16866, 19170, 19682, 20, 200, 1160, 4520, 12584, 26024, 41384, 52904, 58024, 59048
Offset: 1

Views

Author

Dmitry Zaitsev, Nov 30 2015

Keywords

Comments

In an n-dimensional hypercube lattice, the sequence gives the number of nodes situated at a Chebyshev distance of 1 combined with Manhattan distance not greater than k, 1<=k<=n. In terms of cellular automata, it gives the number of neighbors in a generalized neighborhood given with parameter k: at k=1, we obtain von Neumann's neighborhood with 2n neighbors (A005843), and at k=n, we obtain Moore's neighborhood with 3^n-1 neighbors (A024023). It represents partial sums of A013609 rows, first element of each row (equal to 1) excluded.

Examples

			Triangle:
n\k   1    2    3    4    5    6    7    8
--------------------------------------------
1     2
2     4    8
3     6   18   26
4     8   32   64   80
5    10   50  130  210  242
6    12   72  232  472  664  728
7    14   98  378  938 1610 2058 2186
8    16  128  576 1696 3488 5280 6304 6560
...
For instance, for n=3, in a cube:
k=1 corresponds to von Neumann's neighborhood with 6 neighbors situated on facets and given with offsets {(-1,0,0),(1,0,0),(0,-1,0),(0,1,0),(0,0,-1),(0,0,1)};
k=2 corresponds to 18 neighbors situated on facets and sides and given with offsets {(-1,0,0),(1,0,0),(0,-1,0),(0,1,0),(0,0,-1),(0,0,1),(-1,-1,0),(-1,0,-1),(0,-1,-1),(-1,0,1),(-1,1,0),(0,-1,1),(0,1,-1),(1,0,-1),(1,-1,0),(1,1,0),(1,0,1),(0,1,1)};
k=3 corresponds to Moore's neighborhood with 26 neighbors situated on facets, sides and corners given with offsets {(-1,0,0),(1,0,0),(0,-1,0),(0,1,0),(0,0,-1),(0,0,1),(-1,-1,0),(-1,0,-1),(0,-1,-1),(-1,0,1),(-1,1,0),(0,-1,1),(0,1,-1),(1,0,-1),(1,-1,0),(1,1,0),(1,0,1),(0,1,1),(-1,-1,-1),(1,-1,-1),(-1,1,-1),(1,1,-1),(-1,-1,1),(1,-1,1),(-1,1,1),(1,1,1)}.
		

Crossrefs

First column equals to A005843.
Diagonal equals to A024023.
Partial row sums of A013609, first element of each row excluded.

Programs

  • Mathematica
    T[n_, k_] := 3^n - 2^(k+1) Binomial[n, k+1] Hypergeometric2F1[1, k-n+1, k+2, -2] - 1;
    Table[T[n, k], {n, 1, 10}, {k, 1, n}] // Flatten (* Jean-François Alcover, Sep 26 2018 *)
  • PARI
    tabl(nn) = {for (n=1, nn, for (k=1, n, print1(sum(r=1, k, 2^r*binomial(n,r)), ", ");); print(););} \\ Michel Marcus, Dec 16 2015

Formula

T(n,k) = Sum_{r=1..k} 2^r*binomial(n,r).
Recurrence: T(n,k) = T(n-1,k-1)-2T(n-1,k-2)+T(n-1,k)+T(n,k-1), T(n,1) = 2n, T(n,n) = 3^n-1.

Extensions

More terms from Michel Marcus, Dec 16 2015

A267488 Smallest b > 1 such that there exists an odd prime p with p < b such that b^(p-1) == 1 (mod p^n).

Original entry on oeis.org

4, 7, 18, 80, 242, 728, 2186, 6560, 19682, 59048, 177146, 531440, 1594322
Offset: 1

Views

Author

Felix Fröhlich, Jan 15 2016

Keywords

Comments

Conjecture: For n > 3, a(n) = A024023(n).

Crossrefs

Cf. A024023.

Programs

  • PARI
    a(n) = my(b=2); while(1, forprime(p=3, b-1, if(Mod(b, p^n)^(p-1)==1, return(b))); b++)

Formula

a(n) ~ 3^n (via the A024023 conjecture). - Bill McEachen, Jul 31 2025

Extensions

a(11) from Michael S. Branicky, May 19 2022
a(12) from Michael S. Branicky, May 21 2022
a(13) from Bill McEachen, Jul 31 2025

A276985 Triangle read by rows: T(n,k) = number of k-dimensional elements in an n-dimensional cross-polytope, n>=1, 0<=k

Original entry on oeis.org

2, 4, 4, 6, 12, 8, 8, 24, 32, 16, 10, 40, 80, 80, 32, 12, 60, 160, 240, 192, 64, 14, 84, 280, 560, 672, 448, 128, 16, 112, 448, 1120, 1792, 1792, 1024, 256, 18, 144, 672, 2016, 4032, 5376, 4608, 2304, 512, 20, 180, 960, 3360, 8064, 13440, 15360, 11520, 5120
Offset: 1

Views

Author

Felix Fröhlich, Sep 24 2016

Keywords

Comments

It appears that this is 2*A193862 (but with a different offset) and that the sum of terms of the n-th row is A024023(n) = 3^n - 1. - Michel Marcus, Sep 29 2016

Examples

			T(4, 1..4) = 8, 24, 32, 16, because the 16-cell has 8 0-faces (vertices), 24 1-faces (edges), 32 2-faces (faces) and 16 3-faces (cells).
Triangle starts
2
4, 4
6, 12, 8
8, 24, 32, 16
10, 40, 80, 80, 32
12, 60, 160, 240, 192, 64
14, 84, 280, 560, 672, 448, 128
16, 112, 448, 1120, 1792, 1792, 1024, 256
18, 144, 672, 2016, 4032, 5376, 4608, 2304, 512
20, 180, 960, 3360, 8064, 13440, 15360, 11520, 5120, 1024
		

References

  • H. S. M. Coxeter, Regular Polytopes, Third Edition, Dover Publications, 1973, ISBN 9780486141589.

Crossrefs

Cf. A038207 (hypercube), A135278 (simplex).
Rows: A005843(n), A046092(n), A130809(n+2), A130810(n+3).
Columns: A000079(n), A001787(n), A001788(n), A001789(n+3).

Programs

  • Mathematica
    Table[2^(k + 1) Binomial[n, k + 1], {n, 10}, {k, 0, n - 1}] // Flatten (* Michael De Vlieger, Sep 25 2016 *)
  • PARI
    T(n, k) = 2^(k+1)*binomial(n, k+1)
    trianglerows(n) = for(x=1, n, for(y=0, x-1, print1(T(x, y), ", ")); print(""))
    trianglerows(10) \\ print initial 10 rows of triangle

Formula

T(n,k) = 2^(k+1) * binomial(n, k+1) (cf. Coxeter, 1973, formula 7.22).
T(n,k) = A182059(n,k) = A013609(n,k) . - R. J. Mathar, May 03 2017
G.f.: 2*x/((1 - x)*(1 - x - 2*x*y)). - Stefano Spezia, Jul 17 2025

A302507 a(n) = 4*(3^n-1).

Original entry on oeis.org

0, 8, 32, 104, 320, 968, 2912, 8744, 26240, 78728, 236192, 708584, 2125760, 6377288, 19131872, 57395624, 172186880, 516560648, 1549681952, 4649045864, 13947137600, 41841412808, 125524238432, 376572715304, 1129718145920, 3389154437768, 10167463313312
Offset: 0

Views

Author

Eric W. Weisstein, Apr 09 2018

Keywords

Comments

Triameter of the n-Sierpinski carpet graph.
Binomial transform is 0,8,48,224,960,... A211012 shifted. - R. J. Mathar, Apr 07 2022

Crossrefs

Cf. A024023.

Programs

  • Magma
    [4*(3^n -1): n in [0..30]]; // G. C. Greubel, Apr 09 2018
  • Mathematica
    Table[4 (3^n - 1), {n, 0, 20}]
    4 (3^Range[0, 20] - 1)
    LinearRecurrence[{4, -3}, {8, 32}, {0, 20}]
    CoefficientList[Series[8 x/((1 - x) (1 - 3 x)), {x, 0, 20}], x]
  • PARI
    for(n=0,30, print1(4*(3^n-1), ", ")) \\ G. C. Greubel, Apr 09 2018
    

Formula

a(n) = 4*A024023(n).
a(n) = 4*a(n-1) - 3*a(n-2).
G.f.: 8*x/((1 - x)*(1 - 3*x)).
a(n) = 8*A003462(n). - R. J. Mathar, Apr 07 2022

A332025 Sum of the lengths of the longest runs of 0, 1, and 2 in the ternary expression of n.

Original entry on oeis.org

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

Views

Author

Joshua Oliver, Feb 05 2020

Keywords

Comments

All positive integers appear in this sequence. Given some number k, there will always be some ternary number that has k 1's or k 2's.
The number 0 never appears in this sequence, as every number has at least 1 digit.

Examples

			For n = 268, the ternary expansion of 268 is 100221. The length of the run of 0's in the ternary expansion of 268 is 2. The length of the runs of 1's in the ternary expansion of 268 are 1 and 1 respectively. The length of the run of 2's in the ternary expansion of 268 is 2. The sum of 2, 1, and 2 is 5, so a(268) = 5.
   n [ternary n] A330166(n) + A330167(n) + A330168(n) = a(n)
   0 [        0] 1          + 0          + 0          = 1
   1 [        1] 0          + 1          + 0          = 1
   2 [        2] 0          + 0          + 1          = 1
   3 [      1 0] 1          + 1          + 0          = 2
   4 [      1 1] 0          + 2          + 0          = 2
   5 [      1 2] 0          + 1          + 1          = 2
   6 [      2 0] 1          + 0          + 1          = 2
   7 [      2 1] 0          + 1          + 1          = 2
   8 [      2 2] 0          + 0          + 2          = 2
   9 [    1 0 0] 2          + 1          + 0          = 3
  10 [    1 0 1] 1          + 1          + 0          = 2
  11 [    1 0 2] 1          + 1          + 1          = 3
  12 [    1 1 0] 1          + 2          + 0          = 3
  13 [    1 1 1] 0          + 3          + 0          = 3
  14 [    1 1 2] 0          + 2          + 1          = 3
  15 [    1 2 0] 1          + 1          + 1          = 3
  16 [    1 2 1] 0          + 1          + 1          = 2
  17 [    1 2 2] 0          + 1          + 2          = 3
  18 [    2 0 0] 2          + 0          + 1          = 3
  19 [    2 0 1] 1          + 1          + 1          = 3
  20 [    2 0 2] 1          + 0          + 1          = 2
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[Max@FoldList[If[#2==k,#1+1,0]&,0,IntegerDigits[n,3]],{k,0,2}],{n,1,90}]

Formula

a(n) = A330166(n) + A330167(n) + A330168(n).
a(A003462(n)) = a(A024023(n)) = n.
Previous Showing 81-86 of 86 results.