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 A033940 #60 Sep 08 2022 08:44:51 %S A033940 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, %T A033940 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, %U A033940 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 %N A033940 a(n) = 10^n mod 7. %C A033940 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 %C A033940 Representation of (3^n) in the circle with seven equidistant points, (10^n) mod 7=(3^n) mod 7. - _Eric Desbiaux_, Feb 15 2009 %C A033940 Representation of multiples of 3 in the circle (with seven equidistant points), see the Chryzodes links. - _Eric Desbiaux_, Feb 14 2009 %C A033940 Equivalently 3^n mod 7. - _Zerinvary Lajos_, Nov 24 2009 %C A033940 Continued fraction expansion of (269+11*sqrt(1086))/490. Decimal expansion of 1195/9009. - _Klaus Brockhaus_, May 24 2010 %C A033940 Period 6: Repeat [1, 3, 2, 6, 4, 5]. - _Wesley Ivan Hurt_, Jul 06 2014 %H A033940 Vincenzo Librandi, <a href="/A033940/b033940.txt">Table of n, a(n) for n = 0..1000</a> %H A033940 Jean-Paul Sonntag, <a href="http://www.chryzode.org/english/ligne.htm">Chryzodes "3in7"</a> %H A033940 Jean-Paul Sonntag, <a href="http://www.chryzode.org/">Chryzodes</a> %H A033940 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,-1,1). %F A033940 a(n) = 10^n mod 7 = 3^n mod 7. %F A033940 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 %F A033940 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 %p A033940 A033940:=n->3^n mod 7: seq(A033940(n), n=0..100); # _Wesley Ivan Hurt_, Jul 05 2014 %t A033940 Table[PowerMod[10, n, 7], {n, 0, 200}] (* _Vladimir Joseph Stephan Orlovsky_, Jun 10 2011 *) %t A033940 Mod[3^Range[0, 100], 7] (* _Wesley Ivan Hurt_, Jul 06 2014 *) %o A033940 (Sage) [power_mod(10,n, 7)for n in range(0,106)] # _Zerinvary Lajos_, Nov 24 2009 %o A033940 (Sage) [power_mod(3, n, 7)for n in range(0,106)] # _Zerinvary Lajos_, Nov 24 2009 %o A033940 (Magma) [Modexp(10, n, 7): n in [0..100]]; // _Vincenzo Librandi_, Feb 05 2011 %o A033940 (PARI) a(n)=3^n%7 \\ _Charles R Greathouse IV_, Oct 07 2015 %Y A033940 Cf. A010892, A178247. %K A033940 nonn,easy %O A033940 0,2 %A A033940 _Jeff Burch_