Call a positive integer n 'good' if there exists m that m in the interval (32n,n) and n−mm,mn−m is not pretty. Next, we will prove the following claims.
Claim 1. If n is good then any multiple of n is also good.
Proof. Consider a good number n, there exists m∈(32n,n) such that mn−m and n−mm are not pretty. Hence, kn is not a good number because kmkn−km,kn−kmkm are not pretty. □
Claim 2. Consider a prime q such that there exists a prime r that 2022<r<q. For all pairs (p,k) with p is prime and k is positive integer such that pk>3⋅q!, number pk is good.
Proof. Choose m=3⋅q! then 32pk<pk−m<pk. Assume that mpk−m is pretty then there exists b<2023 and finite non-negative integers b0,b1,b2,…,bt that
mpk−m=i=0∑tbibi=btb0bt+b1bt−1+⋯+bt,
which means gcd(m,pk)m∣bt.
Hence, all prime divisors of m, except p, are smaller than 2022. On the other hand, m is divisible for q,r>2022 which implies that m still has a prime divisor larger than 2022 and differs from 2022, which is a contradiction. Therefore, mpk−m is not pretty.
Continue, assume that pk−mm is pretty. Similarly, gcd(m,pk−m)pk−m only has prime divisors that are smaller than 2022. Assume that there exists a prime number p1<2022 such that
p1∣mpk−m⟶p1∣pk⟶p1=p,
which means p<2022 and there exists l>0 that
pl⋅gcd(m,pk−m)=pk−m.
Let m=ps⋅t where (p,t)=1, the above equation becomes
pl⋅ps=pk−ps⋅t or pk−s−t=pl.
Note that pk−s>1 then p∣pk−s. We also have gcd(t,p)=1 then gcd(pl,p)=1 or l=0, which means gcd(m,pk−m)pk−m=1 or pk−m∣m<3pk, which is a contradiction.
Hence, both pk−mm and mpk−m are not pretty, or pk is good. □
Back to the original problem, let N be the number of the numbers that have the form pk and not exceed Q=3⋅q!. We will point out that all positive integers n>QN is good. Assume that the prime factorization of n is as follows
n=i=1∏tpiαi.
If piαi<Q for all i≤t then n≤Qt≤QN, a contradiction.
Therefore, there exists an index i such that piαi>Q, which means piαi is good by Claim 2. Hence, n is the multiple of piαi and n is good by Claim 1. The problem is solved. □