# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a109718 Showing 1-1 of 1 %I A109718 #31 Dec 14 2023 05:19:11 %S A109718 0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1, %T A109718 0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3, %U A109718 0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0,1,0,3,0 %N A109718 Periodic sequence with period {0,1,0,3}, or n^3 mod 4. %C A109718 Since n^(2k+1) mod 4 = n^3 mod 4 for k>1 this sequence also represents n^5 mod 4; and n^7 mod 4; etc. %H A109718 Index entries for linear recurrences with constant coefficients, signature (0,0,0,1). %F A109718 a(n) = n^3 mod 4. %F A109718 G.f. = (x+3*x^3)/(1-x^4). %F A109718 a(n) = (n mod 2)*(n mod 4) = (1+(-1)^(n+1))*(2+i^(n+1))/2 with i=sqrt(-1). - _Bruno Berselli_, Mar 14 2011 %o A109718 (Sage) [power_mod(n,3,4 )for n in range(0, 105)] # _Zerinvary Lajos_, Oct 29 2009 %o A109718 (Magma) &cat[[0,1,0,3]: k in [0..26]]; // _Bruno Berselli_, Mar 14 2011 %o A109718 (PARI) a(n)=n^3%4 \\ _Charles R Greathouse IV_, Apr 06 2016 %Y A109718 n mod 4 = A010873; n^2 mod 4 = A000035. %Y A109718 Cf. A110270; A131743. - _Bruno Berselli_, Mar 14 2011 %K A109718 easy,nonn %O A109718 0,4 %A A109718 Bruce Corrigan (scentman(AT)myfamily.com), Aug 09 2005 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE