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

A270774 a(n) = (A005706(n) - A194459(n))/5.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 10, 10, 10, 10, 10, 16, 17, 18, 19, 20, 23, 24, 25, 26, 27, 32, 33, 34, 35, 36, 43, 44, 45, 46, 47, 56, 57, 58, 59, 60, 73, 76, 79, 82, 85, 91, 94, 97, 100, 103, 112, 115, 118, 121
Offset: 0

Views

Author

Tom Edgar, Mar 22 2016

Keywords

Comments

A combinatorial interpretation is given in the Edgar link.

Crossrefs

Programs

  • Mathematica
    b[0] = 1; b[n_] := b[n] = b[n-1] + b[Floor[n/5]];
    c[n_] := If[OddQ[n], 2 Count[Table[Binomial[n, k], {k, 0, (n-1)/2}], c_ /; !Divisible[c, 5]], 2 Count[Table[Binomial[n, k], {k, 0, (n-2)/2}], c_ /; !Divisible[c, 5]] + Boole[!Divisible[Binomial[n, n/2], 5]]];
    a[n_] := (b[n] - c[n])/5;
    Table[a[n], {n, 0, 63}] (* Jean-François Alcover, Feb 15 2019 *)
  • Sage
    def b(n):
        A=[1]
        for i in [1..n]:
            A.append(A[i-1] + A[i//5])
        return A[n]
    print([(b(n)-prod(x+1 for x in n.digits(5)))/5 for n in [0..63]])

Formula

Let b(0) = 1 and b(n) = b(n-1) + b(floor(n/5)) and let c(n) = Product_{i=0..k}(n_i+1) where n = Sum_{i=0..k}n_i*5^i is the base 5 representation of n. Then a(n) = (1/5)*(b(n) - c(n)).

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

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

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

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 5, 10, 9, 12, 11, 14, 14, 16, 5, 10, 13, 20, 13, 18, 20, 24, 11, 22, 20, 28, 22, 28, 28, 32, 5, 10, 13, 20, 17, 26, 28, 40, 13, 26, 26, 36, 28, 40, 40, 48, 11, 22, 28, 44, 28, 40, 44, 56, 22, 44, 40, 56, 44, 56, 56, 64, 5, 10, 13, 20, 17, 26, 28, 40, 17, 34, 34, 52, 36, 56, 56, 80, 13
Offset: 0

Views

Author

N. J. A. Sloane, Apr 23 2025

Keywords

Crossrefs

Programs

  • Python
    def A382725(n):
        n1 = n>>1
        n2 = n1>>1
        np = ~n
        n100 = (n2&(~n1)&np).bit_count()
        n110 = (n2&n1&np).bit_count()
        n10 = (n1&np).bit_count()
        return ((n100+1<<3)+(n110<<1)+n10*(n10+3))<>3 # Chai Wah Wu, Aug 10 2025

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

Original entry on oeis.org

1, 3, 6, 10, 15, 21, 28, 36, 41, 51, 60, 72, 83, 97, 111, 127, 132, 142, 155, 175, 188, 206, 226, 250, 261, 283, 303, 331, 353, 381, 409, 441, 446, 456, 469, 489, 506, 532, 560, 600, 613, 639, 665, 701, 729, 769, 809, 857, 868, 890, 918, 962, 990, 1030, 1074, 1130, 1152, 1196, 1236, 1292, 1336, 1392, 1448, 1512, 1517, 1527
Offset: 0

Views

Author

N. J. A. Sloane, Apr 23 2025

Keywords

Crossrefs

Programs

  • Python
    def A382731(n):
        c = 0
        for m in range(n+1):
            n1 = m>>1
            n2 = n1>>1
            np = ~m
            n100 = (n2&(~n1)&np).bit_count()
            n110 = (n2&n1&np).bit_count()
            n10 = (n1&np).bit_count()
            c += ((n100+1<<3)+(n110<<1)+n10*(n10+3))<>3
        return c # Chai Wah Wu, Aug 10 2025

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

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 4, 8, 12, 9, 12, 15, 14, 16, 18, 7, 14, 21, 14, 19, 24, 21, 24, 27, 4, 8, 12, 12, 18, 24, 20, 28, 36, 9, 18, 27, 20, 28, 36, 31, 38, 45, 14, 28, 42, 28, 38, 48, 42, 48, 54, 7, 14, 21, 20, 31, 42, 33, 48, 63, 14, 28, 42, 31, 44, 57, 48
Offset: 0

Views

Author

Chai Wah Wu, Aug 10 2025

Keywords

Crossrefs

Programs

  • Python
    import re
    from gmpy2 import digits
    def A386952(n):
        s = digits(n,3)
        n1 = s.count('1')
        n2 = s.count('2')
        n01 = s.count('10')
        n02 = s.count('20')
        n11 = len(re.findall('(?=11)',s))
        n12 = s.count('21')
        return ((3*((1+n01<<2)+n11)+((n02<<2)+n12<<2))*3**n2<>2

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

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 9, 18, 15, 20, 17, 22, 21, 24, 21, 26, 25, 28, 27, 30, 30, 32, 9, 18, 23, 36, 21, 30, 33, 40, 25, 34, 35, 44, 37, 42, 44, 48, 21, 42, 37, 52, 37, 50, 48, 56, 43, 54, 52, 60, 54, 60, 60, 64, 9, 18, 23, 36, 29
Offset: 0

Views

Author

Chai Wah Wu, Aug 15 2025

Keywords

Crossrefs

Programs

  • Python
    def A387050(n):
        n1 = n>>1
        n2 = n1>>1
        n3 = n2>>1
        np = ~n
        n10, n100, n110 = (k1:=n1&np).bit_count(), (k2:=(k1>>1)&np).bit_count(), (k3:=n2&k1).bit_count()
        n1100, n1000, n1010, n1110 = (n3&k2).bit_count(), ((k2>>1)&np).bit_count(), ((k1>>2)&k1).bit_count(), (n3&k3).bit_count()
        return n10*(n10*(n10+3)+6*((n100<<2)+n110)+20)//6+((n1000<<2)+n100+n1010+n1100<<2)+n110+n1110+8<>3

A254609 Triangle read by rows: T(n,k) = A243757(n)/(A243757(k)*A243757(n-k)).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 5, 5, 5, 1, 1, 1, 5, 5, 5, 1, 1, 1, 1, 1, 5, 5, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 5, 5, 5, 1, 5, 5, 5, 5, 1, 1, 1, 5, 5, 5, 1, 1, 5, 5, 5, 1, 1, 1, 1, 1, 5, 5, 1, 1, 1, 5, 5
Offset: 0

Views

Author

Tom Edgar, Feb 02 2015

Keywords

Comments

These are the generalized binomial coefficients associated with A060904.
The exponent of T(n,k) is the number of 'carries' that occur when adding k and n-k in base 5 using the traditional addition algorithm.
If T(n,k) != 0 mod 5, then n dominates k in base 5.
A194459(n) = number of ones in row n. - Reinhard Zumkeller, Feb 04 2015

Examples

			The first five terms in A060904 are 1, 1, 1, 1, and 5 and so T(4,2) = 1*1*1*1/((1*1)*(1*1))=1 and T(5,3) = 5*1*1*1*1/((1*1*1)*(1*1))=5.
The triangle begins:
1
1, 1
1, 1, 1
1, 1, 1, 1
1, 1, 1, 1, 1
1, 5, 5, 5, 5, 1
1, 1, 5, 5, 5, 1, 1
1, 1, 1, 5, 5, 1, 1, 1
1, 1, 1, 1, 5, 1, 1, 1, 1
1, 1, 1, 1, 1, 1, 1, 1, 1, 1
1, 5, 5, 5, 5, 1, 5, 5, 5, 5, 1
1, 1, 5, 5, 5, 1, 1, 5, 5, 5, 1, 1
1, 1, 1, 5, 5, 1, 1, 1, 5, 5, 1, 1, 1
1, 1, 1, 1, 5, 1, 1, 1, 1, 5, 1, 1, 1, 1
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
		

Crossrefs

Programs

  • Haskell
    import Data.List (inits)
    a254609 n k = a254609_tabl !! n !! k
    a254609_row n = a254609_tabl !! n
    a254609_tabl = zipWith (map . div)
       a243757_list $ zipWith (zipWith (*)) xss $ map reverse xss
       where xss = tail $ inits a243757_list
    -- Reinhard Zumkeller, Feb 04 2015

Formula

T(n,k) = A243757(n)/(A243757(k)*A243757(n-k)).
T(n,k) = Product_{i=1..n} A060904(i)/(Product_{i=1..k} A060904(i)*Product_{i=1..n-k} A060904(i)).
T(n,k) = A060904(n)/n*(k/A060904(k)*T(n-1,k-1)+(n-k)/A060904(n-k)*T(n-1,k)).

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

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 66, 7, 14, 21, 28, 35, 42, 49, 56, 63, 70, 77, 8, 16, 24, 32
Offset: 0

Views

Author

N. J. A. Sloane, Apr 23 2025

Keywords

Crossrefs

Programs

  • Python
    from math import prod
    from gmpy2 import digits
    def A382721(n): return prod(int(d,11)+1 for d in digits(n,11)) # Chai Wah Wu, Aug 10 2025

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

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 66, 72, 78, 7, 14, 21
Offset: 0

Views

Author

N. J. A. Sloane, Apr 23 2025

Keywords

Crossrefs

Programs

  • Python
    from math import prod
    from gmpy2 import digits
    def A382722(n): return prod(int(d,13)+1 for d in digits(n,13)) # Chai Wah Wu, Aug 10 2025
Showing 1-10 of 23 results. Next