login
A387064
Total number of entries in rows 0 to n of Pascal's triangle multiple of n.
1
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,2
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
EXAMPLE
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.
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 *)
PROG
(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
KEYWORD
nonn
AUTHOR
Jean-Marc Rebert, Aug 15 2025
STATUS
approved