%I #58 Dec 12 2023 09:17:58
%S 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 -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 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,1,1,-1,1,1,-1,1,1,-1,1,1,-1,1,1,-1,1,1,-1,1,1,-1,1,1
%N Period 3: repeat [1, 1, -1].
%C Other than the first term, this sequence represents numerators in a fraction expansion of log(2) - Pi/8. - _Mohammad K. Azarian_, Sep 27 2011
%C Also, the arithmetic function uhat(n,3,3) as defined in A291041. - _Robert Price_, Aug 25 2017
%D Mohammad K. Azarian, Problem 1218, Pi Mu Epsilon Journal, Vol. 13, No. 2, Spring 2010, p. 116. Solution published in Vol. 13, No. 3, Fall 2010, pp. 183-185.
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,1).
%F a(n) = (4*cos((2*n - 1) * Pi/3) + 1) / 3. - Federico Acha Neckar (f0383864(AT)hotmail.com), Sep 02 2007
%F G.f.: (1+x-x^2)/((1-x)*(x^2+x+1)). - _R. J. Mathar_, Nov 14 2007
%F G.f.: (1+x-x^2)/(1-x^3). - _Jaume Oliver Lafont_, Mar 24 2009
%F a(n) = (-1)^((n-1) mod 3). - _Christopher Richmond_, Oct 07 2011
%F a(n) = a(n-1)^2 - a(n-1) - a(n-2), for a(0),a(1) = 1,1; or same repeating pattern with 1,-1 or -1,1 as initial values. - _Richard R. Forberg_, Jun 13 2013
%F a(n+1) = A257075(n) for all n in Z. - _Michael Somos_, May 13 2015
%F a(n) = a(n-3) for n>2. - _Wesley Ivan Hurt_, Jul 02 2016
%F Product_{n >= 1} (1 + a(n-1)*x^n) = 1 + x + x^2 + x^5 + x^7 + x^12 + x^15 + ... = Sum_{n >= 0} x^A001318(n), a companion identity to Euler's pentagonal number theorem. - _Peter Bala_, Aug 30 2017
%e G.f. = 1 + x - x^2 + x^3 + x^4 - x^5 + x^6 + x^7 - x^8 + x^9 + x^10 + ...
%p A131561 := proc(n) op((n mod 3)+1,[1,1,-1]) ; end: seq(A131561(n), n=0..120); # _R. J. Mathar_, Oct 18 2007
%t Table[(-1)^Mod[n-1,3], {n, 0, 120}] (* _Michael De Vlieger_, Mar 07 2015 *)
%t PadRight[{},120,{1,1,-1}] (* _Harvey P. Dale_, Mar 15 2021 *)
%o (PARI) a(n)=1-2*(n%3==2) /* _Jaume Oliver Lafont_, Mar 24 2009 */
%o (Magma) &cat [[1, 1, -1]^^30]; // _Wesley Ivan Hurt_, Jul 02 2016
%Y Cf. A257075, A291041.
%K sign,easy
%O 0,1
%A _Paul Curtz_, Aug 27 2007
%E Edited by _N. J. A. Sloane_, Sep 15 2007
|