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.

This page as a plain text file.
%I A385859 #13 Jul 15 2025 08:27:28
%S A385859 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,
%T A385859 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,
%U A385859 42,84,132,6,12,21,12,24,42,21,42,66,12,24,42,24,48,84,42
%N A385859 a(n) = Sum_{k=0..n} (C(n,k) mod 3)^2.
%H A385859 Chai Wah Wu, <a href="/A385859/b385859.txt">Table of n, a(n) for n = 0..10000</a>
%F A385859 If n has k '1' digits and m '2' digits in base 3, then a(n) = 2^(k-1)*(5*3^m - 3).
%t A385859 a[n_]:=Sum[Mod[Binomial[n,k],3]^2,{k,0,n}]; Array[a,70,0] (* _Stefano Spezia_, Jul 10 2025 *)
%o A385859 (Python)
%o A385859 from gmpy2 import digits
%o A385859 def A385859(n): return 5*3**(s:=digits(n,3)).count('2')-3<<s.count('1')>>1
%Y A385859 Cf. A008459, A051638.
%K A385859 nonn
%O A385859 0,2
%A A385859 _Chai Wah Wu_, Jul 10 2025