OFFSET
0,2
LINKS
FORMULA
a(2*n) = A048473(n); a(2n+1) = a(2n)+2.
For n > 0, a(2*n) = 3*a(2*n-1) - 4; a(2*n+1) = a(2*n) + 2 = A052919(n+1).
From Bruno Berselli, Jan 28 2011: (Start)
G.f.: (1+4*x+5*x^2)/((1+x)*(1-3*x^2)).
a(n) = -a(n-1) + 3*a(n-2) + 3*a(n-3) for n > 2.
a(n) = 2*3^((2*n + (-1)^n - 1)/4) - (-1)^n. (End)
EXAMPLE
Partial sums of 1;3;5 are 1;3;4;5;6;8;9 and 7 is the least missing odd integer, hence the next term is 7.
MATHEMATICA
Table[ -1+ 2 3^Floor[k/2]+2 Mod[k, 2], {k, 0, 36}]
LinearRecurrence[{-1, 3, 3}, {1, 3, 5}, 40] (* Harvey P. Dale, Jul 14 2018 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wouter Meeussen, Jun 26 2001
EXTENSIONS
Edited by Michel Marcus, Mar 16 2024
STATUS
approved