OFFSET
1,3
COMMENTS
a(n) = n if and only if n is a power of 3.
Conjecture: a(n) = n-1 if and only if n is a long period prime (A006883), that is, n is a prime and the decimal expansion of 1/n has period n-1.
If gcd(n,30) = 1 then a(n) = A084680(n). - Robert Israel, Jun 25 2020
EXAMPLE
a(4) = 2 since when 1, 11, 111, 1111 are divided by 4 the remainders are 1, 3, 3, 3, two different numbers.
a(6) = 3 since when 1, 11, 111, 1111, 11111, 111111 are divided by 6 the remainders are 1, 5, 3, 1, 5, 3, three different numbers.
MAPLE
with(ListTools): a := proc (n) return add(10^i, i = 0 .. n-1) end proc: r := proc (n) return seq(`mod`(a(i), n), i = 1 .. n) end proc: seq(nops(MakeUnique([r(n)])), n = 1 .. 243);
# Simpler:
f:= n -> nops({seq(((10^i-1)/9) mod n, i=1..n)}):
map(f, [$1..100]); # Robert Israel, Jun 25 2020
MATHEMATICA
Table[Length@ Union@ Array[Mod[(10^# - 1)/9, n] &, n], {n, 81}] (* Michael De Vlieger, Jun 28 2020 *)
PROG
(PARI) a(n) = #Set(vector(n, k, (10^k-1)/9) % n); \\ Michel Marcus, Jun 15 2020
CROSSREFS
KEYWORD
AUTHOR
Sen-Peng Eu, May 19 2020
STATUS
approved