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.

A385741 a(n) = Sum_{k=0..n} (binomial(n, k) mod 9).

Original entry on oeis.org

1, 2, 4, 8, 16, 14, 28, 38, 31, 8, 16, 32, 28, 56, 49, 62, 52, 68, 28, 56, 76, 62, 79, 122, 91, 92, 112, 8, 16, 32, 28, 56, 76, 80, 124, 140, 28, 56, 103, 80, 142, 158, 145, 146, 184, 62, 124, 158, 100, 146, 184, 188, 232, 230, 28, 56, 76, 80, 151, 158, 136, 236
Offset: 0

Views

Author

Chai Wah Wu, Jul 09 2025

Keywords

Comments

Sum of n-th row of Pascal's triangle mod 9, A095143.

Crossrefs

Programs

  • Mathematica
    a[n_]:=Sum[Mod[Binomial[n,k],9],{k,0,n}];Table[a[n],{n,0,61}] (* James C. McMahon, Jul 10 2025 *)
  • PARI
    a(n) = sum(k=0, n, binomial(n, k) % 9); \\ Michel Marcus, Jul 10 2025
  • Python
    from gmpy2 import digits
    import re, sympy
    from sympy import S, I, sqrt, simplify, Rational
    def A385741(n):
        s = digits(n,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')
        n121 = len(re.findall('(?=121)',s))
        n122 = s.count('221')
        n21 = s.count('12')
        n22 = len(re.findall('(?=22)',s))
        x1 = (3*(3**n2*(12*n01+(n02<<4)+3*n11+(n12<<2))-(n01+n12<<2)+(n02<<4)+n11)<>3
        beta = S.Half*(I*sqrt(3)-1)
        def ind2(t): return (0,0,1,0,2,5,0,4,3)[t]
        def X(t): return beta**(ind2(t)-n11-n12+n121-n122)*(2-beta)**(n21-n121)*(3+beta)**(n2-n12-n21-n22+n121+n122)
        def Y(t): return beta**(n11-ind2(t))*(1-beta)**(n21-n121)*(2+beta)**(n2-n21-n22)*(1+2*beta)**n121
        def f(t): return ((3**n2<