OFFSET
0,3
COMMENTS
In fact ceiling(5n/2) and floor(5n/2) have the same probability.
a(n) equals A047215(n) except for n=1.
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Ran Pan, Exercise G, Project P
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
FORMULA
a(n) = floor(5*n/2), for n>=2; a(0)=0 and a(1)=1.
From Colin Barker, Apr 08 2015: (Start)
a(n) = (-1+(-1)^n+10*n)/4 for n>1.
a(n) = a(n-1)+a(n-2)-a(n-3) for n>4.
G.f.: -x*(x^3-x^2-4*x-1) / ((x-1)^2*(x+1)).
(End)
EXAMPLE
For n=1, there are four equally likely outcomes, 1,2,3,4, and the smallest of these is 1, so a(1)=1.
MAPLE
a:= n-> iquo(5*n, 2) -`if`(n=1, 1, 0):
seq(a(n), n=0..80); # Alois P. Heinz, Apr 08 2015
MATHEMATICA
Join[{0, 1}, Table[Floor[5 n/2], {n, 2, 100}]]
PROG
(Magma) [n le 1 select n else Floor(5*n/2): n in [0..70]]; // Vincenzo Librandi, Apr 08 2015
(PARI) a(n)=if(n<2, n, 5*n\2) \\ Charles R Greathouse IV, Apr 08 2015
(PARI) concat(0, Vec(-x*(x^3-x^2-4*x-1)/((x-1)^2*(x+1)) + O(x^100))) \\ Colin Barker, Apr 08 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ran Pan, Apr 08 2015
STATUS
approved