OFFSET
1,1
EXAMPLE
The last digits of 3^87 are ...853387, so 387 is a term.
MATHEMATICA
end[x_, y_, n_] := x>0 && y*Log[x] >= Log[n] && PowerMod[x, y, 10^ IntegerLength[ n]] == n; ok[n_] := Block[{p=1}, While[(p *= 10) < n &&
! end[Floor[n/p], Mod[n, p], n]]; p < n]; Select[Range[10^5], ok]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Giovanni Resta, Jun 06 2016
STATUS
approved