OFFSET
0,4
LINKS
Ivan Neretin, Table of n, a(n) for n = 0..10000
FORMULA
G.f. A(x) satisfies: A(x) = x * (1 + (1 + x)*A(x^2))/(1 - x). - Ilya Gutkovskiy, May 04 2019
EXAMPLE
a(6) = a(5)+a(2) = 4+1 = 5.
a(7) = a(6)+a(3) = 5+2 = 7.
MATHEMATICA
Join[{0}, Nest[Append[#, #[[-1]] + #[[Quotient[Length@#, 2]]]] &, {1, 1}, 53]] (* Ivan Neretin, Mar 03 2016 *)
PROG
(Magma) [n le 2 select n-1 else Self(n-1)+Self(Floor(n/2)): n in [1..60]]; // Vincenzo Librandi, Mar 03 2016
(Python)
from itertools import islice
from collections import deque
def A062188_gen(): # generator of terms
aqueue, f, b, a = deque([1]), True, 0, 1
yield from (0, 1)
while True:
a += b
yield a
aqueue.append(a)
if f: b = aqueue.popleft()
f = not f
CROSSREFS
KEYWORD
nonn
AUTHOR
Henry Bottomley, Jun 13 2001
STATUS
approved