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 A051248 #32 Feb 23 2025 09:25:22 %S A051248 2,8,18,6,24,10,20,11,22,2,26,14,10,8,92,6,166,5,19,11,60,39,48,51,94, %T A051248 42,467,86,14,66,58,3,5268,33,58,10,45,70,23,6,205,70,31,15,50,84,248, %U A051248 70,72,94,107,170,30,10139,182,136,87,318,49,10,178,237,295,99,17,206 %N A051248 n^a(n) is the smallest power of n (with a(n) > 1) which starts with n. %C A051248 A070327(n) = n^a(n) for n > 1. - _Reinhard Zumkeller_, Sep 29 2011 %C A051248 The largest of the first 10000 terms is a(1955) = 119589011. - _Giovanni Resta_, May 27 2016 %H A051248 Giovanni Resta, <a href="/A051248/b051248.txt">Table of n, a(n) for n = 1..10000</a> (first 275 terms from Reinhard Zumkeller) %e A051248 2^8 = 256 begins with 2, and 2^k does not begin with 2 for any smaller integer k > 1, so a(2) = 8. %t A051248 f[n_]:=Module[{i=2},While[Take[IntegerDigits[n^i],IntegerLength[n]] != IntegerDigits[n],i++];i]; Array[f,70] (* _Harvey P. Dale_, Oct 04 2011 *) %o A051248 (Haskell) %o A051248 import Data.List (isPrefixOf) %o A051248 a051248 n = 2 + length %o A051248 (takeWhile (not . (show n `isPrefixOf`) . show) $ iterate (* n) (n^2)) %o A051248 -- _Reinhard Zumkeller_, Sep 29 2011 %o A051248 (Python) %o A051248 from itertools import count %o A051248 def a(n): %o A051248 s = str(n) %o A051248 return next(e for e in count(2) if str(n**e).startswith(s)) %o A051248 print([a(n) for n in range(1, 33)]) # _Michael S. Branicky_, Feb 23 2025 %Y A051248 Cf. A045537, A104782. %K A051248 nonn,base,nice %O A051248 1,1 %A A051248 _Michel ten Voorde_ %E A051248 More terms from _Jud McCranie_