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 40 results. Next

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

Views

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

A194459 Number of entries in the n-th row of Pascal's triangle not divisible by 5.

Original entry on oeis.org

1, 2, 3, 4, 5, 2, 4, 6, 8, 10, 3, 6, 9, 12, 15, 4, 8, 12, 16, 20, 5, 10, 15, 20, 25, 2, 4, 6, 8, 10, 4, 8, 12, 16, 20, 6, 12, 18, 24, 30, 8, 16, 24, 32, 40, 10, 20, 30, 40, 50, 3, 6, 9, 12, 15, 6, 12, 18, 24, 30, 9, 18, 27, 36, 45, 12, 24, 36, 48, 60, 15, 30
Offset: 0

Views

Author

Paul Weisenhorn, Aug 24 2011

Keywords

Comments

Pascal triangles modulo p with p prime have the dimension D = log(p*(p+1)/2)/log(p). [Corrected by Connor Lane, Nov 28 2022]
Also number of ones in row n of triangle A254609. - Reinhard Zumkeller, Feb 04 2015

Examples

			n = 32 = 112|_5: b(32,1) = 2, b(32,2) = 1, thus a(32) = 2^2 * 3^1 = 12.
		

Crossrefs

Cf. A006046, A001316 (for p=2).
Cf. A006048, A006047 (for p=3).
Cf. A194458 (for p=5).

Programs

  • Haskell
    a194459 = sum . map (signum . flip mod 5) . a007318_row
    -- Reinhard Zumkeller, Feb 04 2015
    
  • Maple
    a:= proc(n) local l, m, t;
          m:= n;
          l:= [0$5];
          while m>0 do t:= irem(m, 5, 'm')+1; l[t]:=l[t]+1 od;
          mul(r^l[r], r=2..5)
        end:
    seq(a(n), n=0..100);
  • Mathematica
    Nest[Join[#, 2#, 3#, 4#, 5#]&, {1}, 4] (* Jean-François Alcover, Apr 12 2017, after code by Robert G. Wilson v in A006047 *)
  • Python
    from math import prod
    from sympy.ntheory import digits
    def A194459(n):
        s = digits(n,5)[1:]
        return prod((d+1)**s.count(d) for d in range(1,5)) # Chai Wah Wu, Jul 23 2025

Formula

a(n) = Product_{d=1..4} (d+1)^b(n,d) with b(n,d) = number of digits d in base 5 expansion of n. The formula generalizes to other prime bases p.
a(n) = A194458(n) - A194458(n-1).

Extensions

Edited by Alois P. Heinz, Sep 06 2011

A382720 Number of entries in the n-th row of Pascal's triangle not divisible by 7.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 2, 4, 6, 8, 10, 12, 14, 3, 6, 9, 12, 15, 18, 21, 4, 8, 12, 16, 20, 24, 28, 5, 10, 15, 20, 25, 30, 35, 6, 12, 18, 24, 30, 36, 42, 7, 14, 21, 28, 35, 42, 49, 2, 4, 6, 8, 10, 12, 14, 4, 8, 12, 16, 20, 24, 28, 6, 12, 18, 24, 30, 36, 42, 8, 16, 24, 32, 40, 48, 56, 10, 20, 30, 40
Offset: 0

Views

Author

N. J. A. Sloane, Apr 23 2025

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Times @@ (IntegerDigits[n, 7] + 1);Array[a,81,0] (* James C. McMahon, Aug 16 2025 *)
  • Python
    from math import prod
    from gmpy2 import digits
    def A382720(n): return prod(int(d)+1 for d in digits(n,7)) # Chai Wah Wu, Aug 10 2025

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

A290093 Compound filter (for base-3 digit runlengths): a(n) = P(A290091(n), A290092(n)), where P(n,k) is sequence A000027 used as a pairing function.

Original entry on oeis.org

1, 3, 2, 3, 10, 5, 2, 5, 7, 3, 21, 5, 10, 36, 14, 5, 27, 12, 2, 5, 16, 5, 14, 23, 7, 12, 29, 3, 21, 5, 21, 78, 27, 5, 27, 12, 10, 78, 14, 36, 136, 44, 14, 90, 25, 5, 27, 23, 27, 90, 61, 12, 42, 38, 2, 5, 16, 5, 14, 23, 16, 23, 67, 5, 27, 23, 14, 44, 40, 23, 61, 80, 7, 12, 67, 12, 25, 80, 29, 38, 121, 3, 21, 5, 21, 78, 27, 5, 27, 12, 21, 465, 27, 78, 300, 90, 27
Offset: 0

Views

Author

Antti Karttunen, Jul 25 2017

Keywords

Comments

For all i, j: a(i) = a(j) => A006047(i) = A006047(j) => A053735(i) = A053735(j).

Crossrefs

Cf. A006047, A053735, A290079 (some of the matched sequences).

Programs

Formula

a(n) = (1/2)*(2 + ((A290091(n)+A290092(n))^2) - A290091(n) - 3*A290092(n)).

A006048 Number of entries in first n rows of Pascal's triangle not divisible by 3.

Original entry on oeis.org

1, 3, 6, 8, 12, 18, 21, 27, 36, 38, 42, 48, 52, 60, 72, 78, 90, 108, 111, 117, 126, 132, 144, 162, 171, 189, 216, 218, 222, 228, 232, 240, 252, 258, 270, 288, 292, 300, 312, 320, 336, 360, 372, 396, 432, 438, 450, 468, 480, 504, 540, 558, 594, 648, 651, 657, 666, 672, 684, 702, 711, 729, 756, 762, 774, 792, 804, 828, 864, 882, 918, 972, 981, 999, 1026, 1044, 1080, 1134, 1161, 1215, 1296
Offset: 0

Views

Author

Keywords

References

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

Crossrefs

Partial sums of A006047.

Programs

  • Python
    from math import prod
    from gmpy2 import digits
    def A006048(n): return sum(prod(int(d)+1 for d in digits(m,3)) for m in range(n+1)) # Chai Wah Wu, Aug 10 2025
    
  • Python
    from math import prod
    from gmpy2 import digits
    def A006048(n):
        d = list(map(lambda x:int(x)+1,digits(n+1,3)[::-1]))
        return sum((b-1)*prod(d[a:])*6**a for a, b in enumerate(d))>>1  # Chai Wah Wu, Aug 13 2025

Extensions

More terms from N. J. A. Sloane, Apr 23 2025

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

A194458 Total number of entries in rows 0,1,...,n of Pascal's triangle not divisible by 5.

Original entry on oeis.org

1, 3, 6, 10, 15, 17, 21, 27, 35, 45, 48, 54, 63, 75, 90, 94, 102, 114, 130, 150, 155, 165, 180, 200, 225, 227, 231, 237, 245, 255, 259, 267, 279, 295, 315, 321, 333, 351, 375, 405, 413, 429, 453, 485, 525, 535, 555, 585, 625, 675, 678, 684, 693, 705, 720, 726
Offset: 0

Views

Author

Paul Weisenhorn, Aug 24 2011

Keywords

Comments

The number of zeros in the first n rows is binomial(n+1,2) - a(n).

Examples

			n = 38: n+1 = 39 = 124_5, thus a(38) = (C(5,2)*15^0*3 + C(3,2)*15^1)*2 + C(2,2)*15^2 = (10*1*3 + 3*15)*2 + 1*225 = 375.
		

Crossrefs

A006046(n+1) = A006046(n) + A001316(n) for p=2.
A006048(n+1) = A006048(n) + A006047(n+1) for p=3.
a(n+1) = a(n) + A194459(n+1) for p=5.

Programs

  • Maple
    a:= proc(n) local l, m, h, j;
          m:= n+1;
          l:= [];
          while m>0 do l:= [l[], irem (m, 5, 'm')+1] od;
          h:= 0;
          for j to nops(l) do h:= h*l[j] +binomial (l[j], 2) *15^(j-1) od:
          h
        end:
    seq(a(n), n=0..100);
  • Mathematica
    a[n_] := Module[{l, m, r, h, j}, m = n+1; l = {}; While[m>0, l = Append[l, {m, r} = QuotientRemainder[m, 5]; r+1]]; h = 0; For[j = 1, j <= Length[l], j++, h = h*l[[j]] + Binomial [l[[j]], 2] *15^(j-1)]; h]; Table [a[n], {n, 0, 100}] (* Jean-François Alcover, Feb 26 2017, translated from Maple *)
  • Python
    from math import prod
    from gmpy2 import digits
    def A194458(n): return sum(prod(int(d)+1 for d in digits(m,5)) for m in range(n+1)) # Chai Wah Wu, Aug 10 2025
    
  • Python
    from math import prod
    from gmpy2 import digits
    def A194458(n):
        d = list(map(lambda x:int(x)+1,digits(n+1,5)[::-1]))
        return sum((b-1)*prod(d[a:])*15**a for a, b in enumerate(d))>>1 # Chai Wah Wu, Aug 13 2025

Formula

a(n) = ((C(d0+1,2)*15^0*(d1+1) + C(d1+1,2)*15^1)*(d1+1) + C(d1+1,2)*15^1)*(d2+1) + C(d2+1,2)*15^2 ..., where d_k...d_1d_0 is the base 5 expansion of n+1 and 15 = binomial(5+1,2). The formula generalizes to other prime bases p.

Extensions

Edited by Alois P. Heinz, Sep 06 2011

A038148 Number of 3-infinitary divisors of n: if n = Product p(i)^r(i) and d = Product p(i)^s(i), each s(i) has a digit a <= b in its ternary expansion everywhere that the corresponding r(i) has a digit b, then d is a 3-infinitary-divisor of n.

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 2, 2, 3, 4, 2, 6, 2, 4, 4, 4, 2, 6, 2, 6, 4, 4, 2, 4, 3, 4, 2, 6, 2, 8, 2, 6, 4, 4, 4, 9, 2, 4, 4, 4, 2, 8, 2, 6, 6, 4, 2, 8, 3, 6, 4, 6, 2, 4, 4, 4, 4, 4, 2, 12, 2, 4, 6, 3, 4, 8, 2, 6, 4, 8, 2, 6, 2, 4, 6, 6, 4, 8, 2, 8, 4, 4, 2, 12, 4, 4, 4, 4, 2, 12, 4, 6, 4, 4, 4, 12, 2, 6, 6, 9, 2, 8, 2, 4, 8
Offset: 1

Views

Author

Keywords

Comments

Multiplicative: If e = sum d_k 3^k, then a(p^e) = prod (d_k+1). - Christian G. Bower, May 19 2005

Examples

			2^3*3 is a 3-infinitary-divisor of 2^5*3^2 because 2^3*3 = 2^10*3^1 and 2^5*3^2 = 2^12*3^2 in ternary expanded power. All corresponding digits satisfy the condition. 1 <= 1, 0 <= 2, 1 <= 2.
		

Crossrefs

Programs

Formula

a(1) = 1; for n > 1, a(n) = A006047(A067029(n)) * a(A028234(n)). [After Christian G. Bower's 2005 comment.] - Antti Karttunen, May 28 2017

Extensions

More terms from Naohiro Nomoto, Jun 21 2001
Data section further extended to 105 terms by Antti Karttunen, May 28 2017

A206424 The number of 1's in row n of Pascal's Triangle (mod 3).

Original entry on oeis.org

1, 2, 2, 2, 4, 4, 2, 4, 5, 2, 4, 4, 4, 8, 8, 4, 8, 10, 2, 4, 5, 4, 8, 10, 5, 10, 14, 2, 4, 4, 4, 8, 8, 4, 8, 10, 4, 8, 8, 8, 16, 16, 8, 16, 20, 4, 8, 10, 8, 16, 20, 10, 20, 28, 2, 4, 5, 4, 8, 10, 5, 10, 14, 4, 8, 10, 8, 16, 20, 10, 20, 28, 5, 10, 14, 10, 20, 28
Offset: 0

Views

Author

Marcus Jaiclin, Feb 07 2012

Keywords

Comments

A006047(n) = a(n) + A227428(n).
a(n) = n + 1 - A062296(n) - A227428(n); number of ones in row n of triangle A083093. - Reinhard Zumkeller, Jul 11 2013

Examples

			Rows 0-8 of Pascal's Triangle (mod 3) are:
  1                   So a(0) = 1
  1 1                 So a(1) = 2
  1 2 1               So a(2) = 2
  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
		

Crossrefs

Programs

Formula

From Antti Karttunen, Jul 27 2017: (Start)
a(n) = (3^k + 1)*2^(y-1), where y = A062756(n) and k = A081603(n). [See e.g. Wells or Wilson references.]
a(n) = A006047(n) - A227428(n).
(End)
From David A. Corneth and Antti Karttunen, Jul 27 2017: (Start)
Based on the first formula above, we have following identities:
a(3n) = a(n).
a(3n+1) = 2*a(n).
a(9n+4) = 4*a(n).
(End)
a(n) = (1/2)*Sum_{k = 0..n} mod(C(n,k) + C(n,k)^2, 3). - Peter Bala, Dec 17 2020
Previous Showing 11-20 of 40 results. Next