Let call the numbers satisfying the given condition as "good" number. Consider some good number n. One can see that if n is even, then d=2 is a divisor of 2, however, then 12 and 20262 both divide 2027 with remainder 1, which does not satisfy. Therefore, n is odd. We see that n=1 satisfies the given condition.
Now consider n>1 and set n=p1a1p2a2…pkak with p1,p2,…,pk being distinct odd primes and a1,a2,…,ak positive integers. Since τ(n)2∣n, τ(n) is also odd.
We have τ(n)=(a1+1)(a2+1)⋯(ak+1) which is odd, so a1,a2,…,ak are all even. Therefore, n must be a perfect square. Note that if k≥3 then n≥(3⋅5⋅7)2>2027, is not satisfied. Hence k∈{1;2}. We consider the following cases.
1. If k=1 then n=p2m with p being an odd prime and m∈Z+. Note that if 2m≥6 then τ(n)≥7 so p≥7 and n≥76>2027, does not satisfy. Therefore, we reduce to considering if 2m=2 then p=3 so n=9; and if 2m=4 then τ(n)=5 so p=5, which implies n=54=625. We can check that the numbers n=9,n=625 all satisfy condition (ii).
2. If k=2 then n=p2aq2b with p,q being distinct odd primes and a,b∈Z+. Note that if both 2a and 2b≥4 then n≥(3⋅5)4>2027, is not satisfied. Therefore, we can assume 2b=2, which implies that 3∣τ(n) so p=3 or q=3.
a. If q=3 then n=9p2a, then if 2a=2 then τ(n)=9 so 92∣n, is not satisfied; therefore 2a≥4 so n≥9⋅54>2027, is also not satisfied.
b. If p=3 then n=32aq2; if 2a=2 then the same absurdity exists, so 2a>2. But if 2a≥6 then n≥36⋅52>2027, is not satisfied. Therefore 2a=4 and 5∣τ(n) so q=5, implies n=2025. We see that this number satisfies condition (ii).
Therefore n∈{9;625;2025}. We will prove that these numbers are good.
Consider an arbitrary positive divisor d of n then d is odd. Suppose there exist u,v∈{1;2;…;2026} and u=v such that ud≡vd(mod2027). Let s be the inverse of v modulo 2027 then let t=us, we have td≡1(mod2027). Next, let h=ord2027(t) then h∤d and by Fermat's little theorem h∤2026 so h∤gcd(d,2026). Note that 2026=2⋅1013 with 1013 being a prime number, it is easy to see that gcd(d,2026)=1 and h=1. Then, we will have
t≡1(mod2027)⟺us≡1(mod2027).
Multiplying both sides of this congruence by v gives u≡v(mod2027), which is absurd. Thus, all positive divisors d of these n satisfy condition (i).
So all the good numbers are 1,9,625,2025. □