login

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 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A173151
a(n) = a(n-1) - [a(n-1)/2] + a(n-2) - [a(n-5)/2] where [k] = floor(k).
6
1, 1, 2, 2, 3, 4, 5, 6, 7, 9, 10, 12, 13, 16, 17, 20, 21, 25, 26, 30, 31, 36, 37, 42, 43, 49, 50, 56, 57, 64, 65, 72, 73, 81, 82, 90, 91, 100, 101, 110, 111, 121, 122, 132, 133, 144, 145, 156, 157, 169, 170
OFFSET
0,3
FORMULA
a(n) = a(n-1)-floor[a(n-1)/2]+a(n-2)-floor[a(n-5)/2].
From Chai Wah Wu, Jun 02 2016: (Start)
a(n) = a(n-1) + a(n-2) - a(n-3) + a(n-4) - a(n-5) - a(n-6) + a(n-7) for n > 6.
G.f.: (-x^5 + x^4 - 1)/((x - 1)^3*(x + 1)^2*(x^2 + 1)). (End)
a(n) = ((-1)^n*(11 - 2*n) + 2*n*(n + 5) + 4*sin(Pi*n/2) - 4*cos(Pi*n/2) + 25)/32. - Ilya Gutkovskiy, Jun 03 2016
MATHEMATICA
f[-3] = 0; f[-2] = 0; f[-1] = 0; f[0] = 1; f[1] = 1;
f[n_] := f[n] = f[n - 1] + f[n - 2] - Floor[f[n - 1]/2] - Floor[f[n - 5]/2]
Table[f[n], {n, 0, 50}]
CROSSREFS
Sequence in context: A286874 A065459 A011873 * A008673 A133564 A342558
KEYWORD
nonn
AUTHOR
Roger L. Bagula, Nov 22 2010
STATUS
approved