OFFSET
1,2
LINKS
T. D. Noe, Table of n, a(n) for n=1..1000
J. M. Dover, On two OEIS conjectures, arXiv:1606.08033 [math.CO], 2016.
FORMULA
n + sum(k=2, n, A022907(n)).
a(n+1) = 1+3*Sum_{k=1..n} A033485(k). - Philippe Deléham, Jun 17 2010
a(n) = a(n-1) + 1 + a(floor(n/2)) + a(ceiling(n/2))) for n>1, a(1) = 1. - Alois P. Heinz, Sep 17 2013
a(n+1) = (3*A033485(2n+1)-1)/2. - Chai Wah Wu, Jun 08 2022
MAPLE
a:= proc(n) option remember; `if`(n=1, 1,
a(n-1)+1+a(floor(n/2))+a(ceil(n/2)))
end:
seq(a(n), n=1..100); # Alois P. Heinz, Sep 17 2013
MATHEMATICA
a[n_] := a[n] = If[n==1, 1, a[n-1]+1+a[Floor[n/2]]+a[Ceiling[n/2]]]; Array[a, 100] (* Jean-François Alcover, Aug 07 2017, after Alois P. Heinz *)
PROG
(Python)
from itertools import islice
from collections import deque
def A022905_gen(): # generator of terms
aqueue, f, b, a = deque([2]), True, 1, 2
yield 1
while True:
a += b
aqueue.append(a)
if f:
yield (3*a-1)//2
b = aqueue.popleft()
f = not f
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved