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 10 results.

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

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

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

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

Original entry on oeis.org

1, 3, 6, 10, 15, 21, 28, 30, 34, 40, 48, 58, 70, 84, 87, 93, 102, 114, 129, 147, 168, 172, 180, 192, 208, 228, 252, 280, 285, 295, 310, 330, 355, 385, 420, 426, 438, 456, 480, 510, 546, 588, 595, 609, 630, 658, 693, 735, 784, 786, 790, 796, 804, 814, 826, 840, 844, 852, 864, 880, 900, 924, 952, 958, 970, 988, 1012, 1042, 1078
Offset: 0

Views

Author

N. J. A. Sloane, Apr 23 2025

Keywords

Comments

Partial sums of A382720. - James C. McMahon, Aug 15 2025

Crossrefs

Programs

  • Mathematica
    a[n_]:=(n^2+3n+2)/2-Count[Mod[Flatten[Table[Binomial[m, k], {m, 0,n}, {k, 0,m}]] ,7],0];Array[a,69,0] (* James C. McMahon, Aug 15 2025 *)
  • Python
    from math import prod
    from gmpy2 import digits
    def A382726(n): return sum(prod(int(d)+1 for d in digits(m,7)) for m in range(n+1)) # Chai Wah Wu, Aug 10 2025
    
  • Python
    from math import prod
    from gmpy2 import digits
    def A382726(n):
        d = list(map(lambda x:int(x)+1,digits(n+1,7)[::-1]))
        return sum((b-1)*prod(d[a:])*28**a for a, b in enumerate(d))>>1 # Chai Wah Wu, Aug 13 2025

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

Original entry on oeis.org

1, 3, 6, 10, 14, 20, 25, 33, 42, 46, 52, 60, 66, 76, 90, 106, 118, 136, 141, 151, 162, 174, 190, 212, 223, 243, 270, 286, 296, 314, 332, 364, 376, 384, 398, 416, 422, 434, 450, 470, 488, 514, 532, 562, 598, 616, 640, 678, 692, 720, 758, 786, 824, 878, 895, 929, 944, 964, 990, 1030, 1053, 1095, 1140, 1204, 1216, 1234, 1248, 1274
Offset: 0

Views

Author

N. J. A. Sloane, Apr 23 2025

Keywords

Crossrefs

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

Original entry on oeis.org

1, 3, 6, 10, 15, 21, 28, 36, 45, 49, 57, 69, 78, 90, 105, 119, 135, 153, 160, 174, 195, 209, 228, 252, 273, 297, 324, 328, 336, 348, 360, 378, 402, 422, 450, 486, 495, 513, 540, 560, 588, 624, 655, 693, 738, 752, 780, 822, 850, 888, 936, 978, 1026, 1080, 1087
Offset: 0

Views

Author

Chai Wah Wu, Aug 10 2025

Keywords

Crossrefs

Programs

  • Python
    import re
    from gmpy2 import digits
    def A386953(n):
        c = 0
        for m in range(n+1):
            s = digits(m,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')
            c += ((3*((1+n01<<2)+n11)+((n02<<2)+n12<<2))*3**n2<>2
        return c

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

Original entry on oeis.org

1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 68, 72, 78, 86, 96, 108, 122, 138, 156, 176, 198, 201, 207, 216, 228, 243, 261, 282, 306, 333, 363, 396, 400, 408, 420, 436, 456, 480, 508, 540, 576, 616, 660, 665, 675, 690, 710, 735, 765, 800, 840, 885, 935, 990, 996, 1008, 1026, 1050, 1080, 1116, 1158, 1206, 1260, 1320, 1386, 1393, 1407
Offset: 0

Views

Author

N. J. A. Sloane, Apr 23 2025

Keywords

Crossrefs

Programs

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

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

Original entry on oeis.org

1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 93, 97, 103, 111, 121, 133, 147, 163, 181, 201, 223, 247, 273, 276, 282, 291, 303, 318, 336, 357, 381, 408, 438, 471, 507, 546, 550, 558, 570, 586, 606, 630, 658, 690, 726, 766, 810, 858, 910, 915, 925, 940, 960, 985, 1015, 1050, 1090, 1135, 1185, 1240, 1300, 1365, 1371, 1383, 1401
Offset: 0

Views

Author

N. J. A. Sloane, Apr 23 2025

Keywords

Crossrefs

Programs

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

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

Original entry on oeis.org

1, 3, 6, 10, 13, 19, 25, 33, 36, 42, 50, 62, 68, 80, 92, 108, 111, 117, 125, 137, 145, 161, 177, 201, 207, 219, 235, 259, 271, 295, 319, 351, 354, 360, 368, 380, 388, 404, 420, 444, 452, 468, 488, 520, 536, 568, 600, 648, 654, 666, 682, 706, 722, 754, 786, 834, 846, 870, 902, 950, 974, 1022, 1070, 1134, 1137, 1143, 1151
Offset: 0

Views

Author

N. J. A. Sloane, Apr 23 2025

Keywords

Crossrefs

Programs

  • Python
    def A382729(n): return 1+sum(bin(m)[2:].count('10')+2<Chai Wah Wu, Aug 10 2025

A387064 Total number of entries in rows 0 to n of Pascal's triangle multiple of n.

Original entry on oeis.org

0, 3, 1, 2, 2, 4, 3, 6, 4, 6, 10, 10, 12, 12, 21, 22, 8, 16, 18, 18, 30, 42, 47, 22, 38, 20, 74, 18, 65, 28, 81, 30, 16, 113, 136, 132, 94, 36, 147, 195, 140, 40, 162, 42, 199, 210, 217, 46, 126, 42, 146, 302, 261, 52, 110, 335, 243, 374, 394, 58, 363, 60, 465, 416
Offset: 0

Views

Author

Jean-Marc Rebert, Aug 15 2025

Keywords

Examples

			The first two rows of Pascal's triangle are [1] and [1, 1]. Since all elements are divisible by 1, a(1) equals the total number of such divisible terms: 1 + 2 = 3.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[Boole[Divisible[Binomial[k, i], n]], {k, 0, n}, {i, 0, k}]; a[0] = 0; Array[a, 100, 0] (* Amiram Eldar, Aug 17 2025 *)
  • PARI
    a(n) = if (n, sum(r=0, n, sum(k=0, r, !(binomial(r,k) % n))), 0); \\ Michel Marcus, Aug 15 2025
    
  • Python
    from sympy import isprime, integer_nthroot
    def A387064(n):
        if isprime(n): return n-1
        a, b = integer_nthroot(n,2)
        if b and isprime(a): return n-a
        r, c = [1], n==1
        for m in range(n):
            s = [1]
            for i in range(m):
                s.append((r[i]+r[i+1])%n)
                c += s[-1]==0
            r = s+[1]
            c += (n==1)<<1
        return int(c) # Chai Wah Wu, Aug 21 2025

Formula

a(p) = p-1, a(p^2) = p*(p-1) for p prime. Conjecture: a(p^k) = (p-1)*p^(k-1) for p prime. - Chai Wah Wu, Aug 21 2025
Showing 1-10 of 10 results.