login
A387142
a(n) is the smallest integer k >= 2 such that the digit string of prime(n) is contained as a substring in the digit string of prime(n)^k.
2
5, 5, 2, 5, 11, 10, 17, 11, 15, 8, 11, 10, 6, 5, 9, 16, 11, 6, 8, 9, 5, 11, 4, 7, 6, 5, 22, 4, 22, 29, 20, 6, 29, 8, 11, 11, 15, 34, 15, 18, 13, 29, 47, 5, 61, 11, 4, 30, 8, 27, 28, 38, 26, 3, 21, 20, 17, 14, 11, 15, 48, 11, 5, 29, 7, 22, 27, 12, 32, 11, 13, 30
OFFSET
1,1
FORMULA
a(n) = A045537(prime(n)). - Michel Marcus, Sep 23 2025
EXAMPLE
a(10) = 8 because the digit string of prime(10) = 29 is contained as a substring in the digit string of 29^8 = 500246412961 and for k = 2..7 this is not the case.
MAPLE
A387142:=proc(n)
local k, p, q;
p:=ithprime(n);
q:=convert(p, 'base', 10);
for k from 2 do
if verify(q, convert(p^k, 'base', 10), 'sublist') then
return k
fi
od;
end proc;
seq(A387142(n), n=1..72);
MATHEMATICA
a[n_]:=Module[{k=2}, While[SequenceCount[IntegerDigits[Prime[n]^k], IntegerDigits[Prime[n]]]==0, k++]; k]; Array[a, 72] (* James C. McMahon, Sep 26 2025 *)
PROG
(PARI) a(n) = my(k=2, p=prime(n), s=Str(p)); while(#strsplit(Str(p^k), s) < 2, k++); k; \\ Michel Marcus, Sep 23 2025
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Felix Huber, Sep 22 2025
STATUS
approved