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!)
A168427 a(n) = 3^n mod 30. 1
1, 3, 9, 27, 21, 3, 9, 27, 21, 3, 9, 27, 21, 3, 9, 27, 21, 3, 9, 27, 21, 3, 9, 27, 21, 3, 9, 27, 21, 3, 9, 27, 21, 3, 9, 27, 21, 3, 9, 27, 21, 3, 9, 27, 21, 3, 9, 27, 21, 3, 9, 27, 21, 3, 9, 27, 21, 3, 9, 27, 21, 3, 9, 27, 21, 3, 9, 27, 21, 3, 9, 27, 21, 3, 9, 27, 21, 3, 9, 27, 21, 3, 9, 27 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
FORMULA
From Chai Wah Wu, Jan 22 2023: (Start)
a(n) = a(n-1) - a(n-2) + a(n-3) for n > 3.
G.f.: (-20*x^3 - 7*x^2 - 2*x - 1)/((x - 1)*(x^2 + 1)). (End)
MATHEMATICA
PowerMod[3, Range[0, 90], 30] (* Harvey P. Dale, Nov 04 2011 *)
PROG
(Sage) [power_mod(3, n, 30) for n in range(0, 88)] #
(PARI) a(n)=lift(Mod(3, 30)^n) \\ Charles R Greathouse IV, Mar 22 2016
(Python)
def A168427(n): return (21, 3, 9, 27)[n&3] if n else 1 # Chai Wah Wu, Jan 22 2023
CROSSREFS
Cf. A001148.
Sequence in context: A321542 A321540 A036123 * A070344 A070357 A131137
KEYWORD
nonn,easy
AUTHOR
Zerinvary Lajos, Nov 25 2009
STATUS
approved

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 May 8 04:18 EDT 2024. Contains 372317 sequences. (Running on oeis4.)