login
A147596
a(n) is the number whose binary representation is A138145(n).
4
1, 3, 7, 15, 31, 63, 119, 231, 455, 903, 1799, 3591, 7175, 14343, 28679, 57351, 114695, 229383, 458759, 917511, 1835015, 3670023, 7340039, 14680071, 29360135, 58720263, 117440519, 234881031, 469762055, 939524103, 1879048199, 3758096391
OFFSET
1,2
FORMULA
a(n) = 7*(2^(n-3) + 1) if n >= 6. - Hagen von Eitzen, Jun 02 2009
From Colin Barker, Sep 15 2013: (Start)
a(n) = 3*a(n-1) - 2*a(n-2), for n >= 8.
G.f.: x*(1-2*x^2)*(1+2*x^2+4*x^4) / ((1-x)*(1-2*x)). (End)
E.g.f.: (7/8)*(8*exp(x) + exp(2*x)) - (1/8)*(63 + 62*x + 30*x^2) - 7*x^3/6 - x^4/4 - x^5/30. - G. C. Greubel, Oct 25 2022
MATHEMATICA
Join[{1, 3, 7, 15, 31}, 7*(1+2^(Range[6, 40] -3))] (* G. C. Greubel, Oct 25 2022 *)
PROG
(PARI) Vec(-x*(2*x^2-1)*(4*x^4+2*x^2+1)/((x-1)*(2*x-1)) + O(x^100)) \\ Colin Barker, Sep 15 2013
(Magma) [1, 3, 7, 15, 31] cat [7*(1+2^(n-3)): n in [6..40]]; // G. C. Greubel, Oct 25 2022
(SageMath)
def A147596(n): return 7*(1+2^(n-3)) -(1/8)*(63*int(n==0) +62*int(n==1) +60*int(n ==2)) -(7*int(n==3) +6*int(n==4) +4*int(n==5))
[A147596(n) for n in range(1, 40)] # G. C. Greubel, Oct 25 2022
KEYWORD
base,easy,nonn
AUTHOR
Omar E. Pol, Nov 08 2008
EXTENSIONS
More terms from Hagen von Eitzen, Jun 02 2009
STATUS
approved