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 A045537 #43 Feb 23 2025 09:25:31 %S A045537 2,2,5,5,3,2,2,5,5,3,2,11,14,10,8,26,6,17,5,11,5,6,10,15,3,2,19,15,7, %T A045537 8,5,11,3,14,14,10,6,10,6,11,3,6,18,5,11,5,18,9,5,3,2,3,7,16,17,11,3, %U A045537 5,9,11,2,6,7,7,11,17,15,8,5,11,5,9,8,5,8,3,2,16,21,11,5,6,14,4,11,22,22,7 %N A045537 Least nontrivial exponent e such that n is a substring of n^e. %H A045537 Reinhard Zumkeller and Zak Seidov, <a href="/A045537/b045537.txt">Table of n, a(n) for n = 0..10000</a>. Terms up to a(1000) from Reinhard Zumkeller. %H A045537 Code Golf StackExchange, <a href="https://codegolf.stackexchange.com/questions/176734/self-contained-powers">Self-contained powers</a>, coding challenge started Nov 28 2018. %H A045537 <a href="/index/Ar#automorphic">Index entries for sequences related to automorphic numbers</a> %F A045537 n^a(n) = A104782(n). %t A045537 f[n_] := Block[{k = 2}, While[ StringPosition[ ToString[n^k], ToString[n]] == {}, k++ ]; k]; Table[ f[n], {n, 0, 87}] (* _Robert G. Wilson v_, May 09 2005 *) %o A045537 (Haskell) %o A045537 import Data.List (isInfixOf) %o A045537 a045537 n = 2 + length %o A045537 (takeWhile (not . ((show n) `isInfixOf`) . show) $ iterate (* n) (n^2)) %o A045537 -- _Reinhard Zumkeller_, Sep 29 2011 %o A045537 (PARI) a(n) = my(s = Str(n), k=2); while (#strsplit(Str(n^k), s) == 1, k++); k; \\ _Michel Marcus_, Jun 04 2024 %o A045537 (Python) %o A045537 from itertools import count %o A045537 def a(n): %o A045537 s = str(n) %o A045537 return next(e for e in count(2) if s in str(n**e)) %o A045537 print([a(n) for n in range(88)]) # _Michael S. Branicky_, Feb 23 2025 %Y A045537 Cf. A051248, A070327, A104782. %K A045537 base,nonn %O A045537 0,1 %A A045537 _Erich Friedman_