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 A060588 #27 Oct 05 2016 10:06:44 %S A060588 0,2,1,2,1,0,1,0,2,0,2,1,2,1,0,1,0,2,0,2,1,2,1,0,1,0,2,0,2,1,2,1,0,1, %T A060588 0,2,0,2,1,2,1,0,1,0,2,0,2,1,2,1,0,1,0,2,0,2,1,2,1,0,1,0,2,0,2,1,2,1, %U A060588 0,1,0,2,0,2,1,2,1,0,1,0,2,0,2,1,2,1,0,1,0,2,0,2,1,2,1,0,1,0,2,0,2,1,2,1,0 %N A060588 If the final two digits of n written in base 3 are the same then this digit, otherwise mod 3-sum of these two digits. %C A060588 From _William Walkington_, Sep 14 2016: (Start) %C A060588 With offset 1, the y-coordinates of position vectors from the origin (point 1) to the points numbered 1 to N^2 of the magic tori that display the Agrippa odd-order-N magic squares can be expressed as follows: a(n) = (-(n-1)-floor((n-1)/N)) mod N. %C A060588 This generates the y-coordinates of the magic tori that display the Agrippa order-3 "Saturn," order-5 "Mars," order-7 "Venus," order-9 "Luna," and higher-odd-order-N magic squares. %C A060588 Therefore, if the odd-order-N of the torus is 3, then the resulting sequence 0,2,1,2,1,0,1,0,2 represents the y-coordinates of position vectors from the origin (point number 1) to the point numbered 1 to 9 of the magic torus that displays the Agrippa order-3 "Saturn" magic square. (End) %D A060588 H.C. Agrippa, "De occulta philosophia Libri tres," (1533) translated by "J.F." (John French?) and printed by Moule, London, in 1651, Book II, chapter XXII entitled "Of the tables of the Planets, their vertues,forms, and what Divine names, Intelligencies, and Spirits are set over them." %H A060588 H. C. Agrippa, <a href="http://www.esotericarchives.com/agrippa/agripp2b.htm#chap22">De Occulta Philosophia libri tres (Three books of occult philosophy), Book II, chapter XXII</a>, Digital edition Peterson J.F. %H A060588 W. Walkington, <a href="https://carresmagiques.blogspot.fr/2016/09/magic-torus-coordinate-and-vector_10.html">Magic torus coordinate and vector symmetries</a>. %H A060588 William Walkington, <a href="/A060588/a060588.jpg">Agrippa odd-order magic squares</a> %H A060588 Wikipedia, <a href="https://en.wikipedia.org/wiki/Magic_square#Europe">Agrippa's magic squares</a>. %H A060588 <a href="/index/Fi#final">Index entries for sequences related to final digits of numbers</a> %F A060588 a(n) = a(n-9) = (-[n/3]-n) mod 3 = A060587(n) mod 3. %F A060588 a(n) = (-n - floor(n/3)) mod 3. - _William Walkington_, Sep 14 2016 %e A060588 a(22)=1 since 22 is written in base 3 as 211 and the final two digits are 1; a(23)=0 since 23 is written in base 3 as 212 and the final two digits are 1 and 2 and 3-(1+2)=0. %t A060588 b3d[n_]:=Module[{d3=Take[IntegerDigits[n,3],-2]},If[MatchQ[d3,{x_, x_}], d3[[1]],3-Total[d3]]]; Join[{0,2,1},Array[b3d,110,3]] (* _Harvey P. Dale_, Feb 29 2016 *) %t A060588 Table[If[MatchQ @@ #, First@ #, Mod[3 - Total@ #, 3]] &@ Take[PadLeft[#, 2], -2] &@ IntegerDigits[n, 3], {n, 0, 120}] (* or *) %t A060588 Table[Mod[-n - Floor[n/3], 3], {n, 0, 120}] (* _Michael De Vlieger_, Sep 14 2016 *) %Y A060588 Cf. A060582, A270740. %K A060588 base,nonn %O A060588 0,2 %A A060588 _Henry Bottomley_, Apr 04 2001