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 A193680 #77 Jan 03 2025 02:14:45 %S A193680 0,1,2,0,2,1,0,1,2,0,2,1,0,1,2,0,2,1,0,1,2,0,2,1,0,1,2,0,2,1,0,1,2,0, %T A193680 2,1,0,1,2,0,2,1,0,1,2,0,2,1,0,1,2,0,2,1,0,1,2,0,2,1,0,1,2,0,2,1,0,1, %U A193680 2,0,2,1,0,1,2,0,2,1,0,1,2,0,2,1,0,1,2,0,2,1 %N A193680 Period 6 sequence 0,1,2,0,2,1. %C A193680 This sequence can be extended periodically to negative values of n. %C A193680 See a comment on A203571 where a k-family of 2k-periodic sequences P_k has been defined. The present sequence is P_3. - _Wolfdieter Lang_, Feb 02 2012 %H A193680 Rémi Guillaume, <a href="/A193680/a193680_2.txt">Formulas for A193680, and some proofs</a>. %H A193680 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,0,1). %F A193680 a(n) = n (mod 3) if (-1)^floor(n/3)=+1 else (3 - n)(mod 3), n>=0. (-1)^floor(n/3) is the parity of the quotient floor(n/3), sometimes denoted by n\3. %F A193680 O.g.f.: x*(1+2*x+2*x^3+x^4)/(1-x^6). %F A193680 a(n) = 1-((-1)^(n+1)+cos(Pi*n/3)+3*cos(2*Pi*n/3))/3. - _R. J. Mathar_, Oct 07 2011, corrected by _Vaclav Kotesovec_, Feb 19 2023 %F A193680 a(n) = floor((71/364)*3^(n+1)) mod 3. - _Hieronymus Fischer_, Jan 04 2013 %F A193680 a(n) = floor((4007/333333)*10^(n+1)) mod 10. - _Hieronymus Fischer_, Jan 04 2013 %F A193680 From _Amiram Eldar_, Jan 01 2023: (Start) %F A193680 Multiplicative with a(2^e) = 2, a(3^e) = 0, and a(p^e) = 1 for p >= 5. %F A193680 Dirichlet g.f.: zeta(s)*(1+1/2^s-1/3^s-1/6^s). (End) %e A193680 a(8) = 8(mod 3) = 2 because (-1)^floor(8/3)= +1; 8\3 = 2 is even. %e A193680 a(4) = (3-4)(mod 3) = 2, because (-1)^floor(4/3) is -1; 4\3 = 1 is odd. %t A193680 Table[{0, 1, 2, 0, 2, 1}, {15}] // Flatten (* _Jean-François Alcover_, Jun 21 2013 *) %t A193680 PadRight[{},120,{0,1,2,0,2,1}] (* _Harvey P. Dale_, Jul 25 2020 *) %o A193680 (PARI) a(n)=[0,1,2,0,2,1][n%6+1] \\ _Charles R Greathouse IV_, Oct 07 2011 %Y A193680 Cf. signed versions A112300, A186809. %K A193680 nonn,easy,mult %O A193680 0,3 %A A193680 _Wolfdieter Lang_, Sep 30 2011 %E A193680 Keyword:mult added by _Andrew Howroyd_, Jul 31 2018