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 A098174 #12 Jun 30 2018 07:08:37 %S A098174 1,4,9,2,3,4,5,8,16,1,1,1,1,1,1,1,1,1,1,4,4,3,3,3,3,3,3,5,7,9,25,2,2, %T A098174 2,2,2,2,2,2,2,2,2,2,2,5,11,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5, %U A098174 5,5,5,5,5,6,6,6,6,7,7,7,8,8,9,9,10,10,11,12,13,14,16,18,20,23,27,32,40,53 %N A098174 a(n) is the smallest e > 0 such that the initial digit of n^e = 1 in decimal representation. %C A098174 A000030(n^a(n)) = 1; A098175(n) = n^a(n). %C A098174 From _Rémy Sigrist_, Jun 25 2018: (Start) %C A098174 We can extend this sequence to every Gaussian integers as follows: %C A098174 - for any Gaussian integer z, let f(z) be the least k > 0 such that the initial decimal digit of the real part of z^k equals 1, or -1 if no such k exists, %C A098174 - naturally f(n) = a(n) for any n > 0, %C A098174 - apparently f(z) = -1 iff z = 0, %C A098174 - see Links section for the color plot of f. %C A098174 (End) %H A098174 Rémy Sigrist, <a href="/A098174/b098174.txt">Table of n, a(n) for n = 1..10000</a> %H A098174 Rémy Sigrist, <a href="/A098174/a098174.png">Color plot of f(x + i*y) for x = -200..1000 and y = -200..500</a> %o A098174 (PARI) a(n, base=10) = my (nk=n); for (k=1, oo, my (z); logint(nk, base, &z); if (nk\z==1, return (k), nk*=n)) \\ _Rémy Sigrist_, Jun 21 2018 %Y A098174 Cf. A000030, A098175, A131835. %K A098174 nonn,base %O A098174 1,2 %A A098174 _Reinhard Zumkeller_, Aug 30 2004