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 A051638 #27 Jul 12 2025 08:39:44 %S A051638 1,2,4,2,4,8,4,8,13,2,4,8,4,8,16,8,16,26,4,8,13,8,16,26,13,26,40,2,4, %T A051638 8,4,8,16,8,16,26,4,8,16,8,16,32,16,32,52,8,16,26,16,32,52,26,52,80,4, %U A051638 8,13,8,16,26,13,26,40,8,16,26,16,32,52,26,52,80,13 %N A051638 a(n) = Sum_{k=0..n} (C(n,k) mod 3). %C A051638 Row sums of the triangle in A083093. - _Reinhard Zumkeller_, Jul 11 2013 %H A051638 Reinhard Zumkeller, <a href="/A051638/b051638.txt">Table of n, a(n) for n = 0..6561=3^8</a> %H A051638 Michael Gilleland, <a href="/selfsimilar.html">Some Self-Similar Integer Sequences</a> %H A051638 A. Granville, <a href="http://www.dms.umontreal.ca/~andrew/Binomial/intro.html">Binomials modulo a prime</a> %F A051638 Write n in base 3; if the representation contains r 1's and s 2's then a(n) = 2^{r-1} * (3^(s+1) - 1) = 1/2 * (3*A006047(n) - 2^(A062756(n))). - _Robin Chapman_, Ahmed Fares (ahmedfares(AT)my-deja.com) and others, Jul 16 2001 %F A051638 a(3n) = a(n), a(3n+1) = 2a(n), a(9n+2) = a(3n+2), a(9n+5) = 2a(3n+2), a(9n+8) = 4a(3n+2) - 3a(n). - _David Radcliffe_, Jun 25 2025 %t A051638 Table[2^(DigitCount[n,3,1]-1) (3^(DigitCount[n,3,2]+1)-1),{n,0,80}] (* _Harvey P. Dale_, Jun 20 2019 *) %o A051638 (Haskell) %o A051638 a051638 = sum . a083093_row -- _Reinhard Zumkeller_, Jul 11 2013 %o A051638 (Python) %o A051638 from gmpy2 import digits %o A051638 def A051638(n): return 3*3**(s:=digits(n,3)).count('2')-1<<s.count('1')>>1 # _Chai Wah Wu_, Jun 25 2025 %Y A051638 Cf. A001316. %K A051638 nonn,easy %O A051638 0,2 %A A051638 _N. J. A. Sloane_