If m=2a⋅5b⋅s, with gcd(s,10)=1, then m10t−1 is short if and only if s divides 10t−1. So we may (and will) suppose without loss of generality that gcd(m,10)=1. Define
C={1⩽c⩽2017:gcd(c,10)=1}.
The m-tastic numbers are then precisely the smallest exponents t>0 such that 10t≡1(modcm) for some integer c∈C, that is, the set of orders of 10 modulo cm. In other words,
S(m)={ordcm(10):c∈C}.
Since there are 4⋅201+3=807 numbers c with 1⩽c⩽2017 and gcd(c,10)=1, namely those such that c≡1,3,7,9(mod10),
∣S(m)∣⩽∣C∣=807.
Now we find m such that ∣S(m)∣=807. Let
P={1<p⩽2017:p is prime, p=2,5}
and choose a positive integer α such that every p∈P divides 10α−1 (e.g. α=φ(T), T being the product of all primes in P), and let m=10α−1.
Claim. For every c∈C, we have
ordcm(10)=cα
As an immediate consequence, this implies ∣S(m)∣=∣C∣=807, finishing the problem.
Proof. Obviously ordm(10)=α. Let t=ordcm(10). Then
cm∣10t−1⟹m∣10t−1⟹α∣t.
Hence t=kα for some k∈Z>0. We will show that k=c.
Denote by νp(n) the number of prime factors p in n, that is, the maximum exponent β for which pβ∣n. For every ℓ⩾1 and p∈P, the Lifting the Exponent Lemma provides
νp(10ℓα−1)=νp((10α)ℓ−1)=νp(10α−1)+νp(ℓ)=νp(m)+νp(ℓ)
So
cm∣10kα−1⟺∀p∈P;νp(cm)⩽νp(10kα−1)⟺∀p∈P;νp(m)+νp(c)⩽νp(m)+νp(k)⟺∀p∈P;νp(c)⩽νp(k)⟺c∣k.
The first such k is k=c, so ordcm(10)=cα.