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!)
A078513 a(0)=0, a(1)=1, a(n)=a(n-1)+a(n-2)+a(n-3) if a(n-1) is even, a(n)=a(n-1)+a(n-2) if a(n-1) is odd. 0
0, 1, 1, 2, 4, 7, 11, 18, 36, 65, 101, 166, 332, 599, 931, 1530, 3060, 5521, 8581, 14102, 28204, 50887, 79091, 129978, 259956, 469025, 728981, 1198006, 2396012, 4322999, 6719011, 11042010, 22084020, 39845041, 61929061, 101774102, 203548204 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
COMMENTS
Variation of Fibonacci sequence.
LINKS
FORMULA
G.f.: x(1+x+2x^2+4x^3-2x^4+2x^5)/(1-9x^4-2x^8). - Michael Somos, Feb 19 2003
EXAMPLE
a(5)=7 since a(4)=4 then 7=4+2+1.
MATHEMATICA
maxN=10 a[0]=0 a[1]=1 Do[ If[EvenQ[a[i-1]]==True, a[i]=a[i-1]+a[i-2]+a[i-3], a[i]=a[i-1]+a[i-2]]; Print[a[i]], {i, 2, maxN}]
PROG
(PARI) a(n)=if(n<0, 0, polcoeff(x*(1+x+2*x^2+4*x^3-2*x^4+2*x^5)/(1-9*x^4-2*x^8)+x*O(x^n), n))
CROSSREFS
Sequence in context: A157134 A357932 A127926 * A357210 A308871 A325546
KEYWORD
easy,nonn
AUTHOR
Lorenzo Fortunato (fortunat(AT)pd.infn.it), Jan 06 2003
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 March 28 16:58 EDT 2024. Contains 371254 sequences. (Running on oeis4.)