A289138 a(n) = smallest expomorphic number in base n: least integer k such that n^k ends in k, or 0 if no such k exists.
1, 36, 7, 6, 5, 6, 3, 56, 9, 0, 1, 16, 7, 6, 5, 6, 3, 76, 9, 0, 1, 96, 7, 6, 5, 6, 3, 96, 9, 0, 1, 76, 7, 6, 5, 6, 3, 16, 9, 0, 1, 56, 7, 6, 5, 6, 3, 36, 9, 0, 1, 36, 7, 6, 5, 6, 3, 56, 9, 0, 1, 16, 7, 6, 5, 6, 3, 76, 9, 0, 1, 96, 7, 6, 5, 6, 3, 96, 9, 0, 1, 76, 7, 6, 5, 6, 3, 16, 9, 0, 1, 56, 7, 6, 5, 6, 3, 36, 9, 0
Offset: 1
Examples
a(4) is 6 since 4^6 = 4096 which ends in 6.
Links
- Charles W. Trigg, Problem 559, Crux Mathematicorum, page 192, Vol. 7, Jun. 1981.
- Index entries for linear recurrences with constant coefficients, signature (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1).
Crossrefs
Cf. A288845.
Programs
-
Maple
f:= proc(n) local k; if n mod 10 = 0 then return 0 fi; for k from 1 do if n^k - k mod 10^(1+ilog10(k)) = 0 then return k fi od end proc: map(f, [$1..100]); # Robert Israel, Jul 07 2017
-
Mathematica
f[n_] := If[ Mod[n, 10] > 0, Block[{k = 1}, While[ PowerMod[n, k, 10^IntegerLength[k]] != k, k++]; k], 0]; Array[f, 88]
-
Python
def a(n): if n%10==0: return 0 k=1 while pow(n, k, 10**len(str(k)))!=k: k+=1 return k print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 29 2017
Comments