A047999 Sierpiński's [Sierpinski's] triangle (or gasket): triangle, read by rows, formed by reading Pascal's triangle (A007318) mod 2.
1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1
Offset: 0
Examples
Triangle begins: 1, 1,1, 1,0,1, 1,1,1,1, 1,0,0,0,1, 1,1,0,0,1,1, 1,0,1,0,1,0,1, 1,1,1,1,1,1,1,1, 1,0,0,0,0,0,0,0,1, 1,1,0,0,0,0,0,0,1,1, 1,0,1,0,0,0,0,0,1,0,1, 1,1,1,1,0,0,0,0,1,1,1,1, 1,0,0,0,1,0,0,0,1,0,0,0,1, ...
References
- Boris A. Bondarenko, Generalized Pascal Triangles and Pyramids (in Russian), FAN, Tashkent, 1990, ISBN 5-648-00738-8.
- Brand, Neal; Das, Sajal; Jacob, Tom. The number of nonzero entries in recursively defined tables modulo primes. Proceedings of the Twenty-first Southeastern Conference on Combinatorics, Graph Theory, and Computing (Boca Raton, FL, 1990). Congr. Numer. 78 (1990), 47--59. MR1140469 (92h:05004).
- John W. Milnor and James D. Stasheff, Characteristic Classes, Princeton University Press, 1974, pp. 43-49 (sequence appears on p. 46).
- H.-O. Peitgen, H. Juergens and D. Saupe: Chaos and Fractals (Springer-Verlag 1992), p. 408.
- Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.
- S. Wolfram, A New Kind of Science, Wolfram Media, 2002; Chapter 3.
Links
- N. J. A. Sloane, Table of n, a(n) for n = 0..10584 [First 144 rows, flattened; first 50 rows from T. D. Noe].
- J.-P. Allouche and V. Berthe, Triangle de Pascal, complexité et automates, Bulletin of the Belgian Mathematical Society Simon Stevin 4.1 (1997): 1-24.
- J.-P. Allouche, F. v. Haeseler, H.-O. Peitgen and G. Skordev, Linear cellular automata, finite automata and Pascal's triangle, Discrete Appl. Math. 66 (1996), 1-22.
- David Applegate, Omar E. Pol and N. J. A. Sloane, The Toothpick Sequence and Other Sequences from Cellular Automata, Congressus Numerantium, Vol. 206 (2010), 157-191. [There is a typo in Theorem 6: (13) should read u(n) = 4.3^(wt(n-1)-1) for n >= 2.],
- J. Baer, Explore patterns in Pascal's Triangle
- Valentin Bakoev, Fast Bitwise Implementation of the Algebraic Normal Form Transform, Serdica J. of Computing 11 (2017), No 1, 45-57.
- Valentin Bakoev, Properties and links concerning M_n
- Thomas Baruchel, Flattening Karatsuba's Recursion Tree into a Single Summation, SN Computer Science (2020) Vol. 1, Article No. 48.
- Thomas Baruchel, A non-symmetric divide-and-conquer recursive formula for the convolution of polynomials and power series, arXiv:1912.00452 [math.NT], 2019.
- A. Bogomolny, Dot Patterns and Sierpinski Gasket
- Boris A. Bondarenko, Generalized Pascal Triangles and Pyramids, English translation published by Fibonacci Association, Santa Clara Univ., Santa Clara, CA, 1993; see pp. 130-132.
- Paul Bradley and Peter Rowley, Orbits on k-subsets of 2-transitive Simple Lie-type Groups, 2014.
- E. Burlachenko, Fractal generalized Pascal matrices, arXiv:1612.00970 [math.NT], 2016. See p. 9.
- S. Butkevich, Pascal Triangle Applet
- David Callan, Sierpinski's triangle and the Prouhet-Thue-Morse word, arXiv:math/0610932 [math.CO], 2006.
- B. Cherowitzo, Pascal's Triangle using Clock Arithmetic, Part I
- B. Cherowitzo, Pascal's Triangle using Clock Arithmetic, Part II
- C. Cobeli, A. Zaharescu, A game with divisors and absolute differences of exponents, arXiv:1411.1334 [math.NT], 2014; Journal of Difference Equations and Applications, Vol. 20, #11, 2014.
- Ilya Gutkovskiy, Illustrations (triangle formed by reading Pascal's triangle mod m)
- R. K. Guy, The strong law of small numbers. Amer. Math. Monthly 95 (1988), no. 8, 697-712.
- Brady Haran, Chaos Game, Numberphile video, YouTube (April 27, 2017).
- I. Kobayashi et al., Pascal's Triangle
- Dr. Math, Regular polygon formulas [Broken link?]
- Y. Moshe, The distribution of elements in automatic double sequences, Discr. Math., 297 (2005), 91-103.
- National Curve Bank, Sierpinski Triangles
- Hieu D. Nguyen, A Digital Binomial Theorem, arXiv:1412.3181 [math.NT], 2014.
- S. Northshield, Sums across Pascal's triangle modulo 2, Congressus Numerantium, 200, pp. 35-52, 2010.
- A. M. Reiter, Determining the dimension of fractals generated by Pascal's triangle, Fibonacci Quarterly, 31(2), 1993, pp. 112-120.
- F. Richman, Javascript for computing Pascal's triangle modulo n. Go to this page, then under "Modern Algebra and Other Things", click "Pascal's triangle modulo n".
- Vladimir Shevelev, On Stephan's conjectures concerning Pascal triangle modulo 2 and their polynomial generalization, J. of Algebra Number Theory: Advances and Appl., 7 (2012), no.1, 11-29. Also arXiv:1011.6083, 2010.
- N. J. A. Sloane, Illustration of rows 0 to 32 (encoignure style)
- N. J. A. Sloane, Illustration of rows 0 to 64 (encoignure style)
- N. J. A. Sloane, Illustration of rows 0 to 128 (encoignure style)
- N. J. A. Sloane, Catalog of Toothpick and Cellular Automata Sequences in the OEIS
- Eric Weisstein's World of Mathematics, Sierpiński Sieve, Rule 60, Rule 102
- Index entries for sequences related to cellular automata
- Index entries for triangles and arrays related to Pascal's triangle
- Index entries for sequences generated by sieves
Crossrefs
Sequences based on the triangles formed by reading Pascal's triangle mod m: (this sequence) (m = 2), A083093 (m = 3), A034931 (m = 4), A095140 (m = 5), A095141 (m = 6), A095142 (m = 7), A034930(m = 8), A095143 (m = 9), A008975 (m = 10), A095144 (m = 11), A095145 (m = 12), A275198 (m = 14), A034932 (m = 16).
Cf. A007318, A054431, A001317, A008292, A083093, A034931, A034930, A008975, A034932, A166360, A249133, A064194, A227133.
From Johannes W. Meijer, Jun 05 2011: (Start)
A106344 is a skew version of this triangle.
Programs
-
Haskell
import Data.Bits (xor) a047999 :: Int -> Int -> Int a047999 n k = a047999_tabl !! n !! k a047999_row n = a047999_tabl !! n a047999_tabl = iterate (\row -> zipWith xor ([0] ++ row) (row ++ [0])) [1] -- Reinhard Zumkeller, Dec 11 2011, Oct 24 2010
-
Magma
A047999:= func< n,k | BitwiseAnd(n-k, k) eq 0 select 1 else 0 >; [A047999(n,k): k in [0..n], n in [0..15]]; // G. C. Greubel, Dec 03 2024
-
Maple
# Maple code for first M rows (here M=10) - N. J. A. Sloane, Feb 03 2016 ST:=[1,1,1]; a:=1; b:=2; M:=10; for n from 2 to M do ST:=[op(ST),1]; for i from a to b-1 do ST:=[op(ST), (ST[i+1]+ST[i+2]) mod 2 ]; od: ST:=[op(ST),1]; a:=a+n; b:=a+n; od: ST; # N. J. A. Sloane # alternative A047999 := proc(n,k) modp(binomial(n,k),2) ; end proc: seq(seq(A047999(n,k),k=0..n),n=0..12) ; # R. J. Mathar, May 06 2016
-
Mathematica
Mod[ Flatten[ NestList[ Prepend[ #, 0] + Append[ #, 0] &, {1}, 13]], 2] (* Robert G. Wilson v, May 26 2004 *) rows = 14; ca = CellularAutomaton[60, {{1}, 0}, rows-1]; Flatten[ Table[ca[[k, 1 ;; k]], {k, 1, rows}]] (* Jean-François Alcover, May 24 2012 *) Mod[#,2]&/@Flatten[Table[Binomial[n,k],{n,0,20},{k,0,n}]] (* Harvey P. Dale, Jun 26 2019 *) A047999[n_,k_]:= Boole[BitAnd[n-k,k]==0]; Table[A047999[n,k], {n,0,15}, {k,0,n}]//Flatten (* G. C. Greubel, Sep 03 2025 *)
-
PARI
\\ Recurrence for Pascal's triangle mod p, here p = 2. p = 2; s=13; T=matrix(s,s); T[1,1]=1; for(n=2,s, T[n,1]=1; for(k=2,n, T[n,k] = (T[n-1,k-1] + T[n-1,k])%p )); for(n=1,s,for(k=1,n,print1(T[n,k],", "))) \\ Gerald McGarvey, Oct 10 2009
-
PARI
A011371(n)=my(s);while(n>>=1,s+=n);s T(n,k)=A011371(n)==A011371(k)+A011371(n-k) \\ Charles R Greathouse IV, Aug 09 2013
-
PARI
T(n,k)=bitand(n-k,k)==0 \\ Charles R Greathouse IV, Aug 11 2016
-
Python
def A047999_T(n,k): return int(not ~n & k) # Chai Wah Wu, Feb 09 2016
Formula
Lucas's Theorem is that T(n,k) = 1 if and only if the 1's in the binary expansion of k are a subset of the 1's in the binary expansion of n; or equivalently, k AND NOT n is zero, where AND and NOT are bitwise operators. - Chai Wah Wu, Feb 09 2016 and N. J. A. Sloane, Feb 10 2016
T(n,k) = T(n-1,k-1) XOR T(n-1,k), 0 < k < n; T(n,0) = T(n,n) = 1. - Reinhard Zumkeller, Dec 13 2009
T(n,k) = (T(n-1,k-1) + T(n-1,k)) mod 2 = |T(n-1,k-1) - T(n-1,k)|, 0 < k < n; T(n,0) = T(n,n) = 1. - Rick L. Shepherd, Feb 23 2018
From Vladimir Shevelev, Dec 31 2013: (Start)
For polynomial {s_n(x)} we have
s_0(x)=1; for n>=1, s_n(x) = Product_{i=1..A000120(n)} (x^(2^k_i) + 1),
if the binary expansion of n is n = Sum_{i=1..A000120(n)} 2^k_i;
G.f. Sum_{n>=0} s_n(x)*z^n = Product_{k>=0} (1 + (x^(2^k)+1)*z^(2^k)) (0
Let x>1, t>0 be real numbers. Then
Sum_{n>=0} 1/s_n(x)^t = Product_{k>=0} (1 + 1/(x^(2^k)+1)^t);
Sum_{n>=0} (-1)^A000120(n)/s_n(x)^t = Product_{k>=0} (1 - 1/(x^(2^k)+1)^t).
In particular, for t=1, x>1, we have
Sum_{n>=0} (-1)^A000120(n)/s_n(x) = 1 - 1/x. (End)
From Valentin Bakoev, Jul 11 2020: (Start)
(See my comment about the matrix M_n.) Denote by T(i,j) the number in the i-th row and j-th column of M_n (0 <= i, j < 2^n). When i>=j, T(i,j) is the j-th number in the i-th row of the Sierpinski's triangle. For given i and j, we denote by k the largest integer of the type k=2^m and k
T(i,0) = T(i,i) = 1, or
T(i,j) = 0 if i < j, or
T(i,j) = T(i-k,j), if j < k, or
T(i,j) = T(i-k,j-k), if j >= k.
Thus, for given i and j, T(i,j) can be computed in O(log_2(i)) steps. (End)
Extensions
Additional links from Lekraj Beedassy, Jan 22 2004
A014421 Odd elements in Pascal's triangle.
1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1, 1, 5, 5, 1, 1, 15, 15, 1, 1, 7, 21, 35, 35, 21, 7, 1, 1, 1, 1, 9, 9, 1, 1, 45, 45, 1, 1, 11, 55, 165, 165, 55, 11, 1, 1, 495, 495, 1, 1, 13, 715, 1287, 1287, 715, 13, 1, 1, 91, 1001, 3003, 3003, 1001, 91, 1, 1, 15, 105, 455, 1365, 3003, 5005
Offset: 0
Comments
The number of terms of the n-row is A001316(n). - Michel Marcus, Jan 11 2016
Examples
Triangle starts: 1; 1, 1; 1, 1; 1, 3, 3, 1; 1, 1; 1, 5, 5, 1; 1, 15, 15, 1; 1, 7, 21, 35, 35, 21, 7, 1; ...
Links
- Robert Israel, Table of n, a(n) for n = 0..10070 (rows 0 to 375, flattened)
- Arvind Ayyer, Amritanshu Prasad, Steven Spallone, Odd partitions in Young's lattice, arXiv:1601.01776 [math.CO], 2016. See Fig. 3.
- A. M. Reiter, Determining the dimension of fractals generated by Pascal’s triangle, Fibonacci Quart, 31(2):112-120, 1993.
Crossrefs
Cf. A143333. [From Reinhard Zumkeller, Oct 24 2010]
Programs
-
Maple
select(type, [seq(seq(binomial(n,k),k=0..n),n=0..20)],odd); # Robert Israel, Jan 11 2016
-
Mathematica
Select[ Flatten[ Table[ Binomial[ n, i ], {n, 0, 20}, {i, 0, n} ] ], OddQ ]
-
PARI
tabf(nn) = {for (n=0, nn, for (k=0, n, b = binomial(n, k); if (b % 2, print1(b, ", "))); print(););} \\ Michel Marcus, Jan 11 2016
Extensions
More terms from Erich Friedman
Keyword tabl replaced by tabf by Reinhard Zumkeller, Oct 21 2010
Offset changed to 0 by Michel Marcus, Jan 11 2016
A088560 Sum of odd entries in row n of Pascal's triangle.
1, 2, 2, 8, 2, 12, 32, 128, 2, 20, 92, 464, 992, 4032, 8192, 32768, 2, 36, 308, 2320, 9692, 52712, 164320, 781312, 1470944, 6249152, 13748672, 56768768, 67100672, 268419072, 536870912, 2147483648, 2, 68, 1124, 14352, 117812, 1003960, 5670400
Offset: 0
Comments
a(n) = a power of 2 iff n = 2^k - 2, 2^k - 1 or 2^k.
Sums of rows of the triangle in A143333. - Reinhard Zumkeller, Oct 24 2010
Links
- Robert Israel, Table of n, a(n) for n = 0..3420
Programs
-
Maple
T:= [1]: R:= 1: for i from 1 to 50 do T:= [1,op(T[2..-1]+T[1..-2]),1]; R:= R, convert(select(type,T,odd),`+`) od: R; # Robert Israel, Apr 17 2020
-
Mathematica
f[n_] := Plus @@ Select[ Table[ Binomial[n, i], {i, 0, n}], OddQ[ # ] & ]; Table[ f[n], {n, 0, 38}] (* Robert G. Wilson v, Nov 19 2003 *)
-
PARI
a(n)=sum(i=0,n,binomial(n,i)*(binomial(n,i)%2))
Formula
a(2^n)=2; a(2^n-1)=2^(2^n-1); a(2^n+1)=2^(n+1)+4 ... - Benoit Cloitre, Nov 19 2003
Extensions
Edited and extended by Robert G. Wilson v and Ray Chandler, Nov 19 2003
A355604 Table T(n, k), n >= 0, k = 0..n, read by rows; row n is obtained by replacing in row n of Pascal's triangle (A007318) runs of k consecutive even numbers by the terms of row k+1 of the present triangle.
1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 5, 1, 1, 1, 15, 1, 15, 1, 1, 1, 7, 21, 35, 35, 21, 7, 1, 1, 1, 1, 15, 1, 15, 1, 1, 1, 1, 9, 1, 5, 1, 1, 5, 1, 9, 1, 1, 1, 45, 1, 1, 1, 1, 1, 45, 1, 1, 1, 11, 55, 165, 1, 3, 3, 1, 165, 55, 11, 1, 1, 1, 1, 1, 495, 1, 1, 1, 495, 1, 1, 1, 1
Offset: 0
Comments
This triangle has fractal features: even terms of Pascal's triangle are clustered as wXwXw subtriangles; these subtriangles are replaced by the first w rows (flipped upside-down) of the present triangle.
Examples
Triangle T(n, k) begins (stars indicate replacements): n\k| 0 1 2 3 4 5 6 7 8 9 10 11 12 ---+----------------------------------------------------------------- 0| 1 1| 1 1 2| 1 1* 1 3| 1 3 3 1 4| 1 1* 1* 1* 1 5| 1 5 1* 1* 5 1 6| 1 1* 15 1* 15 1* 1 7| 1 7 21 35 35 21 7 1 8| 1 1* 1* 15* 1* 15* 1* 1* 1 9| 1 9 1* 5* 1* 1* 5* 1* 9 1 10| 1 1* 45 1* 1* 1* 1* 1* 45 1* 1 11| 1 11 55 165 1* 3* 3* 1* 165 55 11 1 12| 1 1* 1* 1* 495 1* 1* 1* 495 1* 1* 1* 1
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..8384 (rows for n = 0..128 flattened)
- Rémy Sigrist, Colored representation of the first 2^10 rows (where the hue is function of T(n, k), black pixels correspond to 1's)
- Index entries for triangles and arrays related to Pascal's triangle
Programs
-
PARI
row(n) = { my (r=binomial(n)); for (i=1, #r, if (r[i]%2==0, for (w=1, oo, if (r[i+w]%2==1, my (t=row(w-1)); for (j=1, #t, r[i-1+j]=t[j]); i+=w; break)))); return (r) }
Comments