cp's OEIS Frontend

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.

A239121 Smallest number k > 0 such that the decimal expansion of k^k contains n.

This page as a plain text file.
%I A239121 #15 Apr 09 2019 09:57:14
%S A239121 9,1,3,5,2,4,4,3,7,9,10,11,5,19,22,26,8,17,16,19,9,8,13,7,17,4,17,3,
%T A239121 11,18,13,5,23,17,18,7,17,15,9,18,16,17,9,7,12,28,6,23,9,24,23,13,18,
%U A239121 11,7,14,4,18,14,13,19,11,25,17,17,6,6,8,14,27,11,26,8
%N A239121 Smallest number k > 0 such that the decimal expansion of k^k contains n.
%H A239121 Giovanni Resta, <a href="/A239121/b239121.txt">Table of n, a(n) for n = 0..10000</a>
%e A239121 a(0) = 9 because 9^9 = 387420489 has "0" as a substring;
%e A239121 a(1) = 1 because 1^1 = 1 has "1" as a substring;
%e A239121 a(2) = 3 because 3^3 = 27 has "2" as a substring;
%e A239121 a(3) = 5 because 5^5 = 3125 has "3" as a substring;
%e A239121 a(4) = 2 because 2^2 = 4 has "4" as a substring.
%t A239121 a[n_] := (k = 1; While[ !MatchQ[ IntegerDigits[k^k], {___, Sequence @@ IntegerDigits[n], ___}], k++]; k); Table[a[n], {n, 0, 80}] (*program from Jean-Francois Alcover adapted for this sequence - see A030001 *)
%t A239121 snk[n_]:=Module[{k=1},While[SequenceCount[IntegerDigits[k^k],IntegerDigits[ n]]<1,k++];k]; Array[snk,80,0] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Apr 09 2019 *)
%o A239121 (PARI) overlap(long, short)=my(D=10^#digits(short)); while(long>=short, if(long%D==short, return(1)); long\=10); 0
%o A239121 a(n)=my(k); while(!overlap(k++^k, n), ); k \\ _Charles R Greathouse IV_, Mar 11 2014
%Y A239121 Cf. A030001.
%K A239121 nonn,base
%O A239121 0,1
%A A239121 _Michel Lagneau_, Mar 10 2014