This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A168427 #21 Jan 23 2023 08:49:22 %S A168427 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, %T A168427 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, %U A168427 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 %N A168427 a(n) = 3^n mod 30. %H A168427 Vincenzo Librandi, <a href="/A168427/b168427.txt">Table of n, a(n) for n = 0..1000</a> %H A168427 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,-1,1). %F A168427 From _Chai Wah Wu_, Jan 22 2023: (Start) %F A168427 a(n) = a(n-1) - a(n-2) + a(n-3) for n > 3. %F A168427 G.f.: (-20*x^3 - 7*x^2 - 2*x - 1)/((x - 1)*(x^2 + 1)). (End) %t A168427 PowerMod[3,Range[0,90],30] (* _Harvey P. Dale_, Nov 04 2011 *) %o A168427 (Sage) [power_mod(3,n,30) for n in range(0, 88)] # %o A168427 (PARI) a(n)=lift(Mod(3,30)^n) \\ _Charles R Greathouse IV_, Mar 22 2016 %o A168427 (Python) %o A168427 def A168427(n): return (21,3,9,27)[n&3] if n else 1 # _Chai Wah Wu_, Jan 22 2023 %Y A168427 Cf. A001148. %K A168427 nonn,easy %O A168427 0,2 %A A168427 _Zerinvary Lajos_, Nov 25 2009