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

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

Views

Author

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.

A051638 a(n) = Sum_{k=0..n} (C(n,k) mod 3).

Original entry on oeis.org

1, 2, 4, 2, 4, 8, 4, 8, 13, 2, 4, 8, 4, 8, 16, 8, 16, 26, 4, 8, 13, 8, 16, 26, 13, 26, 40, 2, 4, 8, 4, 8, 16, 8, 16, 26, 4, 8, 16, 8, 16, 32, 16, 32, 52, 8, 16, 26, 16, 32, 52, 26, 52, 80, 4, 8, 13, 8, 16, 26, 13, 26, 40, 8, 16, 26, 16, 32, 52, 26, 52, 80, 13
Offset: 0

Views

Author

Keywords

Comments

Row sums of the triangle in A083093. - Reinhard Zumkeller, Jul 11 2013

Crossrefs

Cf. A001316.

Programs

  • Haskell
    a051638 = sum . a083093_row  -- Reinhard Zumkeller, Jul 11 2013
    
  • Mathematica
    Table[2^(DigitCount[n,3,1]-1) (3^(DigitCount[n,3,2]+1)-1),{n,0,80}] (* Harvey P. Dale, Jun 20 2019 *)
  • Python
    from gmpy2 import digits
    def A051638(n): return 3*3**(s:=digits(n,3)).count('2')-1<>1 # Chai Wah Wu, Jun 25 2025

Formula

Write n in base 3; if the representation contains r 1's and s 2's then a(n) = 2^{r-1} * (3^(s+1) - 1) = 1/2 * (3*A006047(n) - 2^(A062756(n))). - Robin Chapman, Ahmed Fares (ahmedfares(AT)my-deja.com) and others, Jul 16 2001
a(3n) = a(n), a(3n+1) = 2a(n), a(9n+2) = a(3n+2), a(9n+5) = 2a(3n+2), a(9n+8) = 4a(3n+2) - 3a(n). - David Radcliffe, Jun 25 2025

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

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, May 29 2004

Keywords

Comments

{T(n,k)} is a fractal gasket with fractal (Hausdorff) dimension log(A000217(5))/log(5) = log(15)/log(5) = 1.68260... (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

References

  • Boris A. Bondarenko, Generalized Pascal Triangles and Pyramids (in Russian), FAN, Tashkent, 1990, ISBN 5-648-00738-8.

Crossrefs

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

  • Mathematica
    Mod[ Flatten[ Table[ Binomial[n, k], {n, 0, 13}, {k, 0, n}]], 5]
  • Python
    from math import isqrt, comb
    def A095140(n):
        def f(m,k):
            if m<5 and k<5: return comb(m,k)%5
            c,a = divmod(m,5)
            d,b = divmod(k,5)
            return f(c,d)*f(a,b)%5
        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 5.

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

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, May 29 2004

Keywords

Comments

{T(n,k)} is a fractal gasket with fractal (Hausdorff) dimension log(A000217(7))/log(7) = log(28)/log(7) = 1.71241... (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

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

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), (this sequence) (m = 7), A034930(m = 8), A095143 (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}]], 7]
  • Python
    from math import comb, isqrt
    def A095142(n):
        def f(m,k):
            if m<7 and k<7: return comb(m,k)%7
            c,a = divmod(m,7)
            d,b = divmod(k,7)
            return f(c,d)*f(a,b)%7
        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 7.

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

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, 4, 9, 4, 6, 1, 1, 7, 10, 2, 2, 10, 7, 1, 1, 8, 6, 1, 4, 1, 6, 8, 1, 1, 9, 3, 7, 5, 5, 7, 3, 9, 1, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1
Offset: 0

Views

Author

Robert G. Wilson v, May 29 2004

Keywords

Comments

{T(n,k)} is a fractal gasket with fractal (Hausdorff) dimension log(A000217(11))/log(11) = log(66)/log(11) = 1.74722... (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

References

  • Boris A. Bondarenko, Generalized Pascal Triangles and Pyramids (in Russian), FAN, Tashkent, 1990, ISBN 5-648-00738-8.

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), (this sequence) (m = 11), A095145 (m = 12), A275198 (m = 14), A034932 (m = 16).

Programs

  • Maple
    R[0]:= 1:
    for  n from 1 to 20 do
      R[n]:= op([R[n-1],0] + [0,R[n-1]] mod 11);
    od:
    for n from 0 to 20 do R[n] od; # Robert Israel, Jan 02 2019
  • Mathematica
    Mod[ Flatten[ Table[ Binomial[n, k], {n, 0, 13}, {k, 0, n}]], 11]
  • Python
    from math import isqrt, comb
    def A095144(n):
        def f(m,k):
            if m<11 and k<11: return comb(m,k)%11
            c,a = divmod(m,11)
            d,b = divmod(k,11)
            return f(c,d)*f(a,b)%11
        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 11.
From Robert Israel, Jan 02 2019: (Start)
T(n,k) = (T(n-1,k-1) + T(n-1,k)) mod 11 with T(n,0) = 1.
T(n,k) = (Product_i binomial(n_i, k_i)) mod 11, where n_i and k_i are the base-11 digits of n and k. (End)

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

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, May 29 2004

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), (this sequence) (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

  • Mathematica
    Mod[ Flatten[ Table[ Binomial[n, k], {n, 0, 13}, {k, 0, n}]], 6]
    Graphics[Table[{%[Mod[Binomial[n, k], 6]/5], RegularPolygon[{4√3 (k - n/2), -6 n}, {4,π/6}, 6]}, {n, 0, 105}, {k, 0, n}]] (* Mma code for illustration, Bill Gosper, Aug 05 2017 *)
  • Python
    from math import isqrt, comb
    from sympy.ntheory.modular import crt
    def A095141(n):
        w, c = n-((r:=(m:=isqrt(k:=n+1<<1))-(k<=m*(m+1)))*(r+1)>>1), 1
        d = int(not ~r & w)
        while True:
            r, a = divmod(r,3)
            w, b = divmod(w,3)
            c = c*comb(a,b)%3
            if r<3 and w<3:
                c = c*comb(r,w)%3
                break
        return crt([3,2],[c,d])[0] # Chai Wah Wu, May 01 2025

Formula

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

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

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, 3, 8, 3, 6, 1, 1, 7, 9, 11, 11, 9, 7, 1, 1, 8, 4, 8, 10, 8, 4, 8, 1, 1, 9, 0, 0, 6, 6, 0, 0, 9, 1, 1, 10, 9, 0, 6, 0, 6, 0, 9, 10, 1, 1, 11, 7, 9, 6, 6, 6, 6, 9, 7, 11, 1, 1, 0, 6, 4, 3, 0, 0, 0, 3, 4, 6, 0, 1, 1, 1, 6, 10, 7, 3, 0, 0, 3, 7, 10, 6, 1, 1
Offset: 0

Views

Author

Robert G. Wilson v, May 29 2004

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), A034930 (m = 8), A095143 (m = 9), A008975 (m = 10), A095144 (m = 11), (this sequence) (m = 12), A275198 (m = 14), A034932 (m = 16).

Programs

  • Mathematica
    Mod[ Flatten[ Table[ Binomial[n, k], {n, 0, 13}, {k, 0, n}]], 12]
  • Python
    # uses python code from A034931 and A083093
    from sympy.ntheory.modular import crt
    def A095145(n): return crt([4,3],[A034931(n),A083093(n)])[0] # Chai Wah Wu, Jul 19 2025

Formula

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

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

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, 1, 6, 1, 6, 1, 1, 7, 7, 7, 7, 7, 7, 1, 1, 8, 0, 0, 0, 0, 0, 8, 1, 1, 9, 8, 0, 0, 0, 0, 8, 9, 1, 1, 10, 3, 8, 0, 0, 0, 8, 3, 10, 1, 1, 11, 13, 11, 8, 0, 0, 8, 11, 13, 11, 1, 1, 12, 10, 10, 5, 8, 0, 8, 5, 10, 10, 12, 1, 1, 13, 8, 6, 1, 13, 8, 8, 13, 1, 6, 8, 13, 1, 1, 0, 7, 0, 7, 0, 7, 2, 7, 0, 7, 0, 7, 0, 1
Offset: 0

Views

Author

Ilya Gutkovskiy, Aug 11 2016

Keywords

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,  1,  6,  1,  6,  1,
        1,  7,  7,  7,  7,  7,  7,  1,
      1,  8,  0,  0,  0,  0,  0,  8,  1,
    1,  9,  8,  0,  0,  0,  0,  8,  9,  1,
  1, 10,  3,  8,  0,  0,  0,  8,  3, 10,  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), (this sequence) (m = 14), A034932 (m = 16).

Programs

  • Mathematica
    Mod[Flatten[Table[Binomial[n, k], {n, 0, 14}, {k, 0, n}]], 14]
  • Python
    from math import comb, isqrt
    from sympy.ntheory.modular import crt
    def A275198(n):
        w, c = n-((r:=(m:=isqrt(k:=n+1<<1))-(k<=m*(m+1)))*(r+1)>>1), 1
        d = int(not ~r & w)
        while True:
            r, a = divmod(r,7)
            w, b = divmod(w,7)
            c = c*comb(a,b)%7
            if r<7 and w<7:
                c = c*comb(r,w)%7
                break
        return crt([7,2],[c,d])[0] # Chai Wah Wu, May 01 2025

Formula

T(n, k) = binomial(n, k) mod 14.
a(n) = A070696(A007318(n)).

A006996 a(n) = C(2n,n) mod 3.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Removing 0's from the sequence gives Thue-Morse sequence A001285 : 1,2,0,2,1,0,0,0,0,2,1,0,1,2,..->1,2,2,1,2,1,1,2,... - Benoit Cloitre, Jan 04 2004
a(n) = 0 if n in A074940, a(n) = 1 if n in A074939, a(n) = 2 if n in A074938.
Central terms of the triangle in A083093. - Reinhard Zumkeller, Jul 11 2013

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a006996 n = a083093 (2 * n) n  -- Reinhard Zumkeller, Jul 11 2013
    
  • Mathematica
    Table[ Mod[ Binomial[2n, n], 3], {n, 0, 104}] (* Or *)
    Nest[ Function[ l, {Flatten[(l /. {0 -> {0, 0, 0}, 1 -> {1, 2, 0}, 2 -> {2, 1, 0}})]}], {1}, 7] (* Robert G. Wilson v, Mar 28 2005 *)
  • PARI
    a(n)=if(n==0, return(1)); if(vecmax(Set(digits(n,3)))>1, 0, 1 + n%2) \\ Charles R Greathouse IV, May 09 2016
    
  • Python
    from gmpy2 import digits
    def A006996(n): return 0 if '2' in digits(n,3) else 1+(n&1) # Chai Wah Wu, Jun 26 2025

Formula

a(n) = A000984(n) mod 3.
a(n) = A005704(n) mod 3. - Benoit Cloitre, Jan 04 2004
A fixed point of the morphism : 1 -> 120, 2 -> 210, 0 -> 000. - Philippe Deléham, Jan 08 2004

A062296 a(n) = number of entries in n-th row of Pascal's triangle divisible by 3.

Original entry on oeis.org

0, 0, 0, 2, 1, 0, 4, 2, 0, 8, 7, 6, 9, 6, 3, 10, 5, 0, 16, 14, 12, 16, 11, 6, 16, 8, 0, 26, 25, 24, 27, 24, 21, 28, 23, 18, 33, 30, 27, 32, 25, 18, 31, 20, 9, 40, 35, 30, 37, 26, 15, 34, 17, 0, 52, 50, 48, 52, 47, 42, 52, 44, 36, 58, 53, 48, 55, 44, 33, 52, 35, 18, 64, 56, 48, 58, 41
Offset: 0

Views

Author

Ahmed Fares (ahmedfares(AT)my-deja.com), Jul 02 2001

Keywords

Comments

Number of zeros in row n of triangle A083093. - Reinhard Zumkeller, Jul 11 2013

Examples

			When n=3 the row is 1,3,3,1 so a(3) = 2.
		

Crossrefs

Programs

  • Haskell
    a062296 = sum . map ((1 -) . signum) . a083093_row
    -- Reinhard Zumkeller, Jul 11 2013
    
  • Maple
    p:=proc(n) local ct, k: ct:=0: for k from 0 to n do if binomial(n,k) mod 3 = 0 then else ct:=ct+1 fi od: end: seq(n+1-p(n),n=0..83); # Emeric Deutsch
  • Mathematica
    a[n_] := Count[(Binomial[n, #] & )[Range[0, n]], _?(Divisible[#, 3] & )];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Jan 26 2018 *)
    Table[n + 1 - 2^(DigitCount[n, 3, 1])*3^(DigitCount[n, 3, 2]), {n, 0, 76}] (* Shenghui Yang, Jan 08 2025 *)
  • Python
    from sympy.ntheory import digits
    def A062296(n):
        s = digits(n,3)[1:]
        return n+1-(3**s.count(2)<Chai Wah Wu, Jul 24 2025

Formula

a(n) = n + 1 - A006047(n).
a(n) = n + 1 - A206424(n) - A227428(n). - Reinhard Zumkeller, Jul 11 2013
a(n) = n + 1 - 2^A062756(n)*3^A081603(n). - Shenghui Yang, Jan 08 2025

Extensions

More terms from Emeric Deutsch, Feb 03 2005
Previous Showing 11-20 of 36 results. Next