OFFSET
1,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,1,-1).
FORMULA
a(n) = 5*floor((n-1)/5) + 2*n - 2.
G.f.: x^2*(2 + 2*x + 2*x^2 + 2*x^3 + 7*x^4)/((x^4 + x^3 + x^2 + x + 1)*(x-1)^2). - R. J. Mathar, Jun 28 2011
EXAMPLE
For n = 2, a pile with 2 cents remaining is unsafe because the player would only be able to remove a penny, leaving the opponent with 1 cent and a guaranteed win.
PROG
(Magma) [5*Floor((n-1)/5) + 2*n - 2: n in [1..60]]; // Vincenzo Librandi, Jul 04 2011
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Patrick Vennebush, Jun 28 2011
STATUS
approved