OFFSET
2,1
COMMENTS
A198693 and A083420 interleaved. From 11 onwards, apparently A283651 and A290195 contain the same terms. - Bruno Berselli, May 07 2018
LINKS
Olivier Rozier, Parity sequences of the 3x+1 map on the 2-adic integers and Euclidean embedding, arXiv:1805.00133v1 [math.DS], 2018, see Definition 4.4 on p. 21.
Index entries for linear recurrences with constant coefficients, signature (1,4,-4).
FORMULA
a(n) = 2^(n-2) - 1 for odd n, otherwise a(n) = 3*2^(n-2) - 1, with n>1.
From Bruno Berselli, May 07 2018: (Start)
O.g.f.: x^2*(2 - x + 2*x^2)/((1 - x)*(1 - 2*x)*(1 + 2*x)).
E.g.f.: (1 + 2*x - 4*exp(x) + exp(-2*x) + 2*exp(2*x))/4.
a(n) = a(n-1) + 4*a(n-2) - 4*a(n-3).
a(n) = (2 + (-1)^n)*2^(n-2) - 1. (End)
MATHEMATICA
Table[If[OddQ[n], 2^(n - 2) - 1, 3 2^(n - 2) - 1], {n, 2, 80}]
LinearRecurrence[{1, 4, -4}, {2, 1, 11}, 30]
PROG
(Magma) [IsOdd(n) select 2^(n-2)-1 else 3*2^(n-2)-1: n in [2..40]];
(Magma) I:=[2, 1, 11]; [n le 3 select I[n] else Self(n-1)+4*Self(n-2)-4*Self(n-3): n in [1..35]];
(PARI) a(n) = a(n) = if (n%2, 2^(n-2) - 1, 3*2^(n-2) - 1); \\ Michel Marcus, May 30 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, May 07 2018
STATUS
approved