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 A184334 #52 Dec 12 2023 07:40:55 %S A184334 1,2,2,0,-2,-2,0,2,2,0,-2,-2,0,2,2,0,-2,-2,0,2,2,0,-2,-2,0,2,2,0,-2, %T A184334 -2,0,2,2,0,-2,-2,0,2,2,0,-2,-2,0,2,2,0,-2,-2,0,2,2,0,-2,-2,0,2,2,0, %U A184334 -2,-2,0,2,2,0,-2,-2,0,2,2,0,-2,-2,0,2,2,0,-2,-2,0,2,2,0,-2,-2,0,2,2,0,-2,-2,0 %N A184334 Period 6 sequence [0, 2, 2, 0, -2, -2, ...] except a(0) = 1. %H A184334 G. C. Greubel, <a href="/A184334/b184334.txt">Table of n, a(n) for n = 0..2500</a> %H A184334 Michael Somos, <a href="http://grail.eecs.csuohio.edu/rfmc.txt">Rational Function Multiplicative Coefficients</a> %H A184334 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (1,-1) %F A184334 a(n) = 2 * b(n) where b() is multiplicative with b(2^e) = (-1)^(e-1) if e>0, b(3^e) = 0^e, b(p^e) = 1 if p == 1 mod 6, b(p^e) = (-1)^e if p == 5 mod 6. %F A184334 Euler transform of length 6 sequence [2, -1, -2, 0, 0, 1]. %F A184334 G.f. A(x) satisfies 0 = f(A(x), A(x^2)) where f(u, v) = 2 * u * (v - 1) - (u - 1)^2 * v. %F A184334 G.f.: (1 + x + x^2) / (1 - x + x^2). %F A184334 a(-n) = -a(n) unless n = 0. a(n+3) = -a(n) unless n = 0 or n = -3. %F A184334 G.f.: 1 / (1 - 2*x / (1 + x / (1 - x / (1 + x)))). - _Michael Somos_, Jan 03 2013 %F A184334 a(n) = A130772(n-1) if n>0. %F A184334 a(n) = A257076(n-1) = A109265(n-2) if n>2. - _Michael Somos_, Sep 01 2015 %e A184334 G.f. = 1 + 2*x + 2*x^2 - 2*x^4 - 2*x^5 + 2*x^7 + 2*x^8 - 2*x^10 - 2*x^11 + ... %t A184334 PadRight[{1},120,{0,2,2,0,-2,-2}] (* _Harvey P. Dale_, Apr 02 2015 *) %t A184334 a[ n_] := Boole[n == 0] + {2, 2, 0, -2, -2, 0}[[Mod[n, 6, 1]]]; (* _Michael Somos_, Sep 01 2015 *) %o A184334 (PARI) {a(n) = (n==0) + [ 0, 2, 2, 0, -2, -2][n%6+1]}; %o A184334 (PARI) {a(n) = (n==0) + 2 * (-1)^(n\3) * sign( n%3)}; %o A184334 (Magma) m:=30; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!((1 + x+x^2)/(1-x+x^2))); // _G. C. Greubel_, Aug 04 2018 %Y A184334 Cf. A109265, A130772, A257076. %K A184334 sign,easy %O A184334 0,2 %A A184334 _Michael Somos_, Feb 13 2011