OFFSET
0,5
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Lucilla Baldini, Josef Eschgfäller, Random functions from coupled dynamical systems, arXiv preprint arXiv:1609.01750 [math.CO], 2016. See Example 3.3.
FORMULA
Conjectures from Colin Barker, Aug 30 2017: (Start)
G.f.: x*(1 + x^2 + x^3 + 3*x^4 + x^5 + x^6 + 3*x^7) / ((1 - x)^2*(1 + x)*(1 - x + x^2)*(1 + x + x^2)^2).
a(n) = a(n-3) + a(n-6) - a(n-9) for n>8. (End)
MAPLE
f:=proc(n)
if n mod 3 = 0 then n/3
elif n mod 3 = 1 then floor((n+1)/2)
else n-2 fi; end;
[seq(f(n), n=0..100)];
MATHEMATICA
a[n_] := Switch[Mod[n, 3], 0, n/3, 1, Floor[(n + 1)/2], _, n - 2];
Array[a, 100, 0] (* Jean-François Alcover, Nov 28 2017 *)
PROG
(Magma) a:=func<n | n mod 3 eq 0 select n/3 else n mod 3 eq 1 select Floor((n+1)/2) else n-2>; [a(n): n in [0..100]]; // Bruno Berselli, Aug 30 2017
(PARI) a(n) = if(n%3==0, n\3, if(n%3==1, (n+1)\2, n-2)) \\ Colin Barker, Aug 30 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Aug 29 2017
STATUS
approved