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 A257075 #41 Aug 08 2025 11:37:27 %S A257075 1,-1,1,1,-1,1,1,-1,1,1,-1,1,1,-1,1,1,-1,1,1,-1,1,1,-1,1,1,-1,1,1,-1, %T A257075 1,1,-1,1,1,-1,1,1,-1,1,1,-1,1,1,-1,1,1,-1,1,1,-1,1,1,-1,1,1,-1,1,1, %U A257075 -1,1,1,-1,1,1,-1,1,1,-1,1,1,-1,1,1,-1,1,1,-1,1 %N A257075 a(n) = (-1)^(n mod 3). %C A257075 Period 3: repeat [1, -1, 1]. - _Wesley Ivan Hurt_, Jul 02 2016 %H A257075 G. C. Greubel, <a href="/A257075/b257075.txt">Table of n, a(n) for n = 0..2500</a> %H A257075 Michael Somos, <a href="http://grail.eecs.csuohio.edu/~somos/rfmc.html">Rational Function Multiplicative Coefficients</a> %H A257075 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,1). %F A257075 Euler transform of length 6 sequence [-1, 1, 2, 0, 0, -1]. %F A257075 a(n) = b(2*n + 1) where b() is multiplicative with b(2^e) = 0^e, b(3^e) = -1 if e>0, otherwise b(p^e) = 1. %F A257075 a(n) = a(-1-n) = a(n+3) = -a(n-1)*a(n-2) for all n in Z. %F A257075 G.f.: (1 - x + x^2) / (1 - x^3). %F A257075 G.f.: (1 - x) * (1 - x^6) / ((1 - x^2) * (1 - x^3)^2). %F A257075 G.f.: 1 / (1 + x / (1 + 2*x^2 / (1 - x / (1 - x / (1 + x))))). %F A257075 Given g.f. A(x), then x*A(x^2) = Sum_{k>0} (x^k - x^(2*k)) - 2*(x^(3*k) - x^(6*k)). %F A257075 a(n) = A131561(n+1) for all n in Z. %F A257075 a(n) = (-1)^n * A130151(n) for all n in Z. %F A257075 Convolution inverse is A257076. %F A257075 PSUM transform is A008611. %F A257075 BINOMIAL transform is A086953. %F A257075 1 / (1 - a(0)*x / (1 - a(1)*x / (1 - a(2)*x / ...))) is the g.f. of A168505. %F A257075 From _Wesley Ivan Hurt_, Jul 02 2016: (Start) %F A257075 a(n) = (1 + 2*cos(2*n*Pi/3) - 2*sqrt(3)*sin(2*n*Pi/3))/3. %F A257075 a(n) = 2*sgn((n+2) mod 3) - 1. (End) %F A257075 E.g.f.: (exp(3*x/2) + 4*sin(Pi/6-sqrt(3)*x/2))*exp(-x/2)/3. - _Ilya Gutkovskiy_, Jul 02 2016 %e A257075 G.f. = 1 - x + x^2 + x^3 - x^4 + x^5 + x^6 - x^7 + x^8 + x^9 - x^10 + ... %e A257075 G.f. = q - q^3 + q^5 + q^7 - q^9 + q^11 + q^13 - q^15 + q^17 + q^19 + ... %p A257075 A257075:=n->(-1)^(n mod 3): seq(A257075(n), n=0..100); # _Wesley Ivan Hurt_, Jul 02 2016 %t A257075 a[ n_] := (-1)^Mod[n, 3]; Table[a[n], {n, 0, 100}] %t A257075 LinearRecurrence[{0,0,1},{1,-1,1},80] (* or *) PadRight[{},100,{1,-1,1}] (* _Harvey P. Dale_, May 25 2023 *) %o A257075 (PARI) {a(n) = (-1)^(n%3)}; %o A257075 (PARI) {a(n) = 1 - 2 * (n%3 == 1)}; %o A257075 (PARI) {a(n) = [1, -1, 1][n%3 + 1]}; %o A257075 (PARI) {a(n) = my(A, p, e); n = abs(2*n + 1); A = factor(n); prod( k=1, matsize(A)[1], [p, e] = A[k,]; if( p==2, 0, p==3, -1, 1))}; %o A257075 (Magma) [(-1)^(n mod 3) : n in [0..100]]; // _Wesley Ivan Hurt_, Jul 02 2016 %Y A257075 Cf. A008611, A086953, A130151, A168505, A257076. %Y A257075 Essentially the same as A131561. %K A257075 sign,easy %O A257075 0,1 %A A257075 _Michael Somos_, Apr 15 2015