OFFSET
0,2
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
FORMULA
G.f.: (1/(1 - x)) * (-1 + 2 * Product_{k>=0} 1/(1 - x^(2^k))).
a(n) = n + 1 + Sum_{k=1..n} a(floor(k/2)).
a(n) = 2 * A000123(n) - 1.
a(n) = 4 * A033485(n) - 1 for n > 0. - Hugo Pfoertner, Aug 12 2021
From Michael Tulskikh, Aug 12 2021: (Start)
2*a(2n) = a(2n-1) + a(2n+1).
a(2n) = a(2n-2) + a(n-1) + a(n) + 2.
a(2n) = 2*(Sum_{i=0..n} a(i)) - a(n) + 2n. (End)
MAPLE
f:= proc(n) option remember; procname(n-1) + procname(floor(n/2)) + 1 end proc;
f(0):= 1:
map(f, [$1..50]); # Robert Israel, May 04 2025
MATHEMATICA
a[0] = 1; a[n_] := a[n] = a[n - 1] + a[Floor[n/2]] + 1; Table[a[n], {n, 0, 47}]
nmax = 47; CoefficientList[Series[(1/(1 - x)) (-1 + 2 Product[1/(1 - x^(2^k)), {k, 0, Floor[Log[2, nmax]]}]), {x, 0, nmax}], x]
PROG
(Python)
from itertools import islice
from collections import deque
def A346912_gen(): # generator of terms
aqueue, f, b, a = deque([2]), True, 1, 2
yield from (1, 3, 7)
while True:
a += b
yield 4*a - 1
aqueue.append(a)
if f: b = aqueue.popleft()
f = not f
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Aug 11 2021
STATUS
approved
