A033940 a(n) = 10^n mod 7.
1, 3, 2, 6, 4, 5, 1, 3, 2, 6, 4, 5, 1, 3, 2, 6, 4, 5, 1, 3, 2, 6, 4, 5, 1, 3, 2, 6, 4, 5, 1, 3, 2, 6, 4, 5, 1, 3, 2, 6, 4, 5, 1, 3, 2, 6, 4, 5, 1, 3, 2, 6, 4, 5, 1, 3, 2, 6, 4, 5, 1, 3, 2, 6, 4, 5, 1, 3, 2, 6, 4, 5, 1, 3, 2, 6, 4, 5, 1, 3, 2, 6, 4, 5, 1, 3, 2, 6, 4, 5, 1, 3, 2, 6, 4, 5, 1, 3, 2, 6, 4, 5, 1, 3, 2, 6
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- Jean-Paul Sonntag, Chryzodes "3in7"
- Jean-Paul Sonntag, Chryzodes
- Index entries for linear recurrences with constant coefficients, signature (1,0,-1,1).
Programs
-
Magma
[Modexp(10, n, 7): n in [0..100]]; // Vincenzo Librandi, Feb 05 2011
-
Maple
A033940:=n->3^n mod 7: seq(A033940(n), n=0..100); # Wesley Ivan Hurt, Jul 05 2014
-
Mathematica
Table[PowerMod[10, n, 7], {n, 0, 200}] (* Vladimir Joseph Stephan Orlovsky, Jun 10 2011 *) Mod[3^Range[0, 100], 7] (* Wesley Ivan Hurt, Jul 06 2014 *)
-
PARI
a(n)=3^n%7 \\ Charles R Greathouse IV, Oct 07 2015
-
Sage
[power_mod(10,n, 7)for n in range(0,106)] # Zerinvary Lajos, Nov 24 2009
-
Sage
[power_mod(3, n, 7)for n in range(0,106)] # Zerinvary Lajos, Nov 24 2009
Formula
a(n) = 10^n mod 7 = 3^n mod 7.
a(n) = a(n-1) - a(n-3) + a(n-4) for n>3; a(n) = a(n-6) for n>5; G.f.: (1+2*x-x^2+5*x^3)/((1-x)*(1+x)*(1-x+x^2)); a(n) = 7/2 -7*(-1)^n/6 -4*A010892(n)/3-A010892(n-1)/3. - R. J. Mathar, Feb 13 2009
a(n) = (21 - 7*cos(n*Pi) - 8*cos(n*Pi/3) - 4*sqrt(3)*sin(n*Pi/3))/6. - Wesley Ivan Hurt, Jun 23 2016
Comments