OFFSET
1,2
COMMENTS
For general Modd n (not to be confused with mod n) see a comment on A203571. The present sequence gives the residues Modd 11 for the positive odd numbers not divisible by 11, which are given in A204454.
The underlying period length 22 sequence with offset 0 is P_11, also called Modd11, periodic([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]).
LINKS
Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-2,1).
FORMULA
EXAMPLE
Residue Modd 11 of the positive odd numbers not divisible by 11:
A204454: 1, 3, 5, 7, 9, 13, 15, 17, 19, 21, 23, 25, 27, ...
Modd 11: 1, 3, 5, 7, 9, 9, 7, 5, 3, 1, 1, 3, 5, ...
MATHEMATICA
PadRight[{}, 120, {1, 3, 5, 7, 9, 9, 7, 5, 3, 1}] (* or *) LinearRecurrence[{2, -2, 2, -2, 1}, {1, 3, 5, 7, 9}, 120] (* Harvey P. Dale, Oct 15 2017 *)
PROG
(PARI) a(n)=[1, 3, 5, 7, 9, 9, 7, 5, 3, 1][n%10+1] \\ Charles R Greathouse IV, Jul 17 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wolfdieter Lang, Feb 09 2012
STATUS
approved