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.
%I A387064 #47 Aug 22 2025 20:21:40 %S A387064 0,3,1,2,2,4,3,6,4,6,10,10,12,12,21,22,8,16,18,18,30,42,47,22,38,20, %T A387064 74,18,65,28,81,30,16,113,136,132,94,36,147,195,140,40,162,42,199,210, %U A387064 217,46,126,42,146,302,261,52,110,335,243,374,394,58,363,60,465,416 %N A387064 Total number of entries in rows 0 to n of Pascal's triangle multiple of n. %H A387064 Chai Wah Wu, <a href="/A387064/b387064.txt">Table of n, a(n) for n = 0..10000</a> %F A387064 a(p) = p-1, a(p^2) = p*(p-1) for p prime. Conjecture: a(p^k) = (p-1)*p^(k-1) for p prime. - _Chai Wah Wu_, Aug 21 2025 %e A387064 The first two rows of Pascal's triangle are [1] and [1, 1]. Since all elements are divisible by 1, a(1) equals the total number of such divisible terms: 1 + 2 = 3. %t A387064 a[n_] := Sum[Boole[Divisible[Binomial[k, i], n]], {k, 0, n}, {i, 0, k}]; a[0] = 0; Array[a, 100, 0] (* _Amiram Eldar_, Aug 17 2025 *) %o A387064 (PARI) a(n) = if (n, sum(r=0, n, sum(k=0, r, !(binomial(r,k) % n))), 0); \\ _Michel Marcus_, Aug 15 2025 %o A387064 (Python) %o A387064 from sympy import isprime, integer_nthroot %o A387064 def A387064(n): %o A387064 if isprime(n): return n-1 %o A387064 a, b = integer_nthroot(n,2) %o A387064 if b and isprime(a): return n-a %o A387064 r, c = [1], n==1 %o A387064 for m in range(n): %o A387064 s = [1] %o A387064 for i in range(m): %o A387064 s.append((r[i]+r[i+1])%n) %o A387064 c += s[-1]==0 %o A387064 r = s+[1] %o A387064 c += (n==1)<<1 %o A387064 return int(c) # _Chai Wah Wu_, Aug 21 2025 %Y A387064 Cf. A001316, A006046, A006047, A006048, A007318, A194458, A194459, A382720-A382731, A386953. %K A387064 nonn,new %O A387064 0,2 %A A387064 _Jean-Marc Rebert_, Aug 15 2025