OFFSET
0,3
COMMENTS
This sequence is (3^n + 1) divided by the highest possible power of 2, which is 4 for odd n and 2 for even n. It is never divisible by 8 or any higher power of 2, which implies Levi ben Gerson's observation that (3^n + 1 = 2^k) has no solution for n > 1. Cf. the comments and links to A235365. - Joe Slater, Apr 02 2017
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,10,0,-9)
FORMULA
a(n) = 10*a(n-2) - 9*a(n-4).
G.f.: (1 + x - 5*x^2 - 3*x^3)/((1+x)*(1-x)*(1+3*x)*(1-3*x)).
a(n) = numerator((1/4)^n + (3/4)^n), n > 0.
MAPLE
a:=n->(3^n+1)/(3-(-1)^n): seq(a(n), n=0..27); # Muniru A Asiru, Mar 05 2018
MATHEMATICA
CoefficientList[Series[(1+x-5x^2-3x^3)/((1+x)(1-x)(1+3x)(1-3x)), {x, 0, 30}], x] (* or *) LinearRecurrence[{0, 10, 0, -9}, {1, 1, 5, 7}, 30] (* Harvey P. Dale, Apr 25 2011 *)
PROG
(PARI) a(n) = (3^n+1)/(3-(-1)^n); \\ Altug Alkan, Mar 05 2018
(GAP) List([0..27], n->(3^n+1)/(3-(-1)^n)); # Muniru A Asiru, Mar 05 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jaume Oliver Lafont, Oct 30 2009
STATUS
approved