OFFSET
1,1
COMMENTS
a(n) is the number whose binary representation is A138120(n).
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..800
Index entries for linear recurrences with constant coefficients, signature (27,-202,432,-256).
FORMULA
a(n) = 2^n - 1 + 2^(4*n-1) - 2^(3*n-1). - R. J. Mathar, Nov 09 2008
G.f.: x*(5 -36*x +136*x^2)/((1-x)*(1-2*x)*(1-8*x)*(1-16*x)). - Colin Barker, Nov 04 2012
a(n) = 27*a(n-1) - 202*a(n-2) + 432*a(n-3) - 256*a(n-4). - Wesley Ivan Hurt, Jan 11 2017
MAPLE
MATHEMATICA
Table[FromDigits[Join[Table[1, {n}], Table[0, {2n - 1}], Table[1, {n}]], 2], {n, 1, 20}] (* Stefan Steinerberger, Nov 11 2008 *)
LinearRecurrence[{27, -202, 432, -256}, {5, 99, 1799, 30735}, 20] (* Harvey P. Dale, Aug 28 2017 *)
PROG
(Magma) [2^n-1+2^(4*n-1)-2^(3*n-1) : n in [1..20]]; // Wesley Ivan Hurt, Jan 11 2017
(PARI) vector(20, n, 2^(4*n-1) -2^(3*n-1) +2^n -1) \\ G. C. Greubel, Jan 12 2020
(Sage) [2^(4*n-1) -2^(3*n-1) +2^n -1 for n in (1..20)] # G. C. Greubel, Jan 12 2020
(GAP) List([1..20], n-> 2^(4*n-1) -2^(3*n-1) +2^n -1); # G. C. Greubel, Jan 12 2020
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Omar E. Pol, Nov 06 2008
EXTENSIONS
Extended by R. J. Mathar and Stefan Steinerberger, Nov 09 2008
STATUS
approved