Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #18 Oct 23 2018 06:25:52
%S 0,3,1,2,2,1,3,0,0,3,1,2,2,1,3,0,0,3,1,2,2,1,3,0,0,3,1,2,2,1,3,0,0,3,
%T 1,2,2,1,3,0,0,3,1,2,2,1,3,0,0,3,1,2,2,1,3,0,0,3,1,2,2,1,3,0,0,3,1,2,
%U 2,1,3,0,0,3,1,2,2,1,3,0,0,3,1,2,2,1,3,0,0,3,1,2,2,1,3,0
%N Period 8: repeat [0,3,1,2,2,1,3,0].
%C Permutation of {0,1,2,3} followed by its reversal, repeated.
%H Antti Karttunen, <a href="/A111951/b111951.txt">Table of n, a(n) for n = 0..8191</a>
%H <a href="/index/Rec#order_07">Index entries for linear recurrences with constant coefficients</a>, signature (1,-1,1,-1,1,-1,1).
%F G.f.: (3x + x^2 + 2x^3 + 2x^4 + x^5 + 3x^6)/(1 - x^8);
%F a(n) = a(n-1) - a(n-2) + a(n-3) - a(n-4) + a(n-5) - a(n-6) + a(n-7);
%F a(n) = n(7n-1)/2 mod 4 = A022264(n) mod 4.
%F G.f.: -x*(3 - 2*x + 4*x^2 - 2*x^3 + 3*x^4) / ( (x-1)*(1+x^2)*(1+x^4) ). - _R. J. Mathar_, Feb 20 2015
%F a(n) = (3 + r/2 - s/2 + 2*cos(Pi*(1+2*n-r-s+t)/8) - 2*cos(Pi*(1-2*n+r-s+t)/8) - 2*sin(Pi*(1-2*n-r+s+t)/8))/2 where r = 2*sin(n*Pi/2), s = 2*cos(n*Pi/2) and t = cos(n*Pi). - _Wesley Ivan Hurt_, Oct 05 2018
%o (Scheme) (define (A111951 n) (list-ref '(0 3 1 2 2 1 3 0) (modulo n 8))) ;; _Antti Karttunen_, Aug 10 2017
%Y Cf. A110549, A110550.
%K easy,nonn
%O 0,2
%A _Paul Barry_, Aug 22 2005
%E Name changed, the original name moved to comments. - _Antti Karttunen_, Aug 10 2017