OFFSET
1,1
COMMENTS
Trivially, (10*m)^k can end in any number of zeros. Thus numbers divisible by 10 are not included in this sequence.
This sequence contains only numbers that end in a 1, 3, or 7.
Those that end in 1 are congruent to {71, 231, 311, 391} (mod 400).
Those that end in 3 are congruent to {53, 133, 213, 373} (mod 400) or are a subsequence of 273 mod 320 (for n < 2000, only 593 == 273 (mod 320) but it is not a term of this sequence).
Those that end in 7 are congruent to {77, 237, 317, 397} (mod 400) or are a subsequence of 177 (mod 320) (for n < 2000, only 1457 == 177 (mod 320) but it is not a term of this sequence).
If a(n) ends in a 1, then a(n+1) ends in a 7 and a(n+1) = a(n)+6. Note that the converse is not true.
Fix an M large enough. There exist infinitely many k such that a(n)^k ends in M of the same digit. Those k values can be given as X mod Y for some X and Y. Take two consecutive powers k and k' that satisfy this. Let the digit immediately before the repeating digit in a(n)^k be called D and the digit immediately before the repeating digit in a(n)^k' be called D'. D - D' will always be odd for large enough M. Example: M = 4 and a(n) = 71. 71^k ends in 4 ones for k = 13, 263, 513, 763, ... == 13 (mod 250). Taking k = 13 and k' = 263, 71^13 ends in 31111 and 71^263 ends in 61111. Thus, D = 3 and D' = 6, and we see 3 - 6 is odd.
EXAMPLE
53^9 ends in 33. 53^29 ends in 333. 53^529 ends in 3333. 53^4529 ends in 33333. 53^49529 ends in 333333. This can continue for any number of 3's, where the exponent of 53 is some function based on how many 3's are at the end. We see f(2) = 9, f(3) = 29, f(4) = 529, f(5) = 4529, f(6) = 49529, and so on. Thus 53 is a term of this sequence.
PROG
(PARI)
a1(n, p, m)=hh=0; for(i=1, 10^p, st=(n^i)%10^p; w=digits(st); sb=(n^i)%10^(p+1); if(#w==p&&vecmin(w)==vecmax(w), hh++); if(hh==m, return((sb-st)/10^p)))
a2(n, p)=for(i=1, 10^p, v=digits((n^i)%10^p); if(#v==p&&vecmin(v)==vecmax(v), return(vecmin(v))))
seq(n)={p=3; while(p<10, if(!a2(n, p), return(0)); aa=a1(n, p, 3); di1=aa-a1(n, p, 2); di2=aa-a2(n, p); if(di1==Mod(0, 2)&&di2==Mod(1, 2), return(0)); if(di1==Mod(0, 2)&&di2==Mod(0, 2), p++); if(di1==Mod(1, 2), return(1)))}
n=1; while(n<2000, if(seq(n), print1(n, ", ")); n++)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Derek Orr, Jun 21 2014
STATUS
approved