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 21-23 of 23 results.

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

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

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 10, 20, 30, 19, 26, 33, 28, 32, 36, 25, 32, 39, 32, 37, 42, 39, 42, 45, 40, 44, 48, 45, 48, 51, 50, 52, 54, 19, 38, 57, 34, 47, 60, 49, 56, 63, 40, 53, 66, 51, 60
Offset: 0

Views

Author

Chai Wah Wu, Aug 16 2025

Keywords

Crossrefs

Programs

  • Python
    import re
    from gmpy2 import digits
    def A387109(n):
        s = digits(n,3)
        n1, n2, n10, n20, n21, n11 = s.count('1'), s.count('2'), s.count('10'), s.count('20'), s.count('21'), len(re.findall('(?=11)',s))
        n100, n110, n120, n101, n111, n121 = s.count('100'), s.count('110'), s.count('120'), len(re.findall('(?=101)',s)), len(re.findall('(?=111)',s)), len(re.findall('(?=121)',s))
        n200, n201, n210, n211, n220, n221 = s.count('200'), s.count('201'), s.count('210'), s.count('211'), s.count('220'), s.count('221')
        c = 144*n10+63*n11+128*(n20+n220)+80*n21+864*n100+216*(n101+n110)+54*n111+96*n120+24*n121+1152*n200+288*(n201+n210+1)+72*n211+32*n221
        c += (m:=4*n10+n11)*(96*n20+24*n21+9*m)+16*(4*n20+n21)**2
        return (c*3**n2<>5

A339146 a(n) = a(floor(n / 5)) * (n mod 5 + 1); initial terms are 1.

Original entry on oeis.org

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

Views

Author

Robert Dougherty-Bliss, Nov 25 2020

Keywords

Comments

If a(n) is arranged in a table with row lengths 5, then the first column is the transpose of the first row, followed the transpose of the second row, followed by the transpose of the third row, and so on. The remainder of each row (except the first) is an arithmetic progression whose start and step size equals the first entry of the row.
a(n) = O(n).
limsup_n a(n) = +oo.

Examples

			a(10) = a(2) * 1 = 1.
a(13) = a(2) * 4 = 4.
		

Crossrefs

Cf. A194459.
Cf. A048896 (with 2 instead of 5, but shifted).

Programs

  • PARI
    a(n) = if (n < 5, 1, a(n\5)*(n % 5 + 1)); \\ Michel Marcus, Nov 26 2020
  • Python
    def a(n):
        if n < 5:
            return 1
        q, r = divmod(n, 5)
        return a(q) * (r + 1)
    
Previous Showing 21-23 of 23 results.