A060547 a(n) = 2^(floor(n/3) + ((n mod 3) mod 2)).
2, 1, 2, 4, 2, 4, 8, 4, 8, 16, 8, 16, 32, 16, 32, 64, 32, 64, 128, 64, 128, 256, 128, 256, 512, 256, 512, 1024, 512, 1024, 2048, 1024, 2048, 4096, 2048, 4096, 8192, 4096, 8192, 16384, 8192, 16384, 32768, 16384, 32768, 65536, 32768, 65536, 131072
Offset: 1
Links
- Harry J. Smith, Table of n, a(n) for n = 1..500
- André Barbé, Symmetric patterns in the cellular automaton that generates Pascal's triangle modulo 2, Discr. Appl. Math. 105 (2000), 1-38.
- Index entries for sequences related to cellular automata.
- Index entries for linear recurrences with constant coefficients, signature (0, 0, 2).
Programs
-
Haskell
a060547 = (2 ^) . a008611 . (subtract 1) a060547_list = f [2,1,2] where f xs = xs ++ f (map (* 2) xs) -- Reinhard Zumkeller, Nov 25 2013
-
Maple
gf := (1+x^2+x^4)/(1-x^3)^2: s := series(gf, x, 100): for i from 0 to 70 do printf(`%d,`,2^coeff(s,x,i)) od: # Alternative: a := n -> 2^(iquo(n, 3) + irem(irem(n, 3), 2)); seq(a(n), n = 1..49); # Peter Luschny, Nov 26 2022
-
Mathematica
CoefficientList[ Series[ (2x^2+x+2) / (1-2x^3), {x, 0, 48}], x] (* Jean-François Alcover, Nov 18 2011 *)
-
PARI
a(n) = { 2^(floor(n/3) + (n % 3) % 2) } \\ Harry J. Smith, Jul 07 2009
-
Python
def a_gen(): a, b, c = 1, 2, 4 yield b while True: yield a a, b, c = b, c, a + a a = a_gen() print([next(a) for in range(51)]) # _Peter Luschny, Nov 26 2022
Formula
a(n) = 2^A008611(n-1) for n >= 1.
Sum_{n>=1} 1/a(n) = 4. - Amiram Eldar, Dec 10 2022
Extensions
More terms from James Sellers, Apr 04 2001
Name replaced with given formula by Peter Luschny, Nov 26 2022
Comments