OFFSET
1,2
COMMENTS
Numbers with two consecutive zeros are not considered, to avoid the case 0^0. Nevertheless, even if we consider 0^0=1 the results do not change (at least up to m=10^8).
EXAMPLE
For 1899 we have: 9^9 + 9^8 + 8^1 + 1^9 = 430467219.
Finally 430467219/1899 = 226681.
For 1954329 we have: 9^2 + 2^3 +3^4 + 4^5 + 5^9 + 9^1 + 1^9 = 1954329.
MAPLE
with(numtheory): P:=proc(q) local a, b, k, ok, n; for n from 10 to q do a:=[]; b:=n;
while b>0 do a:=[op(a), b mod 10]; b:=trunc(b/10); od; b:=0; ok:=1; for k from 2 to nops(a)
do if a[k-1]=0 and a[k]=0 then ok:=0; break; else b:=b+a[k-1]^a[k]; fi; od;
if ok=1 then if type((b+a[nops(a)]^a[nops(1)])/n, integer) then print(n);
fi; fi; od; end: P(10^10);
PROG
(PARI) isok(n) = d = digits(n); k = #d; (sum(i=1, k-1, j=k-i+1; d[j]^d[(j-1)])+ d[1]^d[k]) % n == 0; \\ Michel Marcus, Sep 29 2014
CROSSREFS
KEYWORD
nonn,base,fini,full
AUTHOR
Paolo P. Lava, May 29 2014
EXTENSIONS
a(1)-a(9) prepended and a(23) from Hiroaki Yamanouchi, Sep 29 2014
STATUS
approved