OFFSET
1,2
COMMENTS
a(n) <= a(2) = 157 for all n <= 10^5. Is there any n for which a(n) > 157? - Robert Israel, Dec 01 2014
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
EXAMPLE
MAPLE
f:= proc(n)
local k;
if n = 10^ilog10(n) then return 0 fi;
for k from 1 do
if StringTools[Search]("666", sprintf("%d", n^k)) <> 0 then return k fi
od
end proc;
seq(f(n), n=1..1000); # Robert Israel, Dec 01 2014
MATHEMATICA
A248504[n_] := If[IntegerQ[Log10[n]], 0, Block[{k = 0}, While[StringFreeQ[IntegerString[n^++k], "666"]]; k]];
Array[A248504, 100] (* Paolo Xausa, Apr 08 2024 *)
PROG
(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); }
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
CROSSREFS
KEYWORD
nonn,base,less
AUTHOR
Talha Ali, Dec 01 2014
EXTENSIONS
More terms from Alois P. Heinz, Dec 01 2014
STATUS
approved