A386953 Total number of entries in rows 0,1,...,n of Pascal's triangle not divisible by 9.
1, 3, 6, 10, 15, 21, 28, 36, 45, 49, 57, 69, 78, 90, 105, 119, 135, 153, 160, 174, 195, 209, 228, 252, 273, 297, 324, 328, 336, 348, 360, 378, 402, 422, 450, 486, 495, 513, 540, 560, 588, 624, 655, 693, 738, 752, 780, 822, 850, 888, 936, 978, 1026, 1080, 1087
Offset: 0
Keywords
Links
- James G. Huard, Blair K. Spearman, and Kenneth S. Williams, Pascal's triangle (mod 9), Acta Arithmetica, 78 (1997), 331-349.
Programs
-
Python
import re from gmpy2 import digits def A386953(n): c = 0 for m in range(n+1): s = digits(m,3) n1 = s.count('1') n2 = s.count('2') n01 = s.count('10') n02 = s.count('20') n11 = len(re.findall('(?=11)',s)) n12 = s.count('21') c += ((3*((1+n01<<2)+n11)+((n02<<2)+n12<<2))*3**n2<
>2 return c