cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A387109 Number of entries in the n-th row of Pascal's triangle not divisible by 27.

This page as a plain text file.
%I A387109 #6 Aug 17 2025 11:17:25
%S A387109 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,
%T A387109 27,10,20,30,19,26,33,28,32,36,25,32,39,32,37,42,39,42,45,40,44,48,45,
%U A387109 48,51,50,52,54,19,38,57,34,47,60,49,56,63,40,53,66,51,60
%N A387109 Number of entries in the n-th row of Pascal's triangle not divisible by 27.
%H A387109 Eric Rowland, <a href="https://arxiv.org/abs/1001.1783">The number of nonzero binomial coefficients modulo p^alpha</a>, arXiv:1001.1783 [math.NT]
%o A387109 (Python)
%o A387109 import re
%o A387109 from gmpy2 import digits
%o A387109 def A387109(n):
%o A387109     s = digits(n,3)
%o A387109     n1, n2, n10, n20, n21, n11 = s.count('1'), s.count('2'), s.count('10'), s.count('20'), s.count('21'), len(re.findall('(?=11)',s))
%o A387109     n100, n110, n120, n101, n111, n121 = s.count('100'), s.count('110'), s.count('120'), len(re.findall('(?=101)',s)), len(re.findall('(?=111)',s)), len(re.findall('(?=121)',s))
%o A387109     n200, n201, n210, n211, n220, n221 = s.count('200'), s.count('201'), s.count('210'), s.count('211'), s.count('220'), s.count('221')
%o A387109     c = 144*n10+63*n11+128*(n20+n220)+80*n21+864*n100+216*(n101+n110)+54*n111+96*n120+24*n121+1152*n200+288*(n201+n210+1)+72*n211+32*n221
%o A387109     c += (m:=4*n10+n11)*(96*n20+24*n21+9*m)+16*(4*n20+n21)**2
%o A387109     return (c*3**n2<<n1)//9>>5
%Y A387109 Cf. A001316, A006047, A194459, A382720-A382725, A386952, A387050, A387051, A387108.
%K A387109 nonn
%O A387109 0,2
%A A387109 _Chai Wah Wu_, Aug 16 2025