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.

A293974 Row sums of antidiagonals of the Sierpinski carpet A153490.

Original entry on oeis.org

1, 2, 2, 4, 5, 4, 6, 6, 4, 8, 10, 8, 13, 14, 10, 14, 13, 8, 14, 16, 12, 18, 18, 12, 16, 14, 8, 16, 20, 16, 26, 28, 20, 28, 26, 16, 29, 34, 26, 40, 41, 28, 38, 34, 20, 34, 38, 28, 41, 40, 26, 34, 29, 16, 30, 36, 28, 44, 46, 32, 44, 40, 24, 42, 48, 36, 54, 54, 36, 48, 42, 24
Offset: 1

Views

Author

M. F. Hasler, Oct 24 2017

Keywords

Comments

Also, sums of digits of terms of A292688, or Hamming weights of terms of A292689. See there or A153490 for definition / construction of the Sierpiski carpet.

Crossrefs

Programs

  • Mathematica
    A293974[i_]:=With[{a=Nest[ArrayFlatten[{{#,#,#},{#,0,#},{#,#,#}}]&,{{1}},i]},Array[Total[Diagonal[a,#]]&,3^i,1-3^i]];A293974[5] (* Generates 3^5 terms *) (* Paolo Xausa, May 14 2023 *)
  • PARI
    A293974(n,A=Mat(1))={while(#A
    				

Formula

a(n) = A007953(A292688(n)) = A000120(A292689(n)) = sum(k=1..n, A153490(n,k)), considering A153490 as triangle; could also be indexed as matrix (m,n = 1,...,oo) or "flattened" (linearized) using A000217.

A088917 Central Delannoy numbers (mod 3); Characteristic function for Cantor set.

Original entry on oeis.org

1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Benoit Cloitre, Nov 30 2003

Keywords

Comments

Also Apery numbers (mod 3).
More generally also (Sum_{k=0..n} binomial(n,k)^x*binomial(n+k,k)^y) (mod 3) for any x >= 1 in N and any odd y >= 1.
a(n) = 0 if the ternary expansion of n contains one or more 1-digits, otherwise 1. - Antti Karttunen, Aug 23 2019
Main diagonal of the Sierpinski carpet (A153490). - Paolo Xausa, May 19 2023

Crossrefs

Characteristic function of A005823, and with offset 1, characteristic function of A191106.

Programs

  • Mathematica
    Nest[ Flatten[# /. {0 -> {0, 0, 0}, 1 -> {1, 0, 1}}] &, {1}, 5] (* Or *)
    f[n_] := Mod[LegendreP[n, 3], 3]; Array[f, 111, 0] (* Or *)
    f[n_] := If[ FreeQ[ IntegerDigits[n, 3], 1], 1, 0]; Array[f, 111, 0] (* also from Mathematica v8.0 Mathematical Functions Help section for "IntegerDigits" "Cantor set construction:" *) (* Robert G. Wilson v, Jun 16 2011 *)
    Nest[Join[#, 0 #, #] &, {1}, 5] (* IWABUCHI Yu(u)ki, Sep 08 2012 *)
  • PARI
    a(n)=sum(k=0,n,binomial(n,k)*binomial(n+k,k))%3
    
  • PARI
    A088917(n) = { while(n, if(n%3==1, return(0), n\=3)); (1); }; \\ Antti Karttunen, Aug 23 2019 (copied from A005823)
    
  • PARI
    A088917(n) = abs(factorback(apply(d -> d-1,digits(n,3)))); \\ Antti Karttunen, Aug 23 2019

Formula

a(A005823(n)) = 1; a(A081606(n)) = 0.
a(n) = A001850(n) - 3*floor(A001850(n)/3).
a(n) = 2 - A105220(n) = 1 - A316829(n). - Antti Karttunen and Jon Maiga, Aug 24 2019
G.f.: Product_{k>=0} (1 + x^(2*3^k)). - Ilya Gutkovskiy, Jun 05 2021

Extensions

Secondary name added by Antti Karttunen, Aug 23 2019

A292688 Antidiagonals of the Sierpinski carpet (as binary numbers).

Original entry on oeis.org

1, 11, 101, 1111, 11111, 101101, 1110111, 11100111, 101000101, 1111001111, 11111011111, 101101101101, 1111111111111, 11111111111111, 101101101101101, 1110111111110111, 11100111111100111, 101000101101000101, 1111001110111001111, 11111011100111011111, 101101101000101101101
Offset: 1

Views

Author

M. F. Hasler, Oct 23 2017

Keywords

Comments

Concatenation of the terms in the rows of A153490.
The Sierpinski carpet A153490 is the fractal obtained by starting with a unit square and at subsequent iterations, subdividing each square into 3 X 3 smaller squares and removing the middle square. After the n-th iteration, the upper-left 3^n X 3^n squares will always remain the same. Therefore this sequence, which reads these by antidiagonals, is well-defined.
The n-th term a(n) has n digits. See A292689 for the decimal value of a(n) considered as binary number.
The Hamming weights (or sum of digits) of the terms (also row sums of A153490) are (1, 2, 2, 4, 5, 4, 6, 6, 4, 8, 10, 8, 13, 14, 10, 14, 13, 8, 14, 16, 12, 18, 18, 12, 16,...)

Examples

			The Sierpinski carpet matrix A153490 reads
   1 1 1 1 1 1 1 1 1...
   1 0 1 1 0 1 1 0 1...
   1 1 1 1 1 1 1 1 1...
   1 1 1 0 0 0 1 1 1...
   1 0 1 0 0 0 1 0 1...
   1 1 1 0 0 0 1 1 1...
   1 1 1 1 1 1 1 1 1...
   1 0 1 1 0 1 1 0 1...
   1 1 1 1 1 1 1 1 1...
   (...)
The concatenation of the terms in the antidiagonals yields 1, 11, 101, 1111, 11111, 101101, 1110111, 11100111, 101000101, 1111001111, 11111011111, 101101101101, 1111111111111, 11111111111111, 101101101101101, 1110111111110111, 11100111111100111, 101000101101000101, 1111001110111001111, ...
		

Crossrefs

Programs

  • Mathematica
    A292688[i_]:=With[{a=Nest[ArrayFlatten[{{#,#,#},{#,0,#},{#,#,#}}]&,{{1}},i]},Array[FromDigits[Diagonal[a,#]]&,3^i,1-3^i]];A292688[3] (* Paolo Xausa, May 13 2023 *)
  • PARI
    A292688(n,A=Mat(1))={while(#A
    				

A292689 Decimal values of the antidiagonals of the Sierpinski carpet considered as binary numbers.

Original entry on oeis.org

1, 3, 5, 15, 31, 45, 119, 231, 325, 975, 2015, 2925, 8191, 16383, 23405, 61431, 118759, 166725, 499151, 1030623, 1495405, 4186623, 8372735, 11960685, 31392247, 60686823, 85197125, 255591375, 528222175, 766774125, 2147229695, 4294721535, 6135503725, 16103829495, 31132078055
Offset: 1

Views

Author

M. F. Hasler, Oct 23 2017

Keywords

Comments

Term a(n) is the decimal value of A292688 = concatenation of the terms in row n of A153490 considered as a binary number.
The Sierpinski carpet is the fractal obtained by starting with a unit square and at subsequent iterations, subdividing each square into 3 X 3 smaller squares and removing the middle square. After the n-th iteration, the upper-left 3^n X 3^n squares will always remain the same. Therefore this sequence, which considers the antidiagonals of this infinite matrix, is well-defined.
The n-th term a(n) has n binary digits.
The Hamming weights of the terms (also row sums of A153490) are (1, 2, 2, 4, 5, 4, 6, 6, 4, 8, 10, 8, 13, 14, 10, 14, 13, 8, 14, 16, 12, 18, 18, 12, 16, ...).

Examples

			The Sierpinski carpet matrix A153490 reads
   1 1 1 1 1 1 1 1 1 ...
   1 0 1 1 0 1 1 0 1 ...
   1 1 1 1 1 1 1 1 1 ...
   1 1 1 0 0 0 1 1 1 ...
   1 0 1 0 0 0 1 0 1 ...
   1 1 1 0 0 0 1 1 1 ...
   1 1 1 1 1 1 1 1 1 ...
   1 0 1 1 0 1 1 0 1 ...
   1 1 1 1 1 1 1 1 1 ...
   ...
The concatenation of the terms in the antidiagonals yields A292688 = (1, 11, 101, 1111, 11111, 101101, 1110111, 11100111, 101000101, 1111001111, 11111011111, 101101101101, 1111111111111, 11111111111111, 101101101101101, ...).
Considered as binary numbers and converted to base 10, this yields 1, 3, 5, 15, 31, 45, 119, 231, 325, ... .
		

Crossrefs

Programs

  • Mathematica
    A292689[i_]:=With[{a=Nest[ArrayFlatten[{{#,#,#},{#,0,#},{#,#,#}}]&,{{1}},i]},Array[FromDigits[Diagonal[a,#],2]&,3^i,1-3^i]];A292689[4] (* Generates 3^4 terms *) (* Paolo Xausa, May 13 2023 *)
  • PARI
    A292689(n,A=Mat(1))={while(#A
    				

Formula

a(k+1) = 2*a(k)+1 for all k in A003462 = (1, 4, 13, 40, 121, 364, ...). (Conjectured.) - R. J. Cano, Oct 25 2017
This is true, moreover, a(k) = 2^k-1 for these k (and k' = k+1), and the neighboring antidiagonals (k-1 and k+2) have bitmaps of the form {101}*(101 repeated). - M. F. Hasler, Oct 25 2017

A292686 Sierpinski-type iteration: start with a(0)=1, at each step, replace 0 with 000 and 1 with 101.

Original entry on oeis.org

1, 101, 101000101, 101000101000000000101000101, 101000101000000000101000101000000000000000000000000000101000101000000000101000101
Offset: 0

Views

Author

M. F. Hasler, Oct 20 2017

Keywords

Comments

See A292687 for the decimal representation of a(n) viewed as a "binary number", i.e., as written in base 2.
The Sierpinski carpet (A153490) can be seen as 2-dimensional version of this 1-dimensional variant. The classical Sierpinski gasket triangle (Pascal's triangle mod 2) and "Rule 18" (or Rule 90, A070886) and "Rule 22" (A071029) have similar graphs.
The n-th term a(n) has 3^n digits, the middle third of which are all zero. The digits of a(n) are again the first and last 3^n digits of a(n+1), separated by 3^n zeros.

Examples

			a(0) = 1 -> 101 = a(1);
a(1) = 101 -> concat(101,000,101) = 101000101 = a(2).
		

Crossrefs

Cf. A292687 for the decimal representation of a(n) viewed as a "binary number", i.e., as written in base 2.
Cf. A153490 (Sierpinski carpet), A047999 (Sierpinski gasket = Pascal's triangle mod 2), A070886 (Rule 18 / Rule 90), A071029 (Rule 22).
Cf. A088917.

Programs

  • Mathematica
    A292686[nmax_]:=FoldList[Times,1,100^(3^Range[0,nmax-1])+1];A292686[5] (* Paolo Xausa, May 13 2023 *)
  • PARI
    a(n,a=1)=for(k=1,n,a=fromdigits(binary(a)*5,8));fromdigits(binary(a),10) \\ Illustration of the first formula.
    
  • PARI
    A292686(n)=prod(k=0,n-1,100^(3^k)+1)

Formula

a(n+1) = convert(5*a(n), from base 8, to base 2).
a(n+1) = (100^(3^n)+1)*a(n).
a(n) = Product_{k=0 .. n-1} (100^(3^k)+1).

A293834 Triangle whose n-th row lists the squares to be removed at the n-th iteration of the construction of the Sierpinski carpet.

Original entry on oeis.org

5, 11, 14, 17, 38, 44, 65, 68, 71, 29, 32, 35, 38, 41, 44, 47, 50, 53, 110, 116, 119, 125, 128, 134, 191, 194, 197, 200, 203, 206, 209, 212, 215, 272, 275, 278, 290, 293, 296, 353, 359, 371, 377, 434, 437, 440, 452, 455, 458, 515, 518, 521, 524, 527, 530, 533, 536, 539, 596
Offset: 1

Views

Author

M. F. Hasler, Oct 16 2017

Keywords

Comments

The Sierpinski carpet is constructed starting from the unit square, and removing in the next iteration the middle piece of the square cut into 3 X 3 smaller squares. The same operation is applied to each square not yet removed, in subsequent iterations.
At the n-th iteration, the initial unit square is subdivided in 3^n X 3^n smaller squares. The present sequence gives the numbers (from 1 to 9^n) of the newly removed subsquares, cf. examples.
The n-th row has A001018(n) = 8^n terms.

Examples

			At the first iteration, the middle square, which is the 5th of the 9 squares, is removed, so the first row reads [5]. This leaves 9 - 1 = 8 squares.
At the next iteration, in each of the 8 remaining squares, each one subdivided into 3 X 3 smaller squares, the middle square is removed. The numbers of these subsquares are 11, 14 and 17 in the second row, 38 and 44 in the middle row, and 65, 68 and 71 in the penultimate row, so row 2 = [11, 14, 17, 38, 44, 65, 68, 71]. (The subsquares are numbered from 1 to 81, i.e., all of the 9 X 9 subsquares, including the "empty" ones, get a number. Otherwise said, the number of a square equals (y-1)*3^n+x, if x,y are the coordinates both ranging from 1 to 3^n.)
This leaves 8*9 - 8 = 8*(9 - 1) = 64 "nonempty" squares. Therefore, the next row has 64 terms. The first 9 of these correspond to the 2nd, 5th, 8th, ... square of the 2nd row, i.e., numbers 29, 32, ..., 53, in steps of 3. The next two terms are the numbers of the 2nd and not the 5th, but the 8th square of the 5th row, thus 4*27 + 2 = 110 and 116.
		

Crossrefs

Programs

  • PARI
    {A293834_row(n,B=[0],u=vector(8,i,1))=for(k=2,n, my(v=vector(8,j,if(j>3,if(j>5,j-6+2*3^k,j*2-8+3^k),j-1))); B=concat(apply(t->t*u+v,B+B\3^k*3^k*2))*3);apply(t->t+3^n+2,Set(B))}

A334888 a(n) = Sum_{k >= 0} f(d_k) * 3^k where Sum_{k >= 0} d_k * 8^k is the base 8 representation of n and f(k) = 0, 1, 2, 2, 2, 1, 0, 0 for k = 0..7, respectively.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, May 14 2020

Keywords

Comments

The lattice points with coordinates (a(n), A334889(n)) for n >= 0 form a Sierpinski carpet.

Examples

			For n = 42:
- 42 = 5*8^1 + 2*8^0,
- so a(42) = f(5)*3^1 + f(2)*3^0 = 1*3^1 + 2*3^0 = 5.
		

Crossrefs

Programs

  • PARI
    a(n) = { my (f=[0, 1, 2, 2, 2, 1, 0, 0], d=Vecrev(digits(n, #f))); sum(k=0, #d-1, f[1+d[1+k]] * 3^k) }

Formula

A153490(1 + a(n), 1 + A334889(n)) = 1.

A334889 a(n) = Sum_{k >= 0} f(d_k) * 3^k where Sum_{k >= 0} d_k * 8^k is the base 8 representation of n and f(k) = 0, 0, 0, 1, 2, 2, 2, 1 for k = 0..7, respectively.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, May 14 2020

Keywords

Comments

The lattice points with coordinates (A334888(n), a(n)) for n >= 0 form a Sierpinski carpet.

Examples

			For n = 42:
- 42 = 5*8^1 + 2*8^0,
- so a(42) = f(5)*3^1 + f(2)*3^0 = 2*3^1 + 0*3^0 = 6.
		

Crossrefs

Programs

  • PARI
    a(n) = { my (f=[0, 0, 0, 1, 2, 2, 2, 1], d=Vecrev(digits(n, #f))); sum(k=0, #d-1, f[1+d[1+k]] * 3^k) }

Formula

A153490(1 + A334888(n), 1 + a(n)) = 1.

A293973 Sierpinski carpet iterations: start with a(0) = 1; read a(n) as a 3^n X 3^n binary matrix, replace 1 with [111;101;111] and 0 with [000;000;000], concatenate the 3^(n+1) rows of the new matrix.

Original entry on oeis.org

1, 111101111, 111111111101101101111111111111000111101000101111000111111111111101101101111111111
Offset: 0

Views

Author

M. F. Hasler, Oct 20 2017

Keywords

Comments

The term a(n) has 9^n = A001019(n) digits.
See A153490 for the Sierpinski carpet seen as an infinite matrix read by antidiagonals, and A292688 for a variant where the digits on the antidiagonals are concatenated.
See A292686 for a 1-dimensional variant.

Examples

			Consider a(0) = 1 as a 1 X 1 matrix, replace the 1 by the 3 X 3 matrix E = [1,1,1; 1,0,1; 1,1,1], then this matrix is the result. Concatenating all elements yields a(1) = concat(111,101,111) = 111101111.
Now reconsider a(1) as the previously given 3 X 3 matrix E. Replace every 1 by that same matrix E. This yields the 9 X 9 matrix
   [ 1 1 1  1 1 1  1 1 1 ]
   [ 1 0 1  1 0 1  1 0 1 ]
   [ 1 1 1  1 1 1  1 1 1 ]
   [ 1 1 1  0 0 0  1 1 1 ]
   [ 1 0 1  0 0 0  1 0 1 ]
   [ 1 1 1  0 0 0  1 1 1 ]
   [ 1 1 1  1 1 1  1 1 1 ]
   [ 1 0 1  1 0 1  1 0 1 ]
   [ 1 1 1  1 1 1  1 1 1 ].
Concatenating all elements yields a(2) = 111111111101101101111111111111000111101000101111000111111111111101101101111111111.
		

Crossrefs

Cf. A153490, A293834, A001019, A292688 (antidiagonals 1..3^n of the term a(n) seen as 3^n X 3^n matrix), A292686 (1-dim. variant).

Programs

  • Mathematica
    A293973[n_]:=FromDigits[Flatten[Nest[ArrayFlatten[{{#,#,#},{#,0,#},{#,#,#}}]&,{{1}},n]]];Array[A293973,4,0] (* Paolo Xausa, May 12 2023 *)
  • PARI
    a(n,A=Mat(1),E=2^9-1-2^4)={for(k=1,n, A=matrix(3^k,3^k, i,j, A[(i+2)\3,(j+2)\3]&&bittest(E,(i-1)%3*3+(j-1)%3)));fromdigits(apply(t->fromdigits(t~,10),Vec(A)),10^3^n)}
Showing 1-9 of 9 results.