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 A248504 #31 Apr 08 2024 17:47:55 %S A248504 0,157,34,96,102,18,70,64,17,0,42,41,25,44,30,48,16,97,30,157,50,33, %T A248504 15,35,51,12,35,10,34,34,34,44,44,30,47,9,20,46,23,96,33,13,42,32,39, %U A248504 17,8,27,35,102,22,42,80,55,28,55,38,19,48,18,74,15,31,32,37 %N A248504 Least number k > 0 such that n^k contains 666 in its decimal representation, or 0 if no such k exists. %C A248504 a(n) <= a(2) = 157 for all n <= 10^5. Is there any n for which a(n) > 157? - _Robert Israel_, Dec 01 2014 %H A248504 Alois P. Heinz, <a href="/A248504/b248504.txt">Table of n, a(n) for n = 1..10000</a> %e A248504 a(2)=157 because 2^157=182687704666362864775460604089535377456991567872 contains '666' (see A007356). %e A248504 a(3)=34 because 3^34=16677181699666568 contains '666' and belongs to A051003. %p A248504 f:= proc(n) %p A248504 local k; %p A248504 if n = 10^ilog10(n) then return 0 fi; %p A248504 for k from 1 do %p A248504 if StringTools[Search]("666",sprintf("%d",n^k)) <> 0 then return k fi %p A248504 od %p A248504 end proc; %p A248504 seq(f(n), n=1..1000); # _Robert Israel_, Dec 01 2014 %t A248504 A248504[n_] := If[IntegerQ[Log10[n]], 0, Block[{k = 0}, While[StringFreeQ[IntegerString[n^++k], "666"]]; k]]; %t A248504 Array[A248504, 100] (* _Paolo Xausa_, Apr 08 2024 *) %o A248504 (PARI) isok(n) = {d = digits(n); for (i=1, #d-3, if ((d[i] == 6) && (d[i+1]==6) && (d[i+2]==6), return(1));); return (0);} %o A248504 a(n) = {if ((n==1) || (n==10) || (ispower(n,,&p) && (p==10)), return(0)); k = 1; while (! isok(n^k), k++); k;} \\ _Michel Marcus_, Dec 01 2014 %Y A248504 Cf. A007356, A051003. %K A248504 nonn,base,less %O A248504 1,2 %A A248504 _Talha Ali_, Dec 01 2014 %E A248504 More terms from _Alois P. Heinz_, Dec 01 2014