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-10 of 20 results. Next

A208279 Central terms of Pascal's triangle mod 10 (A008975).

Original entry on oeis.org

1, 2, 6, 0, 0, 2, 4, 2, 0, 0, 6, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 2, 0, 0, 4, 8, 4, 0, 0, 2, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 2, 6, 0, 0, 2, 4, 2, 0, 0, 6, 2, 6, 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

Reinhard Zumkeller, Feb 25 2012

Keywords

Comments

From Chai Wah Wu, Dec 08 2023: (Start)
Last digit of central binomial coefficient binomial(2n,n) in base 10.
A000984 mod 10.
A073095 are numbers n such that a(n) = A008904(n).
a(n) is even for n>0. (End)
From Robert Israel, Dec 08 2023: (Start)
If at least one base-5 digit of n is 3 or 4, then a(n) = 0.
Otherwise, if k 1's occur in the base-5 expansion of n, then a(n) = 2^k (mod 10) if k > 0, or 6 if k = 0. (End)

Crossrefs

Programs

  • Haskell
    a208279 n = a008975 (2*n) n
    
  • Maple
    f:= proc(n) local A,v;
       A:= convert(n,base,5);
       if select(`>=`,A,3) <> [] then return 0 fi;
       v:= numboccur(1,A);
       if v > 0 then 2^v mod 10
       else 6
       fi
    end proc:
    f(0):= 1:
    map(f, [$0..200]); # Robert Israel, Dec 08 2023
  • Mathematica
    Array[Mod[Binomial[2#,#],10]&,100,0] (* Paolo Xausa, Dec 09 2023 *)
  • Python
    from sympy.ntheory.factor_ import digits
    def A208279(n):
        if n == 0: return 1
        s = digits(n,5)[1:]
        return 0 if any(x>2 for x in s) else ((6,2,4,8)[a&3] if (a:=s.count(1)) else 6) # Chai Wah Wu, Dec 08 2023

Formula

a(n) = A008975(2*n,n) = binomial(2n,n) mod 10.

A208280 Number of distinct values in n-th row of Pascal's triangle mod 10 (A008975).

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Feb 25 2012

Keywords

Examples

			Smallest numbers m such that a(m) = n, m = 1,..,9:
   m  |  distinct terms in A008975(m,*)  | a(m)
 -----+----------------------------------+-------
   0  |  [1]                             |    1
   2  |  [1, 2]                          |    2
   4  |  [1, 4, 6]                       |    3
   6  |  [0, 1, 5, 6]                    |    4
  17  |  [0, 1, 6, 7, 8]                 |    5
  12  |  [0, 1, 2, 4, 5, 6]              |    6
  22  |  [0, 1, 2, 3, 4, 5, 6]           |    7
  43  |  [0, 1, 3, 4, 5, 6, 8, 9]        |    8
  23  |  [0, 1, 3, 4, 5, 6, 7, 8, 9]     |    9
  47  |  [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]  |   10
		

Programs

  • Haskell
    import Data.List (nub)
    a208280 = length . nub . a008975_row

A208134 Number of zeros in n-th row of Pascal's triangle mod 10 (A008975).

Original entry on oeis.org

0, 0, 0, 0, 0, 2, 1, 0, 1, 0, 6, 2, 2, 0, 0, 0, 9, 6, 3, 0, 14, 10, 6, 2, 0, 18, 17, 12, 15, 10, 13, 0, 21, 18, 15, 24, 23, 18, 13, 10, 31, 22, 17, 10, 5, 24, 17, 6, 9, 0, 42, 34, 38, 30, 30, 22, 39, 30, 27, 16, 38, 20, 18, 0, 20, 52, 41, 30, 19, 10, 50, 34
Offset: 0

Views

Author

Reinhard Zumkeller, Feb 25 2012

Keywords

Programs

  • Haskell
    a208134 = length . filter (== 0) . a008975_row

Formula

a(n) = sum (0 ^ A008975(n,k): k = 0..n).

A208278 Row sums of Pascal's triangle mod 10 (A008975).

Original entry on oeis.org

1, 2, 4, 8, 16, 12, 24, 28, 46, 52, 14, 28, 36, 72, 34, 68, 46, 72, 84, 108, 26, 52, 54, 108, 106, 32, 44, 68, 76, 92, 84, 128, 46, 92, 84, 48, 56, 92, 124, 148, 56, 112, 124, 168, 196, 112, 144, 208, 216, 252, 34, 68, 56, 112, 94, 148, 76, 132, 144, 228, 96
Offset: 0

Views

Author

Reinhard Zumkeller, Feb 25 2012

Keywords

Programs

  • Haskell
    a208278 = sum . a008975_row

Formula

a(n) = sum (A008975(n,k): k = 0..n).

A047999 Sierpiński's [Sierpinski's] triangle (or gasket): triangle, read by rows, formed by reading Pascal's triangle (A007318) mod 2.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Restored the alternative spelling of Sierpinski to facilitate searching for this triangle using regular-expression matching commands in ASCII. - N. J. A. Sloane, Jan 18 2016
Also triangle giving successive states of cellular automaton generated by "Rule 60" and "Rule 102". - Hans Havermann, May 26 2002
Also triangle formed by reading triangle of Eulerian numbers (A008292) mod 2. - Philippe Deléham, Oct 02 2003
Self-inverse when regarded as an infinite lower triangular matrix over GF(2).
Start with [1], repeatedly apply the map 0 -> [00/00], 1 -> [10/11] [Allouche and Berthe]
Also triangle formed by reading triangles A011117, A028338, A039757, A059438, A085881, A086646, A086872, A087903, A104219 mod 2. - Philippe Deléham, Jun 18 2005
J. H. Conway writes (in Math Forum): at least the first 31 rows give odd-sided constructible polygons (sides 1, 3, 5, 15, 17, ... see A001317). The 1's form a Sierpiński sieve. - M. Dauchez (mdzzdm(AT)yahoo.fr), Sep 19 2005
When regarded as an infinite lower triangular matrix, its inverse is a (-1,0,1)-matrix with zeros undisturbed and the nonzero entries in every column form the Prouhet-Thue-Morse sequence (1,-1,-1,1,-1,1,1,-1,...) A010060 (up to relabeling). - David Callan, Oct 27 2006
Triangle read by rows: antidiagonals of an array formed by successive iterates of running sums mod 2, beginning with (1, 1, 1, ...). - Gary W. Adamson, Jul 10 2008
T(n,k) = A057427(A143333(n,k)). - Reinhard Zumkeller, Oct 24 2010
The triangle sums, see A180662 for their definitions, link Sierpiński’s triangle A047999 with seven sequences, see the crossrefs. The Kn1y(n) and Kn2y(n), y >= 1, triangle sums lead to the Sierpiński-Stern triangle A191372. - Johannes W. Meijer, Jun 05 2011
Used to compute the total Steifel-Whitney cohomology class of the Real Projective space. This was an essential component of the proof that there are no product operations without zero divisors on R^n for n not equal to 1, 2, 4 or 8 (real numbers, complex numbers, quaternions, Cayley numbers), proved by Bott and Milnor. - Marcus Jaiclin, Feb 07 2012
T(n,k) = A134636(n,k) mod 2. - Reinhard Zumkeller, Nov 23 2012
T(n,k) = 1 - A219463(n,k), 0 <= k <= n. - Reinhard Zumkeller, Nov 30 2012
From Vladimir Shevelev, Dec 31 2013: (Start)
Also table of coefficients of polynomials s_n(x) of degree n which are defined by formula s_n(x) = Sum_{i=0..n} (binomial(n,i) mod 2)*x^k. These polynomials we naturally call Sierpiński's polynomials. They also are defined by the recursion: s_0(x)=1, s_(2*n+1)(x) = (x+1)*s_n(x^2), n>=0, and s_(2*n)(x) = s_n(x^2), n>=1.
Note that: s_n(1) = A001316(n),
s_n(2) = A001317(n),
s_n(3) = A100307(n),
s_n(4) = A001317(2*n),
s_n(5) = A100308(n),
s_n(6) = A100309(n),
s_n(7) = A100310(n),
s_n(8) = A100311(n),
s_n(9) = A100307(2*n),
s_n(10) = A006943(n),
s_n(16) = A001317(4*n),
s_n(25) = A100308(2*n), etc.
The equality s_n(10) = A006943(n) means that sequence A047999 is obtained from A006943 by the separation by commas of the digits of its terms. (End)
Comment from N. J. A. Sloane, Jan 18 2016: (Start)
Take a diamond-shaped region with edge length n from the top of the triangle, and rotate it by 45 degrees to get a square S_n. Here is S_6:
[1, 1, 1, 1, 1, 1]
[1, 0, 1, 0, 1, 0]
[1, 1, 0, 0, 1, 1]
[1, 0, 0, 0, 1, 0]
[1, 1, 1, 1, 0, 0]
[1, 0, 1, 0, 0, 0].
Then (i) S_n contains no square (parallel to the axes) with all four corners equal to 1 (cf. A227133); (ii) S_n can be constructed by using the greedy algorithm with the constraint that there is no square with that property; and (iii) S_n contains A064194(n) 1's. Thus A064194(n) is a lower bound on A227133(n). (End)
See A123098 for a multiplicative encoding of the rows, i.e., product of the primes selected by nonzero terms; e.g., 1 0 1 => 2^1 * 3^0 * 5^1. - M. F. Hasler, Sep 18 2016
From Valentin Bakoev, Jul 11 2020: (Start)
The Sierpinski's triangle with 2^n rows is a part of a lower triangular matrix M_n of dimension 2^n X 2^n. M_n is a block matrix defined recursively: M_1= [1, 0], [1, 1], and for n>1, M_n = [M_(n-1), O_(n-1)], [M_(n-1), M_(n-1)], where M_(n-1) is a block matrix of the same type, but of dimension 2^(n-1) X 2^(n-1), and O_(n-1) is the zero matrix of dimension 2^(n-1) X 2^(n-1). Here is how M_1, M_2 and M_3 look like:
1 0 1 0 0 0 1 0 0 0 0 0 0 0
1 1 1 1 0 0 1 1 0 0 0 0 0 0 - It is seen the self-similarity of the
1 0 1 0 1 0 1 0 0 0 0 0 matrices M_1, M_2, ..., M_n, ...,
1 1 1 1 1 1 1 1 0 0 0 0 analogously to the Sierpinski's fractal.
1 0 0 0 1 0 0 0
1 1 0 0 1 1 0 0
1 0 1 0 1 0 1 0
1 1 1 1 1 1 1 1
M_n can also be defined as M_n = M_1 X M_(n-1) where X denotes the Kronecker product. M_n is an important matrix in coding theory, cryptography, Boolean algebra, monotone Boolean functions, etc. It is a transformation matrix used in computing the algebraic normal form of Boolean functions. Some properties and links concerning M_n can be seen in LINKS. (End)
Sierpinski's gasket has fractal (Hausdorff) dimension log(A000217(2))/log(2) = log(3)/log(2) = 1.58496... (and cf. A020857). This gasket is the first of a family of gaskets formed by taking the Pascal triangle (A007318) mod j, j >= 2 (see CROSSREFS). For prime j, the dimension of the gasket is log(A000217(j))/log(j) = log(j(j + 1)/2)/log(j) (see Reiter and Bondarenko references). - Richard L. Ollerton, Dec 14 2021

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.

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).
Other versions: A090971, A038183.
From Johannes W. Meijer, Jun 05 2011: (Start)
A106344 is a skew version of this triangle.
Triangle sums (see the comments): A001316 (Row1; Related to Row2), A002487 (Related to Kn11, Kn12, Kn13, Kn21, Kn22, Kn23), A007306 (Kn3, Kn4), A060632 (Fi1, Fi2), A120562 (Ca1, Ca2), A112970 (Gi1, Gi2), A127830 (Ze3, Ze4). (End)

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 *)
  • 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
Sum_{k>=0} T(n, k) = A001316(n) = 2^A000120(n).
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

A083093 Triangle, read by rows, formed by reading Pascal's triangle (A007318) mod 3.

Original entry on oeis.org

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, 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, 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
Offset: 0

Author

Benoit Cloitre, Apr 22 2003

Keywords

Comments

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
{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

Examples

			.            Rows 0 .. 3^3:
.    0:                             1
.    1:                            1 1
.    2:                           1 2 1
.    3:                          1 0 0 1
.    4:                         1 1 0 1 1
.    5:                        1 2 1 1 2 1
.    6:                       1 0 0 2 0 0 1
.    7:                      1 1 0 2 2 0 1 1
.    8:                     1 2 1 2 1 2 1 2 1
.    9:                    1 0 0 0 0 0 0 0 0 1
.   10:                   1 1 0 0 0 0 0 0 0 1 1
.   11:                  1 2 1 0 0 0 0 0 0 1 2 1
.   12:                 1 0 0 1 0 0 0 0 0 1 0 0 1
.   13:                1 1 0 1 1 0 0 0 0 1 1 0 1 1
.   14:               1 2 1 1 2 1 0 0 0 1 2 1 1 2 1
.   15:              1 0 0 2 0 0 1 0 0 1 0 0 2 0 0 1
.   16:             1 1 0 2 2 0 1 1 0 1 1 0 2 2 0 1 1
.   17:            1 2 1 2 1 2 1 2 1 1 2 1 2 1 2 1 2 1
.   18:           1 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 1
.   19:          1 1 0 0 0 0 0 0 0 2 2 0 0 0 0 0 0 0 1 1
.   20:         1 2 1 0 0 0 0 0 0 2 1 2 0 0 0 0 0 0 1 2 1
.   21:        1 0 0 1 0 0 0 0 0 2 0 0 2 0 0 0 0 0 1 0 0 1
.   22:       1 1 0 1 1 0 0 0 0 2 2 0 2 2 0 0 0 0 1 1 0 1 1
.   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
.   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
.   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
.   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
.   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 .
- _Reinhard Zumkeller_, Jul 11 2013
		

References

  • Boris A. Bondarenko, Generalized Pascal Triangles and Pyramids (in Russian), FAN, Tashkent, 1990, ISBN 5-648-00738-8.
  • Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.

Crossrefs

Cf. A006996 (central terms), A173019, A206424, A227428.
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).

Programs

  • Haskell
    a083093 n k = a083093_tabl !! n !! k
    a083093_row n = a083093_tabl !! n
    a083093_tabl = iterate
       (\ws -> zipWith (\u v -> mod (u + v) 3) ([0] ++ ws) (ws ++ [0])) [1]
    -- Reinhard Zumkeller, Jul 11 2013
    
  • Magma
    /* As triangle: */ [[Binomial(n,k) mod 3: k in [0..n]]: n in [0.. 15]]; // Vincenzo Librandi, Feb 15 2016
    
  • Maple
    A083093 := proc(n,k)
        modp(binomial(n,k),3) ;
    end proc:
    seq(seq(A083093(n,k),k=0..n),n=0..10) ; # R. J. Mathar, Jul 26 2017
  • Mathematica
    Mod[ Flatten[ Table[ Binomial[n, k], {n, 0, 13}, {k, 0, n}]], 3] (* Robert G. Wilson v, Jan 19 2004 *)
  • Python
    from sympy import binomial
    def T(n, k):
        return binomial(n, k) % 3
    for n in range(21): print([T(n, k) for k in range(n + 1)]) # Indranil Ghosh, Jul 26 2017
    
  • Python
    from math import comb, isqrt
    def A083093(n):
        def f(m,k):
            if m<3 and k<3: return comb(m,k)%3
            c,a = divmod(m,3)
            d,b = divmod(k,3)
            return f(c,d)*f(a,b)%3
        return f(r:=(m:=isqrt(k:=n+1<<1))-(k<=m*(m+1)),n-comb(r+1,2)) # Chai Wah Wu, Apr 30 2025

Formula

T(i, j) = binomial(i, j) mod 3.
T(n+1,k) = (T(n,k) + T(n,k-1)) mod 3. - Reinhard Zumkeller, Jul 11 2013
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

A034931 Triangle read by rows: Pascal's triangle (A007318) mod 4.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 0, 2, 0, 1, 1, 1, 2, 2, 1, 1, 1, 2, 3, 0, 3, 2, 1, 1, 3, 1, 3, 3, 1, 3, 1, 1, 0, 0, 0, 2, 0, 0, 0, 1, 1, 1, 0, 0, 2, 2, 0, 0, 1, 1, 1, 2, 1, 0, 2, 0, 2, 0, 1, 2, 1, 1, 3, 3, 1, 2, 2, 2, 2, 1, 3, 3, 1, 1, 0, 2, 0, 3, 0, 0, 0, 3, 0, 2, 0, 1, 1, 1, 2, 2, 3, 3, 0, 0, 3, 3, 2, 2, 1, 1
Offset: 0

Keywords

Comments

The number of 3's in row n is given by 2^(A000120(n)-1) if A014081(n) is nonzero, else by 0 [Davis & Webb]. - R. J. Mathar, Jul 28 2017

Examples

			Triangle begins:
                 1
                1 1
               1 2 1
              1 3 3 1
             1 0 2 0 1
            1 1 2 2 1 1
           1 2 3 0 3 2 1
          1 3 1 3 3 1 3 1
         1 0 0 0 2 0 0 0 1
        1 1 0 0 2 2 0 0 1 1
       1 2 1 0 2 0 2 0 1 2 1
      1 3 3 1 2 2 2 2 1 3 3 1
  ...
		

Crossrefs

Cf. A007318, A047999, A083093, A034930, A008975, A034932, A163000 (# 2's), A270438 (# 1's), A249732 (# 0's).
Sequences based on the triangles formed by reading Pascal's triangle mod m: A047999 (m = 2), A083093 (m = 3), (this sequence) (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).

Programs

  • Haskell
    a034931 n k = a034931_tabl !! n !! k
    a034931_row n = a034931_tabl !! n
    a034931_tabl = iterate
       (\ws -> zipWith ((flip mod 4 .) . (+)) ([0] ++ ws) (ws ++ [0])) [1]
    -- Reinhard Zumkeller, Mar 14 2015
    
  • Maple
    A034931 := proc(n,k)
        modp(binomial(n,k),4) ;
    end proc:
    seq(seq(A034931(n,k),k=0..n),n=0..10); # R. J. Mathar, Jul 28 2017
  • Mathematica
    Mod[ Flatten[ Table[ Binomial[n, k], {n, 0, 13}, {k, 0, n}]], 4] (* Robert G. Wilson v, May 26 2004 *)
  • PARI
    C(n, k)=binomial(n, k)%4 \\ Charles R Greathouse IV, Aug 09 2016
    
  • PARI
    f(n,k)=2*(bitand(n-k, k)==0);
    T(n,j)=if(j==0,return(1)); my(k=logint(n,2),K=2^k,K1=K/2,L=n-K); if(LCharles R Greathouse IV, Aug 11 2016
    
  • Python
    from math import isqrt, comb
    def A034931(n):
        g = (m:=isqrt(f:=n+1<<1))-(f<=m*(m+1))
        k = n-comb(g+1,2)
        if k.bit_count()+(g-k).bit_count()-g.bit_count()>1: return 0
        s, c, d = bin(g)[2:], 1, 0
        w = (bin(k)[2:]).zfill(l:=len(s))
        for i in range(0,l-1):
            r, t = s[i:i+2], w[i:i+2]
            if (x:=int(r,2)) < (y:=int(t,2)):
                d += (t[0]>r[0])+(t[1]>r[1])
            else:
                c = c*comb(x,y)&3
        d -= sum(1 for i in range(1,l-1) if w[i]>s[i])
        return (c<Chai Wah Wu, Jul 19 2025

Formula

T(n+1,k) = (T(n,k) + T(n,k-1)) mod 4. - Reinhard Zumkeller, Mar 14 2015

A095143 Triangle, read by rows, formed by reading Pascal's triangle (A007318) mod 9.

Original entry on oeis.org

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

Author

Robert G. Wilson v, May 29 2004

Keywords

Examples

			Triangle begins:
              1;
            1,  1;
          1,  2,  1;
        1,  3,  3,  1;
      1,  4,  6,  4,  1;
    1,  5,  1,  1,  5,  1;
  1,  6,  6,  2,  6,  6,  1;
  ...
		

Crossrefs

Sequences based on the triangles formed by reading Pascal's triangle mod m: A047999 (m = 2), A083093 (m = 3), A034931 (m = 4), A095140 (m = 5), A095141 (m = 6), A095142 (m = 7), A034930 (m = 8), (this sequence) (m = 9), A008975 (m = 10), A095144 (m = 11), A095145 (m = 12), A275198 (m = 14), A034932 (m = 16).

Programs

  • Mathematica
    Mod[ Flatten[ Table[ Binomial[n, k], {n, 0, 13}, {k, 0, n}]], 9]
  • Python
    from math import isqrt, comb
    from gmpy2 import digits
    def A095143(n):
        g = (m:=isqrt(f:=n+1<<1))-(f<=m*(m+1))
        k = n-comb(g+1,2)
        if sum(int(d) for d in digits(k,3))+sum(int(d) for d in digits(g-k,3))-sum(int(d) for d in digits(g,3))>2: return 0
        s, c, d = digits(g,3), 1, 0
        w = (digits(k,3)).zfill(l:=len(s))
        if l == 1: return comb(g,k)%9
        for i in range(0,l-1):
            r, t = s[i:i+2], w[i:i+2]
            if (x:=int(r,3)) < (y:=int(t,3)):
                d += (t[0]>r[0])+(t[1]>r[1])
                if r[1]>=t[1]:
                    c = c*comb(int(r[1],3),int(t[1],3))%9
            else:
                c = c*comb(x,y)%9
        for i in range(1,l-1):
            if w[i]>s[i] or (z:=comb(int(s[i],3),int(w[i],3))) == 3:
                d -= 1
            else:
                c = c*pow(z,-1,9)%9
        return c*3**d%9 # Chai Wah Wu, Jul 19 2025

Formula

T(i, j) = binomial(i, j) mod 9.

A034930 Triangle, read by rows, formed by reading Pascal's triangle (A007318) mod 8.

Original entry on oeis.org

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

Keywords

Crossrefs

Sequences based on the triangles formed by reading Pascal's triangle mod m: A047999 (m = 2), A083093 (m = 3), A034931 (m = 4), A095140 (m = 5), A095141 (m = 6), A095142 (m = 7), (this sequence) (m = 8), A095143 (m = 9), A008975 (m = 10), A095144 (m = 11), A095145 (m = 12), A275198 (m = 14), A034932 (m = 16).

Programs

  • Haskell
    a034930 n k = a034930_tabl !! n !! k
    a034930_row n = a034930_tabl !! n
    a034930_tabl = iterate
       (\ws -> zipWith (\u v -> mod (u + v) 8) ([0] ++ ws) (ws ++ [0])) [1]
    -- Reinhard Zumkeller, Jul 12 2013, Jun 21 2013
    
  • Mathematica
    Mod[ Flatten[ Table[ Binomial[n, k], {n, 0, 13}, {k, 0, n}]], 8] (* Robert G. Wilson v, May 26 2004 *)
  • Python
    from math import comb, isqrt
    def A034930(n):
        g = (m:=isqrt(f:=n+1<<1))-(f<=m*(m+1))
        k = n-comb(g+1,2)
        if k.bit_count()+(g-k).bit_count()-g.bit_count()>2: return 0
        def g1(s,w,e):
            c, d = 1, 0
            if len(s) == 0: return c, d
            a, b = int(s,2), int(w,2)
            if a>=b:
                k = comb(a,b)&7
                j = (~k & k-1).bit_length()
                d += j*e
                k >>= j
                c = c*pow(k,e,8)&7
            else:
                if int(s[0:1],2)Chai Wah Wu, Jul 20 2025

Formula

T(n+1,k) = (T(n,k) + T(n,k-1)) mod 8. - Reinhard Zumkeller, Jul 12 2013

A034932 Triangle, read by rows, formed by reading Pascal's triangle (A007318) mod 16.

Original entry on oeis.org

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

Keywords

Comments

T(n+1,k) = (T(n,k) + T(n,k-1)) mod 16. - Reinhard Zumkeller, Mar 14 2015

Examples

			Triangle begins:
                        1
                      1   1
                    1   2   1
                  1   3   3   1
                1   4   6   4   1
              1   5  10  10   5   1
            1   6  15   4  15   6   1
          1   7   5   3   3   5   7   1
        1   8  12   8   6   8  12   8   1
      1   9   4   4  14  14   4   4   9   1
    1  10  13   8   2  12   2   8  13  10   1
  1  11   7   5  10  14  14  10   5   7  11   1
.
Written in hexadecimal (with a=10, b=11, ..., f=15), rows 0..32 are
.
                                   1
                                  1 1
                                 1 2 1
                                1 3 3 1
                               1 4 6 4 1
                              1 5 a a 5 1
                             1 6 f 4 f 6 1
                            1 7 5 3 3 5 7 1
                           1 8 c 8 6 8 c 8 1
                          1 9 4 4 e e 4 4 9 1
                         1 a d 8 2 c 2 8 d a 1
                        1 b 7 5 a e e a 5 7 b 1
                       1 c 2 c f 8 c 8 f c 2 c 1
                      1 d e e b 7 4 4 7 b e e d 1
                     1 e b c 9 2 b 8 b 2 9 c b e 1
                    1 f 9 7 5 b d 3 3 d b 5 7 9 f 1
                   1 0 8 0 c 0 8 0 6 0 8 0 c 0 8 0 1
                  1 1 8 8 c c 8 8 6 6 8 8 c c 8 8 1 1
                 1 2 9 0 4 8 4 0 e c e 0 4 8 4 0 9 2 1
                1 3 b 9 4 c c 4 e a a e 4 c c 4 9 b 3 1
               1 4 e 4 d 0 8 0 2 8 4 8 2 0 8 0 d 4 e 4 1
              1 5 2 2 1 d 8 8 2 a c c a 2 8 8 d 1 2 2 5 1
             1 6 7 4 3 e 5 0 a c 6 8 6 c a 0 5 e 3 4 7 6 1
            1 7 d b 7 1 3 5 a 6 2 e e 2 6 a 5 3 1 7 b d 7 1
           1 8 4 8 2 8 4 8 f 0 8 0 c 0 8 0 f 8 4 8 2 8 4 8 1
          1 9 c c a a c c 7 f 8 8 c c 8 8 f 7 c c a a c c 9 1
         1 a 5 8 6 4 6 8 3 6 7 0 4 8 4 0 7 6 3 8 6 4 6 8 5 a 1
        1 b f d e a a e b 9 d 7 4 c c 4 7 d 9 b e a a e d f b 1
       1 c a c b 8 4 8 9 4 6 4 b 0 8 0 b 4 6 4 9 8 4 8 b c a c 1
      1 d 6 6 7 3 c c 1 d a a f b 8 8 b f a a d 1 c c 3 7 6 6 d 1
     1 e 3 c d a f 8 d e 7 4 9 a 3 0 3 a 9 4 7 e d 8 f a d c 3 e 1
    1 f 1 f 9 7 9 7 5 b 5 b d 3 d 3 3 d 3 d b 5 b 5 7 9 7 9 f 1 f 1
   1 0 0 0 8 0 0 0 c 0 0 0 8 0 0 0 6 0 0 0 8 0 0 0 c 0 0 0 8 0 0 0 1
		

Crossrefs

Sequences based on the triangles formed by reading Pascal's triangle mod m: A047999 (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), (this sequence) (m = 16).

Programs

  • Haskell
    a034932 n k = a034932_tabl !! n !! k
    a034932_row n = a034932_tabl !! n
    a034932_tabl = iterate
       (\ws -> zipWith ((flip mod 16 .) . (+)) ([0] ++ ws) (ws ++ [0])) [1]
    -- Reinhard Zumkeller, Mar 14 2015
    
  • Mathematica
    Mod[ Flatten[ Table[ Binomial[n, k], {n, 0, 13}, {k, 0, n}]], 16] (* Robert G. Wilson v, May 26 2004 *)
  • Python
    from math import comb, isqrt
    def A034932(n):
        g = (m:=isqrt(f:=n+1<<1))-(f<=m*(m+1))
        k = n-comb(g+1,2)
        if k.bit_count()+(g-k).bit_count()-g.bit_count()>3: return 0
        def g1(s,w,e):
            c, d = 1, 0
            if len(s) == 0: return c, d
            a, b = int(s,2), int(w,2)
            if a>=b:
                k = comb(a,b)&15
                j = (~k & k-1).bit_length()
                d += j*e
                k >>= j
                c = c*pow(k,e,16)&15
            else:
                if int(s[0:1],2)Chai Wah Wu, Jul 20 2025

Formula

T(i, j) = binomial(i, j) mod 16.
Showing 1-10 of 20 results. Next