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 A289138 #50 May 08 2021 23:06:36 %S A289138 1,36,7,6,5,6,3,56,9,0,1,16,7,6,5,6,3,76,9,0,1,96,7,6,5,6,3,96,9,0,1, %T A289138 76,7,6,5,6,3,16,9,0,1,56,7,6,5,6,3,36,9,0,1,36,7,6,5,6,3,56,9,0,1,16, %U A289138 7,6,5,6,3,76,9,0,1,96,7,6,5,6,3,96,9,0,1,76,7,6,5,6,3,16,9,0,1,56,7,6,5,6,3,36,9,0 %N A289138 a(n) = smallest expomorphic number in base n: least integer k such that n^k ends in k, or 0 if no such k exists. %C A289138 Definition: For positive integers b (the base) and n, the positive integer (allowing initial zeros) a(n) is expomorphic relative to base b if a(n) has exactly n decimal digits and if b^a(n) == a(n) (mod 10^n) or, equivalently, b^a(n) ends in a(n). [See Crux Mathematicorum link.] %C A289138 The only twelve values a(n) can take are 0, 1, 3, 5, 6, 7, 9, 16, 36, 56, 76 and 96; %C A289138 and the percentages of the time these occur are 10, 10, 10, 10, 20, 10, 10, 4, 4, 4, 4 and 4, respectively. %C A289138 The bases, n, for which k is: %C A289138 0: n == 0 (mod 10) %C A289138 1: n == 1 (mod 10) %C A289138 3: n == 7 (mod 10) %C A289138 5: n == 5 (mod 10) %C A289138 6: n == 4 or 6 (mod 10) %C A289138 7: n == 3 (mod 10) %C A289138 9: n == 9 (mod 10) %C A289138 16: n == +/- 12 (mod 50) %C A289138 36: n == +/- 2 (mod 50) %C A289138 56: n == +/- 8 (mod 50) %C A289138 76: n == +/- 18 (mod 50) %C A289138 96: n == +/- 22 (mod 50). %C A289138 Periodicity is 50. %H A289138 Charles W. Trigg, <a href="https://cms.math.ca/crux/backfile/Crux_v7n06_Jun.pdf"> Problem 559</a>, Crux Mathematicorum, page 192, Vol. 7, Jun. 1981. %H A289138 <a href="/index/Rec#order_50">Index entries for linear recurrences with constant coefficients</a>, signature (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1). %e A289138 a(4) is 6 since 4^6 = 4096 which ends in 6. %p A289138 f:= proc(n) local k; %p A289138 if n mod 10 = 0 then return 0 fi; %p A289138 for k from 1 do if n^k - k mod 10^(1+ilog10(k)) = 0 then return k fi od %p A289138 end proc: %p A289138 map(f, [$1..100]); # _Robert Israel_, Jul 07 2017 %t A289138 f[n_] := If[ Mod[n, 10] > 0, Block[{k = 1}, While[ PowerMod[n, k, 10^IntegerLength[k]] != k, k++]; k], 0]; Array[f, 88] %o A289138 (Python) %o A289138 def a(n): %o A289138 if n%10==0: return 0 %o A289138 k=1 %o A289138 while pow(n, k, 10**len(str(k)))!=k: k+=1 %o A289138 return k %o A289138 print([a(n) for n in range(1, 101)]) # _Indranil Ghosh_, Jun 29 2017 %Y A289138 Cf. A288845. %K A289138 easy,nonn,base %O A289138 1,2 %A A289138 _Bernard Schott_ and _Robert G. Wilson v_, Jun 28 2017