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 A342932 #48 May 25 2021 12:29:28 %S A342932 3,1,2,3,3,1,1,3,1,2,2,1,1,3,1,3,1,3,3,3,2,3,3,2,1,1,2,1,3,1,2,1,1,3, %T A342932 3,2,2,3,1,3,2,2,2,3,3,1,2,2,2,2,2,1,3,2,2,3,2,2,1,2,1,3,2,2,3,1,1,1, %U A342932 1,1,3,2,2,2,3,3,2,1,3,1,1,2,2,3,1,3,2,3,2,3,1,1,3,1,2,3,3,2,3,2,3,1,1,2,3 %N A342932 The unique sequence {a(1), a(2), a(3), a(4), ...} of digits 1, 2, or 3 such that the number a(n)a(n-1)...a(2)a(1), read in base 6, is divisible by 3^n. %C A342932 The distribution seems to be uniform but random (empirical observation). %C A342932 To prove that such a digit sequence exists and is unique is a good (but uncommon) example of a proof by induction. %H A342932 Rémy Sigrist, <a href="/A342932/a342932.png">Colored scatterplot of (n, 3*o(n)-n) for = 1..1000000</a> (where o corresponds to the ordinal transform of the sequence) %H A342932 Eugen Ionascu, <a href="/A342932/a342932.nb">Mathematica File</a> %e A342932 3 is divisible by 3^1; %e A342932 13_6 = 1*6 + 3 = 9, which is divisible by 3^2, %e A342932 213_6 = 2*6^2 + 1*6 + 3 = 81, which is divisible by 3^3. %t A342932 nd[n_] := Module[{k, i, s, ss, L, a}, L = Array[f, n]; f[1] = 3; %t A342932 Do[s = Sum[6^(k - 1)*f[k], {k, 1, i - 1}]; %t A342932 ss = Mod[2^(i - 1)*s/3^(i - 1), 3]; %t A342932 If[ss == 0, f[i] = 3, If[ss == 1, f[i] = 2, f[i] = 1]], {i, 2, n}]; %t A342932 s = Sum[6^(k - 1)*f[k], {k, 1, n}]; %t A342932 {L, s/3^n}] %o A342932 (Python) %o A342932 n, div, divnum = 0, 1, 0 %o A342932 while n < 87: %o A342932 div, a = 3*div, 1 %o A342932 while (a*6**n+divnum)%div != 0: %o A342932 a = a+1 %o A342932 divnum, n = divnum+a*6**n, n+1 %o A342932 print(a, end=', ') # _A.H.M. Smeets_, Apr 13 2021 %o A342932 (PARI) { q=0; t=1; for (n=1, 105, print1 (d=[3,1,2][1+lift(-q/Mod(t,3))]", "); q=(t*d+q)/3; t*=2) } \\ _Rémy Sigrist_, Apr 15 2021 %Y A342932 Cf. A023396, A053312, A126933. %K A342932 nonn,base %O A342932 1,1 %A A342932 _Eugen Ionascu_, Mar 29 2021