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”).

A267807
a(0) = a(1) = 1; for n>1, a(n) = (a(n-1) mod 3) + a(n-2).
3
1, 1, 2, 3, 2, 5, 4, 6, 4, 7, 5, 9, 5, 11, 7, 12, 7, 13, 8, 15, 8, 17, 10, 18, 10, 19, 11, 21, 11, 23, 13, 24, 13, 25, 14, 27, 14, 29, 16, 30, 16, 31, 17, 33, 17, 35, 19, 36, 19, 37, 20, 39, 20, 41, 22, 42, 22, 43, 23, 45, 23, 47, 25, 48, 25, 49, 26, 51, 26, 53, 28
OFFSET
0,3
FORMULA
G.f.: (1 + x + x^2 + 2*x^3 + 2*x^5 + 2*x^6 + x^7 - x^8)/((1 - x)^2*(1 + x)^2* (1 + x^2)*(1 + x^4)). [Bruno Berselli, Jan 21 2016]
a(n) = a(n-2) + a(n-8) - a(n-10) for n>9. [Bruno Berselli, Jan 21 2016]
MATHEMATICA
RecurrenceTable[{a[0] == a[1] == 1, a[n] == Mod[a[n - 1], 3] + a[n - 2]}, a, {n, 90}]
LinearRecurrence[{0, 1, 0, 0, 0, 0, 0, 1, 0, -1}, {1, 1, 2, 3, 2, 5, 4, 6, 4, 7}, 90] (* Bruno Berselli, Jan 21 2016 *)
PROG
(PARI) a=vector(100); for(n=1, #a, if(n<3, a[n]=1, a[n]=a[n-1]%3+a[n-2])); a \\ Colin Barker, Jan 22 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
Edited by Bruno Berselli, Jan 21 2016
STATUS
approved