A105637 a(n) = a(n-2) + a(n-3) - a(n-5).
0, 1, 2, 1, 3, 3, 3, 4, 5, 4, 6, 6, 6, 7, 8, 7, 9, 9, 9, 10, 11, 10, 12, 12, 12, 13, 14, 13, 15, 15, 15, 16, 17, 16, 18, 18, 18, 19, 20, 19, 21, 21, 21, 22, 23, 22, 24, 24, 24, 25, 26, 25, 27, 27, 27, 28, 29, 28, 30, 30, 30, 31, 32, 31, 33, 33, 33, 34, 35, 34, 36, 36, 36, 37, 38, 37
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0,1,1,0,-1).
Programs
-
PARI
a(n)=1+floor(n/2)-if(n%3==0,1,0)
Formula
G.f.: x*(1+2*x)/((1-x^2)*(1-x^3)).
a(n) = Sum_{k=0..n} (k mod 3)*(1-(-1)^(n+k-1))/2.
a(n) = Sum_{k=0..floor(n/2)} (n-2k mod 3).
a(n) = 1 + floor(n/2) - [3 divides n]. - Ralf Stephan, Nov 15 2010
a(n) = floor(n/2) + floor((n+2)/3) - floor(n/3). - Mircea Merca, May 20 2013
Comments