OFFSET
1,2
COMMENTS
A000034 = 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, ... = continued fraction for (sqrt(3)+1)/2 (cf. A040001) = base 3 digital root of n+1. In general, the ascending descending base exponent transform of any simple periodic sequence can be written as a periodic set of interleaved sequences.
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (0,2,0,-1).
FORMULA
a(2*n) = 3*n; a(2*n+1) = 5*n+1.
From Colin Barker, Jun 16 2012: (Start)
a(n) = (-3+3*(-1)^n+8*n-2*(-1)^n*n)/4.
a(n) = 2*a(n-2)-a(n-4).
G.f.: x*(1+3*x+4*x^2)/((1-x)^2*(1+x)^2). (End)
E.g.f.: (1/2)*(3*(x-1)*sinh(x) + 5*x*cosh(x)). - G. C. Greubel, Mar 12 2017
EXAMPLE
a(1) = 1^1 = 1.
a(2) = 1^2 + 2^1 = 3.
a(3) = 1^1 + 2^2 + 1^1 = 6.
a(4) = 1^2 + 2^1 + 1^2 + 2^1 = 6.
a(5) = 1^1 + 2^2 + 1^1 + 2^2 + 1^1 = 11.
a(6) = 1^2 + 2^1 + 1^2 + 2^1 + 1^2 + 2^1 = 9.
MATHEMATICA
Table[(-3 + 3*(-1)^n + 8*n - 2*(-1)^n*n)/4, {n, 1, 50}] (* G. C. Greubel, Mar 12 2017 *)
PROG
(PARI) x='x +O('x^50); Vec(x*(1+3*x+4*x^2)/((1-x)^2*(1+x)^2)) \\ G. C. Greubel, Mar 12 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jonathan Vos Post, Jan 10 2006
EXTENSIONS
Definition improved by M. F. Hasler, Jan 13 2012
STATUS
approved