OFFSET
1,2
COMMENTS
LINKS
Bui Quang Tuan, Table of n, a(n) for n = 1..101
FORMULA
a(n) = 10^floor(n/2) - 2*floor(n/2) + n - 2 = 10^floor(n/2)-(1+(-1)^n)/2 - 1 for n>1, a(1) = 1.
EXAMPLE
1^1 = 1 has 1 digit, and 1 is divisible by 1.
8^8 = 16777216 has 8 digits, and 8 is divisible by 8.
98^98 has 196 digits, and 196 is divisible by 98.
MATHEMATICA
Select[Range@10000, Mod[IntegerLength[#^#], #] == 0 &] (* Michael De Vlieger, Mar 17 2015 *)
Join[{1}, Table[(10^Floor[n/2] - 2 Floor[n/2] + n - 2), {n, 2, 30}]] (* Vincenzo Librandi, Mar 18 2015 *)
PROG
(PARI) isok(n) = !(#digits(n^n) % n); \\ Michel Marcus, Mar 17 2015
(Magma) [1] cat [10^Floor((n+1)/2)-2*Floor((n+1)/2)+n-1: n in [1..30]]; // Vincenzo Librandi, Mar 18 2015
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Bui Quang Tuan, Mar 17 2015
STATUS
approved