login
A112282
a(n) = (-1)^n*(2*n+1) (mod 9).
1
1, 6, 5, 2, 0, 7, 4, 3, 8, 8, 3, 4, 7, 0, 2, 5, 6, 1, 1, 6, 5, 2, 0, 7, 4, 3, 8, 8, 3, 4, 7, 0, 2, 5, 6, 1, 1, 6, 5, 2, 0, 7, 4, 3, 8, 8, 3, 4, 7, 0, 2, 5, 6, 1, 1, 6, 5, 2, 0, 7, 4, 3, 8, 8, 3, 4, 7, 0, 2, 5, 6, 1, 1, 6, 5, 2, 0, 7, 4, 3, 8, 8, 3, 4, 7, 0, 2, 5, 6, 1, 1, 6, 5, 2, 0, 7, 4, 3, 8, 8, 3, 4, 7, 0, 2
OFFSET
0,2
FORMULA
Period 18 sequence: [1, 6, 5, 2, 0, 7, 4, 3, 8, 8, 3, 4, 7, 0, 2, 5, 6, 1].
MAPLE
seq(`mod`((-1)^n*(2*n+1), 9), n = 0..120); # G. C. Greubel, Nov 05 2019
MATHEMATICA
Table[Mod[(-1)^n*(2*n+1), 9], {n, 0, 120}] (* G. C. Greubel, Nov 05 2019 *)
Mod[Times@@@Partition[Riffle[Range[1, 221, 2], {1, -1}, {1, -1, 2}], 2], 9] (* Harvey P. Dale, Jan 06 2024 *)
PROG
(PARI) a(n)=((-1)^n*(2*n+1))%9
(Magma) [(-1)^n*(2*n+1) mod 9 : n in [0..120]]; // G. C. Greubel, Nov 05 2019
(Sage) [mod((-1)^n*(2*n+1), 9) for n in (0..120)] # G. C. Greubel, Nov 05 2019
(GAP) List([0..120], n-> (-1)^n*(2*n+1) mod 9 ); # G. C. Greubel, Nov 05 2019
CROSSREFS
Cf. A112280.
Sequence in context: A102079 A177938 A374529 * A098866 A144689 A221215
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Sep 01 2005
STATUS
approved