login
A094024
Alternating 1 with one less than the powers of 2.
6
1, 1, 1, 3, 1, 7, 1, 15, 1, 31, 1, 63, 1, 127, 1, 255, 1, 511, 1, 1023, 1, 2047, 1, 4095, 1, 8191, 1, 16383, 1, 32767, 1, 65535, 1, 131071, 1, 262143, 1, 524287, 1, 1048575, 1, 2097151, 1, 4194303, 1, 8388607, 1, 16777215, 1, 33554431, 1, 67108863, 1
OFFSET
0,4
COMMENTS
Inverse binomial transform of A052542. Partial sums are A075427.
Let F(x) = product {n >= 0} (1 - x^(3*n+1))/(1 - x^(3*n+2)). This sequence is the simple continued fraction expansion of the real number F(1/2) = 0.64227 25013 85234 96714 ... = 1/(1 + 1/(1 + 1/(1 + 1/(3 + 1/(1 + 1/(7 + 1/(1 + 1/(15 + ...)))))))). See A111317. - Peter Bala, Dec 26 2012
FORMULA
G.f.: (1+2*x) / ((1+x) * (1-2*x^2)).
E.g.f.: exp(-x) + 2*sinh(sqrt(2)*x) / sqrt(2).
a(n) = (-1)^n + ((sqrt(2))^n - (-sqrt(2))^n) / sqrt(2).
a(n) = (1-(-1)^n) * 2^floor(n/2) + (-1)^n. - Ralf Stephan, Aug 19 2013
a(n) = -a(n-1) + 2*a(n-2) + 2*a(n-3). - Andrew Howroyd, Feb 21 2018
MATHEMATICA
LinearRecurrence[{-1, 2, 2}, {1, 1, 1}, 60] (* Jean-François Alcover, Jul 02 2018 *)
PROG
(Magma) [Ceiling((-1)^n+((Sqrt(2))^n-(-Sqrt(2))^n)/Sqrt(2)): n in [0..50]]; // Vincenzo Librandi, Aug 17 2011
(PARI) a(n)=(1-(-1)^n)*2^floor(n/2)+(-1)^n
CROSSREFS
Cf. A111317.
Sequence in context: A089741 A089736 A205479 * A297172 A329034 A353961
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Apr 22 2004
EXTENSIONS
Better name from Ralf Stephan, Aug 19 2013
Even terms for n >= 60 corrected in b-file by Andrew Howroyd, Feb 21 2018
STATUS
approved