OFFSET
1,2
COMMENTS
Starting with a(1)=0 and same definition, a(n)=n+(-1)^n (cf. A004442)
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,0,0,0,0,0,1,-1).
FORMULA
a(n)-n is periodic with period (0, 2, 4, 2, 4, 2, 0, -2, -4, -2) of length 10.
a(10t+i) = 10t+c_i, 1<=i<=10, c_i=(1, 4, 7, 6, 9, 8, 7, 6, 5, 8). a(n) = n iff n == 1 or 7 (mod 10).
G.f.: x*(2*x^10+3*x^9-x^8-x^7-x^6-x^5+3*x^4-x^3+3*x^2+3*x+1) / (x^11-x^10-x+1). - Colin Barker, Oct 16 2013
MATHEMATICA
LinearRecurrence[{1, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1}, {1, 4, 7, 6, 9, 8, 7, 6, 5, 8, 11}, 80] (* Harvey P. Dale, Feb 01 2015 *)
PROG
(PARI) Vec(x*(2*x^10+3*x^9-x^8-x^7-x^6-x^5+3*x^4-x^3+3*x^2+3*x+1)/(x^11-x^10-x+1) + O(x^100)) \\ Colin Barker, Oct 16 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Benoit Cloitre and N. J. A. Sloane, Feb 14 2003
STATUS
approved