Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #16 Apr 16 2023 22:13:21
%S 1,1,1,1,2,2,2,2,3,3,3,3,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,0,0,0,0,1,1,
%T 1,1,2,2,2,2,3,3,3,3,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,0,0,0,0,1,1,1,1,
%U 2,2,2,2,3,3,3,3,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,0,0,0,0,1,1,1,1,2,2,2,2,3
%N n modulo 4 repeated 4 times.
%C Periodic with length 4^2 = 16.
%H <a href="/index/Rec#order_13">Index entries for linear recurrences with constant coefficients</a>, signature (1, 0, 0, -1, 1, 0, 0, -1, 1, 0, 0, -1, 1).
%F a(n) = (1 + floor(n/4)) mod 4.
%F a(n) = A010873(A002265(n+4)).
%F a(n) = 1 + floor(n/4) - 4*floor((n+4)/16).
%F a(n) = (((n+4) mod 16) - (n mod 4))/4.
%F a(n) = ((n + 4 - (n mod 4))/4) mod 4.
%F G.f. g(x) = (1 + x + x^2 + x^3 + 2x^4 + 2x^5 + 2x^6 + 2x^7 + 3x^8 + 3x^9 + 3x^10 + 3x^11)/(1-x^16).
%F G.f. g(x) = ((1-x^4)*(1+2x^4+3x^8))/((1-x)*(1-x^16)).
%F G.f. g(x) = (3x^16-4x^12+1)/((1-x)*(1-x^4)*(1-x^16)).
%F G.f. g(x) = (1+2x^4+3x^8)/((1-x)*(1+x^4)*(1+x^8)).
%t Flatten[Table[Table[Mod[n,4],{4}],{n,30}]] (* _Harvey P. Dale_, Dec 22 2013 *)
%o (Python)
%o def A133874(n): return 1+(n>>2)&3 # _Chai Wah Wu_, Jan 18 2023
%Y Cf. A000040, A133620-A133625, A133630, A038509, A133634-A133636.
%Y Cf. A133884, A133880, A133890, A133900, A133910.
%K nonn
%O 0,5
%A _Hieronymus Fischer_, Oct 10 2007