login
A382725
Number of entries in the n-th row of Pascal's triangle not divisible by 8.
8
1, 2, 3, 4, 5, 6, 7, 8, 5, 10, 9, 12, 11, 14, 14, 16, 5, 10, 13, 20, 13, 18, 20, 24, 11, 22, 20, 28, 22, 28, 28, 32, 5, 10, 13, 20, 17, 26, 28, 40, 13, 26, 26, 36, 28, 40, 40, 48, 11, 22, 28, 44, 28, 40, 44, 56, 22, 44, 40, 56, 44, 56, 56, 64, 5, 10, 13, 20, 17, 26, 28, 40, 17, 34, 34, 52, 36, 56, 56, 80, 13
OFFSET
0,2
LINKS
James G. Huard, Blair K. Spearman, and Kenneth S. Williams, Pascal's triangle (mod 8), European Journal of Combinatorics 19:1 (1998), pp. 45-62.
MAPLE
Res:= 1, 2: P:= [1, 1]:
for n from 2 to 100 do
P:= [1, op(P[2..-1]+P[1..-2] mod 8), 1];
Res:= Res, n +1 - numboccur(0, P)
od:
Res; # Robert Israel, Mar 15 2026
PROG
(Python)
def A382725(n):
n1 = n>>1
n2 = n1>>1
np = ~n
n100 = (n2&(~n1)&np).bit_count()
n110 = (n2&n1&np).bit_count()
n10 = (n1&np).bit_count()
return ((n100+1<<3)+(n110<<1)+n10*(n10+3))<<n.bit_count()>>3 # Chai Wah Wu, Aug 10 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Apr 23 2025
STATUS
approved