login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A112282 a(n) = (-1)^n*(2*n+1) (mod 9). 1

%I #11 Jan 06 2024 19:40:30

%S 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,

%T 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,

%U 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

%N a(n) = (-1)^n*(2*n+1) (mod 9).

%F Period 18 sequence: [1, 6, 5, 2, 0, 7, 4, 3, 8, 8, 3, 4, 7, 0, 2, 5, 6, 1].

%p seq(`mod`((-1)^n*(2*n+1), 9), n = 0..120); # _G. C. Greubel_, Nov 05 2019

%t Table[Mod[(-1)^n*(2*n+1), 9], {n, 0, 120}] (* _G. C. Greubel_, Nov 05 2019 *)

%t Mod[Times@@@Partition[Riffle[Range[1,221,2],{1,-1},{1,-1,2}],2],9] (* _Harvey P. Dale_, Jan 06 2024 *)

%o (PARI) a(n)=((-1)^n*(2*n+1))%9

%o (Magma) [(-1)^n*(2*n+1) mod 9 : n in [0..120]]; // _G. C. Greubel_, Nov 05 2019

%o (Sage) [mod((-1)^n*(2*n+1), 9) for n in (0..120)] # _G. C. Greubel_, Nov 05 2019

%o (GAP) List([0..120], n-> (-1)^n*(2*n+1) mod 9 ); # _G. C. Greubel_, Nov 05 2019

%Y Cf. A112280.

%K nonn

%O 0,2

%A _Paul D. Hanna_, Sep 01 2005

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 03:57 EDT 2024. Contains 371782 sequences. (Running on oeis4.)