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.

Showing 1-5 of 5 results.

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<
    				

A385825 a(n) = Sum_{k=0..n} (binomial(n, k) mod 5).

Original entry on oeis.org

1, 2, 4, 8, 11, 2, 4, 8, 16, 22, 4, 8, 16, 22, 34, 8, 16, 22, 44, 48, 11, 22, 34, 48, 61, 2, 4, 8, 16, 22, 4, 8, 16, 32, 44, 8, 16, 32, 44, 68, 16, 32, 44, 88, 96, 22, 44, 68, 96, 122, 4, 8, 16, 22, 34, 8, 16, 32, 44, 68, 16, 32, 59, 68, 106, 22, 44, 68, 116, 142
Offset: 0

Views

Author

Chai Wah Wu, Jul 09 2025

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_]:=Sum[Mod[Binomial[n,k],5],{k,0,n}];Array[a,60,0] (* James C. McMahon, Jul 10 2025 *)
  • Python
    from gmpy2 import digits
    from sympy.abc import x
    from sympy import Poly, rem
    def A385825(n):
        k = (1,2,4,3)
        s = digits(n,5)
        t = [s.count(str(i)) for i in range(1,5)]
        G = 2**t[0]*(x+2)**t[1]*(2*x**2+3)**t[3]*(2*x**3+2)**t[2]
        c = Poly(rem(G,x**4-1),x).all_coeffs()[::-1]
        return int(sum(k[i]*c[i] for i in range(len(c)) if c[i]))

Formula

Row sums of A095140. - R. J. Mathar, Jul 19 2025

A385394 a(n) = (Sum_{k=0..n} (binomial(n, k) mod 8)) / 2^bitcount(n).

Original entry on oeis.org

1, 1, 2, 2, 8, 4, 8, 4, 8, 8, 6, 6, 10, 8, 5, 4, 8, 8, 10, 8, 12, 6, 11, 6, 10, 10, 11, 7, 9, 7, 7, 4, 8, 8, 10, 8, 16, 12, 15, 10, 12, 12, 9, 9, 13, 11, 10, 6, 10, 10, 13, 11, 15, 11, 11, 7, 9, 9, 10, 7, 11, 7, 7, 4, 8, 8, 10, 8, 16, 12, 15, 10, 16, 16, 15, 13
Offset: 0

Views

Author

Peter Luschny, Jun 27 2025

Keywords

Crossrefs

Programs

  • Maple
    a := n -> local j; add(modp(binomial(n, j), 8), j=0..n) / 2^add(convert(n, base, 2)): seq(a(n), n = 0..75);
  • Mathematica
    Table[Sum[Mod[Binomial[n, k], 8], {k, 0, n}]/2^DigitCount[n, 2, 1], {n, 0, 80}]
    (* Michael De Vlieger, Jun 27 2025 *)
    pca[L_] := DigitCount[BitAnd @@ L, 2, 1]
    A385394[n_] := Module[{s, n1, n2, n3, np, n1p, b100, b10, b110, b11, b1111, b101, b1100, m11, c},
    If[n == 0, Return[1]];
    n1 = BitShiftRight[n, 1]; n2 = BitShiftRight[n, 2]; n3 = BitShiftRight[n, 3];
    np = BitNot[n]; n1p = BitNot[n1];
    b1111 = pca[{n, n1, n2, n3}]; b11 = pca[{n, n1}]; b101 = pca[{n, n2, n1p}]; b100 = pca[{np, n2, n1p}]; b110 = pca[{n2, n1, np}]; b10 = pca[{n1, np}]; b1100 = pca[{n3, n2, n1p, np}];
    s = "0" <> IntegerString[n, 2]; m11  = StringCount[s, "0110"];
    c = BitShiftLeft[b100, 2] + b110 + BitShiftRight[b10 (b10 - 1), 1];
    c += Switch[b11,
      0, b10 + BitShiftLeft[b100, 1],
      1, BitShiftLeft[b10 - b1100, 1] + b110,
      _, BitShiftLeft[b10, 1] ];
    c += Which[
      b1111 == 0 && b11 == 0 && b101 == 0, 1,
      b1111 == 0 && b11 == 0 && b101 != 0, 3,
      StringEndsQ[s, "0111"], 4,
      b1111 == 0 && b101 == 0 && m11 == 0 && b11 != 0, 2,
      True, 4]; c]
    Array[A385394, 76, 0]  (* After Chai Wah Wu, Peter Luschny, Jun 29 2025 *)
  • PARI
    a(n) = sum(k=0, n, binomial(n, k) % 8) / 2^hammingweight(n); \\ Michel Marcus, Jun 28 2025
    
  • Python
    def A385394(n):
        if n==0: return 1
        s = '0'+bin(n)[2:]
        n1 = n>>1
        n2 = n1>>1
        n3 = n2>>1
        np = ~n
        n1p = ~n1
        n1111 = (n3&n2&n1&n).bit_count()
        n11 = (n1&n).bit_count()
        n101 = (n2&n1p&n).bit_count()
        n100 = (n2&n1p&np).bit_count()
        n110 = (n2&n1&np).bit_count()
        n10 = (n1&np).bit_count()
        n1100 = (n3&n2&n1p&np).bit_count()
        m11 = s.count('0110')
        m111 = s.endswith('0111')
        c = (n100<<2)+n110+(n10*(n10-1)>>1)
        if n11==0:
            c += n10+(n100<<1)
        elif n11==1:
            c += (n10-n1100<<1)+n110
        else:
            c += n10<<1
        if not (n1111 or n11 or n101):
            c += 1
        elif not (n1111 or n11) and n101:
            c += 3
        elif m111:
            c += 4
        elif not (n1111 or n101 or m11) and n11:
            c += 2
        else:
            c += 4
        return c # Chai Wah Wu, Jun 28 2025

Formula

a(n) = A385285(n) / 2^A000120(n).
a(n) = A385285(n) / A001316(n).

A385826 a(n) = Sum_{k=0..n} (binomial(n, k) mod 7).

Original entry on oeis.org

1, 2, 4, 8, 16, 18, 22, 2, 4, 8, 16, 32, 36, 44, 4, 8, 16, 32, 43, 58, 67, 8, 16, 32, 36, 72, 60, 92, 16, 32, 43, 72, 81, 120, 121, 18, 36, 58, 60, 120, 100, 144, 22, 44, 67, 92, 121, 144, 169, 2, 4, 8, 16, 32, 36, 44, 4, 8, 16, 32, 64, 72, 88, 8, 16, 32, 64, 86
Offset: 0

Views

Author

Chai Wah Wu, Jul 09 2025

Keywords

Comments

Sum of n-th row of Pascal's triangle mod 7, A095142.

Crossrefs

Programs

  • Python
    from gmpy2 import digits
    from sympy.abc import x
    from sympy import Poly, rem
    def A385826(n):
        k = (1,3,2,6,4,5)
        s = digits(n,7)
        t = [s.count(str(i)) for i in range(1,7)]
        G = 2**t[0]*(2*x+2)**t[2]*(x**2+2)**t[1]*(3*x**3+4)**t[5]*(2*x**4+x**3+2)**t[3]*(2*x**5+2*x+2)**t[4]
        c = Poly(rem(G,x**6-1),x).all_coeffs()[::-1]
        return int(sum(k[i]*c[i] for i in range(len(c)) if c[i]))

A385828 a(n) = Sum_{k=0..n} (binomial(n, k) mod 11).

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 31, 40, 36, 50, 56, 2, 4, 8, 16, 32, 64, 62, 80, 72, 100, 112, 4, 8, 16, 32, 53, 106, 91, 116, 100, 156, 169, 8, 16, 32, 64, 62, 124, 116, 188, 134, 224, 228, 16, 32, 53, 62, 91, 182, 144, 222, 202, 272, 291, 32, 64, 106, 124, 182, 188, 244
Offset: 0

Views

Author

Chai Wah Wu, Jul 09 2025

Keywords

Comments

Sum of n-th row of Pascal's triangle mod 11, A095144.

Crossrefs

Programs

  • Python
    from gmpy2 import digits
    from sympy.abc import x
    from sympy import Poly, rem
    def A385828(n):
        s = digits(n,11)
        t = tuple(s.count(digits(i,11)) for i in range(1,11))
        G = 2**t[0]*(x+2)**t[1]*(5*x**5+6)**t[9]*(2*x**8+2)**t[2]*(2*x**5+2*x**4+2)**t[4]*(x**9+2*x**2+2)**t[3]*(2*x**7+2*x**5+2*x+2)**t[6]*(2*x**9+2*x**3+x**2+4)**t[7]*(2*x**9+x**6+2*x**2+2)**t[5]*(2*x**8+2*x**7+2*x**6+2*x**4+2)**t[8]
        c = Poly(rem(G,x**10-1),x).all_coeffs()[::-1]
        return int(sum(pow(2,i,11)*c[i] for i in range(len(c)) if c[i]))
Showing 1-5 of 5 results.