The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A316742 Stepping through the Mersenne sequence (A000225) one step back, two steps forward. 0
1, 0, 3, 1, 7, 3, 15, 7, 31, 15, 63, 31, 127, 63, 255, 127, 511, 255, 1023, 511, 2047, 1023, 4095, 2047, 8191, 4095, 16383, 8191, 32767, 16383, 65535, 32767, 131071, 65535, 262143, 131071, 524287, 262143, 1048575, 524287, 2097151, 1048575, 4194303, 2097151, 8388607, 4194303 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
Jim Singh and others, Fascinating periodic sequence pairs, Mersenne Forum thread, July 2018.
FORMULA
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) for n>2, a(0)=1, a(1)=0, a(2)=3.
From Bruno Berselli, Jul 12 2018: (Start)
G.f.: (1 - x + x^2)/((1 - x)*(1 - 2*x^2)).
a(n) = 2*a(n-2) + 1 for n>1, a(0)=1, a(1)=0.
a(n) = (1 + (-1)^n)*(2^(n/2) - 2^((n-3)/2)) + 2^((n-1)/2) - 1.
Therefore: a(4*k) = 2*4^k - 1, a(4*k+1) = 4^k - 1, a(4*k+2) = 4^(k+1) - 1, a(4*k+3) = 2*4^k - 1. (End)
EXAMPLE
Let 1. The first four terms are 1, (1-1)/2 = 0, 2*1+1 = 3, 1.
Let 4*1+3 = 7. The next four terms are 7, (7-1)/2 = 3, 2*7+1 = 15, 7.
Let 4*7+3 = 31. The next four terms are 31, (31-1)/2 = 15, 2*31+1 = 63, 31; etc.
MAPLE
seq(coeff(series((1-x+x^2)/((1-x)*(1-2*x^2)), x, n+1), x, n), n=0..45); # Muniru A Asiru, Jul 14 2018
MATHEMATICA
CoefficientList[Series[(1 - x + x^2)/((1 - x) (1 - 2 x^2)), {x, 0, 42}], x] (* Michael De Vlieger, Jul 13 2018 *)
LinearRecurrence[{1, 2, -2}, {1, 0, 3}, 46] (* Robert G. Wilson v, Jul 21 2018 *)
PROG
(GAP) a:=[1, 0, 3];; for n in [4..45] do a[n]:=a[n-1]+2*a[n-2]-2*a[n-3]; od; a; # Muniru A Asiru, Jul 14 2018
CROSSREFS
Sequence in context: A083239 A333847 A342268 * A189050 A095868 A140962
KEYWORD
nonn,easy,less
AUTHOR
Jim Singh, Jul 12 2018
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 15 21:53 EDT 2024. Contains 372549 sequences. (Running on oeis4.)