%I #72 Sep 08 2022 08:45:10
%S 1,1,1,1,2,1,1,0,0,1,1,1,0,1,1,1,2,1,1,2,1,1,0,0,2,0,0,1,1,1,0,2,2,0,
%T 1,1,1,2,1,2,1,2,1,2,1,1,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,1,1,1,2,
%U 1,0,0,0,0,0,0,1,2,1,1,0,0,1,0,0,0,0,0,1,0,0,1,1,1,0,1,1,0,0,0,0,1,1,0,1,1
%N Triangle, read by rows, formed by reading Pascal's triangle (A007318) mod 3.
%C Start with [1], repeatedly apply the map 0 -> [000/000/000], 1 -> [111/120/100], 2 -> [222/210/200]. - _Philippe Deléham_, Apr 16 2009
%C {T(n,k)} is a fractal gasket with fractal (Hausdorff) dimension log(A000217(3))/log(3) = log(6)/log(3) = 1.63092... (see Reiter reference). Replacing values greater than 1 with 1 produces a binary gasket with the same dimension (see Bondarenko reference). - _Richard L. Ollerton_, Dec 14 2021
%D B. A. Bondarenko, Generalized Pascal Triangles and Pyramids, Santa Clara, Calif.: The Fibonacci Association, 1993, pp. 130-132.
%D Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.
%H Reinhard Zumkeller, <a href="/A083093/b083093.txt">Rows n = 0..120 of triangle, flattened</a>
%H J.-P. Allouche, F. von Haeseler, H.-O. Peitgen, and G. Skordev, <a href="https://doi.org/10.1016/0166-218X(94)00132-W">Linear cellular automata, finite automata and Pascal's triangle</a>, Disc. Appl. Math. 66 (1996) 1-22.
%H Ilya Gutkovskiy, <a href="/A275198/a275198.pdf">Illustrations (triangle formed by reading Pascal's triangle mod m)</a>
%H Lin Jiu and Christophe Vignat, <a href="http://arxiv.org/abs/1602.04149">On Binomial Identities in Arbitrary Bases</a>, arXiv:1602.04149 [math.CO], 2016.
%H Y. Moshe, <a href="http://dx.doi.org/10.1016/S0022-314X(03)00103-3">The density of 0's in recurrence double sequences</a>, J. Number Theory, 103 (2003), 109-121.
%H Y. Moshe, <a href="http://dx.doi.org/10.1016/j.disc.2005.03.022">The distribution of elements in automatic double sequences</a>, Discr. Math., 297 (2005), 91-103.
%H A. M. Reiter, <a href="https://www.fq.math.ca/Issues/31-2.pdf">Determining the dimension of fractals generated by Pascal's triangle</a>, Fibonacci Quarterly, 31(2), 1993, pp. 112-120.
%H <a href="/index/Pas#Pascal">Index entries for triangles and arrays related to Pascal's triangle</a>
%F T(i, j) = binomial(i, j) mod 3.
%F T(n+1,k) = (T(n,k) + T(n,k-1)) mod 3. - _Reinhard Zumkeller_, Jul 11 2013
%F T(n,k) = Product_{i>=0} binomial(n_i,k_i) mod 3, where n = Sum_{i>=0} n_i*3^i and k = Sum_{i>=0} k_i*3^i, 0<=n_i, k_i <=2 [Allouche et al.]. - _R. J. Mathar_, Jul 26 2017
%e . Rows 0 .. 3^3:
%e . 0: 1
%e . 1: 1 1
%e . 2: 1 2 1
%e . 3: 1 0 0 1
%e . 4: 1 1 0 1 1
%e . 5: 1 2 1 1 2 1
%e . 6: 1 0 0 2 0 0 1
%e . 7: 1 1 0 2 2 0 1 1
%e . 8: 1 2 1 2 1 2 1 2 1
%e . 9: 1 0 0 0 0 0 0 0 0 1
%e . 10: 1 1 0 0 0 0 0 0 0 1 1
%e . 11: 1 2 1 0 0 0 0 0 0 1 2 1
%e . 12: 1 0 0 1 0 0 0 0 0 1 0 0 1
%e . 13: 1 1 0 1 1 0 0 0 0 1 1 0 1 1
%e . 14: 1 2 1 1 2 1 0 0 0 1 2 1 1 2 1
%e . 15: 1 0 0 2 0 0 1 0 0 1 0 0 2 0 0 1
%e . 16: 1 1 0 2 2 0 1 1 0 1 1 0 2 2 0 1 1
%e . 17: 1 2 1 2 1 2 1 2 1 1 2 1 2 1 2 1 2 1
%e . 18: 1 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 1
%e . 19: 1 1 0 0 0 0 0 0 0 2 2 0 0 0 0 0 0 0 1 1
%e . 20: 1 2 1 0 0 0 0 0 0 2 1 2 0 0 0 0 0 0 1 2 1
%e . 21: 1 0 0 1 0 0 0 0 0 2 0 0 2 0 0 0 0 0 1 0 0 1
%e . 22: 1 1 0 1 1 0 0 0 0 2 2 0 2 2 0 0 0 0 1 1 0 1 1
%e . 23: 1 2 1 1 2 1 0 0 0 2 1 2 2 1 2 0 0 0 1 2 1 1 2 1
%e . 24: 1 0 0 2 0 0 1 0 0 2 0 0 1 0 0 2 0 0 1 0 0 2 0 0 1
%e . 25: 1 1 0 2 2 0 1 1 0 2 2 0 1 1 0 2 2 0 1 1 0 2 2 0 1 1
%e . 26: 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1
%e . 27: 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 1 .
%e - _Reinhard Zumkeller_, Jul 11 2013
%p A083093 := proc(n,k)
%p modp(binomial(n,k),3) ;
%p end proc:
%p seq(seq(A083093(n,k),k=0..n),n=0..10) ; # _R. J. Mathar_, Jul 26 2017
%t Mod[ Flatten[ Table[ Binomial[n, k], {n, 0, 13}, {k, 0, n}]], 3] (* _Robert G. Wilson v_, Jan 19 2004 *)
%o (Haskell)
%o a083093 n k = a083093_tabl !! n !! k
%o a083093_row n = a083093_tabl !! n
%o a083093_tabl = iterate
%o (\ws -> zipWith (\u v -> mod (u + v) 3) ([0] ++ ws) (ws ++ [0])) [1]
%o -- _Reinhard Zumkeller_, Jul 11 2013
%o (Magma) /* As triangle: */ [[Binomial(n,k) mod 3: k in [0..n]]: n in [0.. 15]]; // _Vincenzo Librandi_, Feb 15 2016
%o (Python)
%o from sympy import binomial
%o def T(n, k):
%o return binomial(n, k) % 3
%o for n in range(21): print([T(n, k) for k in range(n + 1)]) # _Indranil Ghosh_, Jul 26 2017
%Y Cf. A007318, A051638 (row sums), A090044, A047999, A034931, A034930, A008975, A034932, A062296, A006047.
%Y Cf. A006996 (central terms), A173019, A206424, A227428.
%Y Sequences based on the triangles formed by reading Pascal's triangle mod m: A047999 (m = 2), (this sequence) (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).
%K easy,nonn,tabl
%O 0,5
%A _Benoit Cloitre_, Apr 22 2003