OFFSET
1,2
COMMENTS
Bisection of A147596.
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (5,-4).
FORMULA
From R. J. Mathar, Feb 05 2010: (Start)
a(n) = 5*a(n-1) - 4*a(n-2) for n>5.
G.f.: x*(2*x+1)*(2*x-1)*(4*x^2+2*x+1)/((4*x-1)*(1-x)). (End)
a(n) = 7*4^(n-2) + 7 for n>3. - Colin Barker, Nov 25 2016
E.g.f.: (7/16)*(16*exp(x) + exp(4*x)) -(119/16) -31*x/4 -7*x^2/2 -2*x^3/3. - G. C. Greubel, Oct 25 2022
MATHEMATICA
Table[FromDigits[#, 2] &@ If[n < 4, ConstantArray[1, 2 n - 1], Join[#, ConstantArray[0, 2 n - 7], #]] &@ ConstantArray[1, 3], {n, 25}] (* or *)
Rest@ CoefficientList[Series[x (2 x + 1) (2 x - 1) (4 x^2 + 2 x + 1)/((4 x - 1) (1 - x)), {x, 0, 25}], x] (* Michael De Vlieger, Nov 25 2016 *)
PROG
(PARI) Vec(x*(2*x+1)*(2*x-1)*(4*x^2+2*x+1)/((4*x-1)*(1-x)) + O(x^30)) \\ Colin Barker, Nov 25 2016
(Magma) [1, 7, 31] cat [7*(1+4^(n-2)): n in [4..40]]; // G. C. Greubel, Oct 25 2022
(SageMath)
def A147597(n): return 7*(1+4^(n-2)) -(119/16)*int(n==0) -(31/4)*int(n==1) -7*int(n==2) -4*int(n==3)
[A147597(n) for n in range(1, 41)] # G. C. Greubel, Oct 25 2022
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Omar E. Pol, Nov 08 2008
EXTENSIONS
More terms from R. J. Mathar, Feb 05 2010
STATUS
approved