OFFSET
1,2
COMMENTS
Conjecture: a(n) is the position of 2*n-1, for n >= 1, in the sequence S = A232895 of positive integers generated by these rules: 1 and 2 are in S; if x is in S then x + 2 and 2*x are in S, where duplicates are deleted as they occur.
LINKS
Clark Kimberling, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (3,-2,-1,1).
FORMULA
a(n) = 3*a(n-1) - 2*a(n-2) - a(n-3) + a(n-4), where a(1) = 1, a(2) = 3, a(3) = 5, a(4) = 8.
G.f.: x*(1-2*x^2)/((1-x)^2*(1-x-x^2)). - Vincenzo Librandi, Mar 18 2015
a(n) = -1 + (2^(-1-n)*(-(1-sqrt(5))^(1+n) + (1+sqrt(5))^(1+n))) / sqrt(5) + n. - Colin Barker, Mar 11 2017
a(n) = Sum_{k=1..n} A001611(k-1). - Ehren Metcalfe, Apr 15 2019
EXAMPLE
a(5) = 3*a(4) - 2*a(3) - a(4) + a(5) = 3*8 - 2*5 - 3 + 1 = 12.
MATHEMATICA
a[1] = 1; a[2] = 3; a[3] = 5; a[4] = 8; a[n_] := a[n] = 3*a[n - 1] - 2*a[n - 2] - a[n - 3] + a[n - 4]; t = Table[a[n], {n, 1, 100}]
CoefficientList[Series[(1 - 2 x^2) / ((1 - x)^2 (1 - x - x^2)), {x, 0, 40}], x] (* Vincenzo Librandi, Mar 18 2015 *)
LinearRecurrence[{3, -2, -1, 1}, {1, 3, 5, 8}, 39] (* Robert G. Wilson v, Jul 23 2018 *)
PROG
(Magma) I:=[1, 3, 5, 8]; [n le 4 select I[n] else 3*Self(n-1)-2*Self(n-2)-Self(n-3)+Self(n-4): n in [1..40]]; // Vincenzo Librandi, Mar 18 2015
(PARI) Vec(x*(1-2*x^2)/((1-x)^2*(1-x-x^2)) + O(x^50)) \\ Michel Marcus, Mar 18 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Dec 02 2013
STATUS
approved