

A033940


a(n) = 10^n mod 7.


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
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,2


COMMENTS

This sequence can be employed in a test for divisibility by seven. Given the decimal expansion of some natural number, it is easily shown that the following sum has the same remainder under division by seven as the original number and that this sum is strictly smaller than the original number: Successively take the digits of the number in reverse order and multiply each of them by the respective term of the sequence A033940, then sum the products. By repeating this process, since the sums decrease in size, one ends up with seven if and only if the initial number is divisible by seven. Example: 43638 is divisible by seven since 8*1 + 3*3 + 6*2 + 3*6 + 4*4 = 63 and 3*1 + 6*3 = 21 and 1*1 + 2*3 = 7.  Peter C. Heinig (algorithms(AT)gmx.de), Apr 16 2007
Representation of (3^n) in the circle with seven equidistant points, (10^n) mod 7=(3^n) mod 7.  Eric Desbiaux, Feb 15 2009
Representation of multiples of 3 in the circle (with seven equidistant points), see the Chryzodes links.  Eric Desbiaux, Feb 14 2009
Equivalently 3^n mod 7.  Zerinvary Lajos, Nov 24 2009
Continued fraction expansion of (269+11*sqrt(1086))/490. Decimal expansion of 1195/9009.  Klaus Brockhaus, May 24 2010
Period 6: Repeat [1, 3, 2, 6, 4, 5].  Wesley Ivan Hurt, Jul 06 2014


LINKS

Vincenzo Librandi, Table of n, a(n) for n = 0..1000
JeanPaul Sonntag, Chryzodes "3in7"
JeanPaul Sonntag, Chryzodes
Index entries for linear recurrences with constant coefficients, signature (1,0,1,1).


FORMULA

a(n) = 10^n mod 7 = 3^n mod 7.
a(n) = a(n1)  a(n3) + a(n4) for n>3; a(n) = a(n6) for n>5; G.f.: (1+2*xx^2+5*x^3)/((1x)*(1+x)*(1x+x^2)); a(n) = 7/2 7*(1)^n/6 4*A010892(n)/3A010892(n1)/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


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 *)


PROG

(Sage) [power_mod(10, n, 7)for n in xrange(0, 106)] # Zerinvary Lajos, Nov 24 2009
(Sage) [power_mod(3, n, 7)for n in xrange(0, 106)] # Zerinvary Lajos, Nov 24 2009
(MAGMA) [Modexp(10, n, 7): n in [0..100]]; // Vincenzo Librandi, Feb 05 2011
(PARI) a(n)=3^n%7 \\ Charles R Greathouse IV, Oct 07 2015


CROSSREFS

Cf. A010892, A178247.
Sequence in context: A182546 A123042 A121647 * A286367 A196047 A106409
Adjacent sequences: A033937 A033938 A033939 * A033941 A033942 A033943


KEYWORD

nonn,easy


AUTHOR

Jeff Burch


STATUS

approved



