OFFSET
0,2
COMMENTS
Sum of n-th row of Pascal's triangle mod 7, A095142.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 0..10000
Richard Garfield and Herbert S. Wilf, The distribution of the binomial coefficients modulo p, Journal of Number Theory, 41 (1) (1992), 1-5.
PROG
(Python)
from gmpy2 import digits
from sympy.abc import x
from sympy import Poly, rem
def A385826(n):
k = (1, 3, 2, 6, 4, 5)
s = digits(n, 7)
t = [s.count(str(i)) for i in range(1, 7)]
G = 2**t[0]*(2*x+2)**t[2]*(x**2+2)**t[1]*(3*x**3+4)**t[5]*(2*x**4+x**3+2)**t[3]*(2*x**5+2*x+2)**t[4]
c = Poly(rem(G, x**6-1), x).all_coeffs()[::-1]
return int(sum(k[i]*c[i] for i in range(len(c)) if c[i]))
CROSSREFS
KEYWORD
nonn
AUTHOR
Chai Wah Wu, Jul 09 2025
STATUS
approved
