OFFSET
0,2
LINKS
Eric Rowland, The number of nonzero binomial coefficients modulo p^alpha, arXiv:1001.1783 [math.NT]
PROG
(Python)
import re
from gmpy2 import digits
def A387108(n):
s = digits(n, 5)
n1, n2, n3, n4 = s.count('1'), s.count('2'), s.count('3'), s.count('4')
n10, n12, n13, n42, n43, n11 = s.count('10'), s.count('12'), s.count('13'), s.count('42'), s.count('43'), len(re.findall('(?=11)', s))
n20, n21, n23, n30, n22 = s.count('20'), s.count('21'), s.count('23'), s.count('30'), len(re.findall('(?=22)', s))
n31, n32, n40, n41, n33 = s.count('31'), s.count('32'), s.count('40'), s.count('41'), len(re.findall('(?=33)', s))
return ((1440*n10+540*n11+240*n12+90*n13+1920*n20+720*(n21+1)+320*n22+120*n23+2160*n30+810*n31+360*n32+135*n33+2304*n40+864*n41+384*n42+144*n43)*3**n2*5**n4<<(n1+(n3<<1)))//45>>4
CROSSREFS
KEYWORD
nonn
AUTHOR
Chai Wah Wu, Aug 16 2025
STATUS
approved
