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

%I #3 Apr 30 2014 01:33:20

%S 0,1,1,2,4,7,11,18,36,65,101,166,332,599,931,1530,3060,5521,8581,

%T 14102,28204,50887,79091,129978,259956,469025,728981,1198006,2396012,

%U 4322999,6719011,11042010,22084020,39845041,61929061,101774102,203548204

%N 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.

%C Variation of Fibonacci sequence.

%F G.f.: x(1+x+2x^2+4x^3-2x^4+2x^5)/(1-9x^4-2x^8). - _Michael Somos_, Feb 19 2003

%e a(5)=7 since a(4)=4 then 7=4+2+1.

%t 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}]

%o (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))

%K easy,nonn

%O 0,4

%A Lorenzo Fortunato (fortunat(AT)pd.infn.it), Jan 06 2003

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 April 23 11:21 EDT 2024. Contains 371913 sequences. (Running on oeis4.)