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.

A385859 a(n) = Sum_{k=0..n} (C(n,k) mod 3)^2.

Original entry on oeis.org

1, 2, 6, 2, 4, 12, 6, 12, 21, 2, 4, 12, 4, 8, 24, 12, 24, 42, 6, 12, 21, 12, 24, 42, 21, 42, 66, 2, 4, 12, 4, 8, 24, 12, 24, 42, 4, 8, 24, 8, 16, 48, 24, 48, 84, 12, 24, 42, 24, 48, 84, 42, 84, 132, 6, 12, 21, 12, 24, 42, 21, 42, 66, 12, 24, 42, 24, 48, 84, 42
Offset: 0

Views

Author

Chai Wah Wu, Jul 10 2025

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_]:=Sum[Mod[Binomial[n,k],3]^2,{k,0,n}]; Array[a,70,0] (* Stefano Spezia, Jul 10 2025 *)
  • Python
    from gmpy2 import digits
    def A385859(n): return 5*3**(s:=digits(n,3)).count('2')-3<>1

Formula

If n has k '1' digits and m '2' digits in base 3, then a(n) = 2^(k-1)*(5*3^m - 3).