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 A070402 #47 Dec 14 2023 05:06:27 %S A070402 1,2,4,3,1,2,4,3,1,2,4,3,1,2,4,3,1,2,4,3,1,2,4,3,1,2,4,3,1,2,4,3,1,2, %T A070402 4,3,1,2,4,3,1,2,4,3,1,2,4,3,1,2,4,3,1,2,4,3,1,2,4,3,1,2,4,3,1,2,4,3, %U A070402 1,2,4,3,1,2,4,3,1,2,4,3,1,2,4,3,1,2,4,3,1,2,4,3,1,2,4,3,1,2,4,3,1,2,4,3,1 %N A070402 a(n) = 2^n mod 5. %C A070402 Periodic with period 4: [1, 2, 4, 3]. - _Washington Bomfim_, Nov 23 2010 %H A070402 G. C. Greubel, <a href="/A070402/b070402.txt">Table of n, a(n) for n = 0..1000</a> %H A070402 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,-1,1). %F A070402 From _R. J. Mathar_, Apr 13 2010: (Start) %F A070402 a(n) = a(n-1) - a(n-2) + a(n-3). %F A070402 G.f.: (1 + x + 3*x^2) / ((1-x)*(1+x^2)). (End) %F A070402 From _Washington Bomfim_, Nov 23 2010: (Start) %F A070402 a(n) = 1 + (15*r^2 - 5*r - 4*r^3)/6, where r = n mod 4. %F A070402 a(n) = A000689(n) - 5*floor(((n-1) mod 4)/2) for n>0. (End) %F A070402 E.g.f.: (1/2)*(5*exp(x) - 3*cos(x) - sin(x)). - _G. C. Greubel_, Mar 19 2016 %p A070402 A070402 := proc(n) op((n mod 4)+1,[1,2,4,3]) ; end proc: # _R. J. Mathar_, Feb 05 2011 %t A070402 PadRight[{}, 100, {1, 2, 4, 3}] (* or *) CoefficientList[Series[(1 + 2 x + 4 x^2 + 3 x^3) / (1 - x^4), {x, 0, 100}], x] (* _Vincenzo Librandi_, Mar 25 2016 *) %t A070402 PowerMod[2,Range[0,120],5] (* _Harvey P. Dale_, Sep 16 2020 *) %o A070402 (Sage) [power_mod(2,n,5) for n in range(0, 105)] # _Zerinvary Lajos_, Jun 08 2009 %o A070402 (PARI) for(n=0, 80, x=n%4; print1(1 + (15*x^2 -5*x -4*x^3)/6, ", ")) \\ _Washington Bomfim_, Nov 23 2010 %o A070402 (Magma) [Modexp(2, n, 5): n in [0..100]]; // _Bruno Berselli_, Mar 23 2016 %o A070402 (GAP) List([0..83],n->PowerMod(2,n,5)); # _Muniru A Asiru_, Feb 01 2019 %Y A070402 Cf. A173635. %K A070402 nonn,easy %O A070402 0,2 %A A070402 _N. J. A. Sloane_, May 12 2002