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 A186809 #34 Dec 12 2023 07:47:33 %S A186809 0,1,2,0,-2,-1,0,1,2,0,-2,-1,0,1,2,0,-2,-1,0,1,2,0,-2,-1,0,1,2,0,-2, %T A186809 -1,0,1,2,0,-2,-1,0,1,2,0,-2,-1,0,1,2,0,-2,-1,0,1,2,0,-2,-1,0,1,2,0, %U A186809 -2,-1,0,1,2,0,-2,-1,0,1,2,0,-2,-1,0,1,2,0,-2,-1,0,1,2,0,-2,-1,0,1,2,0,-2,-1,0 %N A186809 Period 6 sequence [0, 1, 2, 0, -2, -1, ...]. %C A186809 For n > 0: a(n) = A262565(n+1) - A262565(n). - _Reinhard Zumkeller_, Oct 19 2015 %H A186809 Michael Somos, <a href="http://grail.eecs.csuohio.edu/~somos/rfmc.txt">Rational Function Multiplicative Coefficients</a> %H A186809 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,-1,0,-1) %F A186809 Euler transform of length 6 sequence [2, -3, 0, 0, 0, 1]. %F A186809 a(n) is multiplicative with a(2^e) = -2 * (-1)^e if e>0. a(3^e) = 0^e, a(p^e) = 1 if p == 1 (mod 6), a(p^e) = (-1)^n if p == 5 (mod 6). %F A186809 G.f.: x * (1 + x)^2 / (1 + x^2 + x^4). a(n+3) = a(-n) = -a(n). a(n) = n if |n| < 3. %F A186809 a(n) = (mod(n+1, 3) - 1) * (mod(n+1, 2) + 1) * (-1)^(n+1). - _Wesley Ivan Hurt_, Aug 31 2014 %F A186809 |a(n)| = A193680(n). - _Wesley Ivan Hurt_, Aug 31 2014 %e A186809 G.f. = x + 2*x^2 - 2*x^4 - x^5 + x^7 + 2*x^8 - 2*x^10 - x^11 + x^13 + ... %p A186809 A186809:=n->(((n+1) mod 3)-1)*(((n+1) mod 2)+1)*(-1)^(n+1): seq(A186809(n), n=0..100); # _Wesley Ivan Hurt_, Aug 31 2014 %t A186809 Table[(Mod[n + 1, 3] - 1) (Mod[n + 1, 2] + 1) (-1)^(n + 1), {n, 0, 100}] (* _Wesley Ivan Hurt_, Aug 31 2014 *) %t A186809 PadRight[{},120,{0,1,2,0,-2,-1}] (* _Harvey P. Dale_, Nov 18 2020 *) %o A186809 (PARI) {a(n) = [0, 1, 2, 0, -2, -1][n%6 + 1]}; %o A186809 (Magma) [(((n+1) mod 3)-1)*(((n+1) mod 2)+1)*(-1)^(n+1) : n in [0..100]]; // _Wesley Ivan Hurt_, Aug 31 2014 %o A186809 (Haskell) %o A186809 a186809 n = a186809_list !! (n-1) %o A186809 a186809_list = cycle [0, 1, 2, 0, -2, -1] %o A186809 -- _Reinhard Zumkeller_, Oct 19 2015 %Y A186809 Cf. A193680. %Y A186809 Cf. A262565. %K A186809 sign,mult,easy %O A186809 0,3 %A A186809 _Michael Somos_, Feb 26 2011