login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 59th year, we have over 358,000 sequences, and we’ve crossed 10,300 citations (which often say “discovered thanks to the OEIS”).

Other ways to Give
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A097564 a(n) = (a(n-1) mod 2)*a(n-1) + a(n-2) with a(0)=0, a(1)=1. 1
0, 1, 1, 2, 1, 3, 4, 3, 7, 10, 7, 17, 24, 17, 41, 58, 41, 99, 140, 99, 239, 338, 239, 577, 816, 577, 1393, 1970, 1393, 3363, 4756, 3363, 8119, 11482, 8119, 19601, 27720, 19601, 47321, 66922, 47321, 114243, 161564, 114243, 275807, 390050, 275807, 665857 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

COMMENTS

The sequences a(2), a(5), ... a(1+3*n) ... and a(4), a(7), ... a(4 + 3n) ... are both A001333 (numerators of continued fraction convergents to sqrt(2)). The sequence a(0), a(3), a(6), ... a(3+3*n) ... is twice A000129 (the Pell nos. or the denominators of continued fraction convergents to sqrt(2)., also is A052542 starting w/ offset 1.

LINKS

Colin Barker, Table of n, a(n) for n = 0..1000

D. Panario, M. Sahin, and Q. Wang, A family of Fibonacci-like conditional sequences, INTEGERS, Vol. 13, 2013, #A78.

Index entries for linear recurrences with constant coefficients, signature (0,0,2,0,0,1).

FORMULA

From Colin Barker, Jun 01 2016: (Start)

a(n) = 2*a(n-3) + a(n-6) for n>5.

G.f.: x*(1+x+2*x^2-x^3+x^4) / (1-2*x^3-x^6). (End)

MAPLE

m:=50; S:=series( x*(1+x+2*x^2-x^3+x^4)/(1-2*x^3-x^6), x, m+1):

seq(coeff(S, x, j), j=0..m); # G. C. Greubel, Apr 20 2021

MATHEMATICA

nxt[{a_, b_}]:={b, Mod[b, 2]*b+a}; NestList[nxt, {0, 1}, 50][[All, 1]] (* or *) LinearRecurrence[{0, 0, 2, 0, 0, 1}, {0, 1, 1, 2, 1, 3}, 50] (* Harvey P. Dale, Aug 15 2017 *)

PROG

(PARI) concat(0, Vec(x*(1+x+2*x^2-x^3+x^4)/(1-2*x^3-x^6) + O(x^100))) \\ Colin Barker, Jun 02 2016

(Magma) [n le 2 select n-1 else (Self(n-1) mod 2)*Self(n-1)+Self(n-2): n in [1..50]]; // Bruno Berselli, Jun 02 2016

(Sage)

def A097564_list(prec):

    P.<x> = PowerSeriesRing(ZZ, prec)

    return P( x*(1+x+2*x^2-x^3+x^4)/(1-2*x^3-x^6) ).list()

A097564_list(50) # G. C. Greubel, Apr 20 2021

CROSSREFS

Sequence in context: A133310 A077608 A002124 * A345233 A128270 A151550

Adjacent sequences:  A097561 A097562 A097563 * A097565 A097566 A097567

KEYWORD

nonn,easy

AUTHOR

Gerald McGarvey, Aug 27 2004

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 November 26 05:48 EST 2022. Contains 358353 sequences. (Running on oeis4.)