Finding out $n$ and $d$ so that $U_d(n)$ will be given set. This is a post related to somehow this one which I posted earlier. In this post the problem is solved so nicely, however, I am unable to utilize the same idea in this current situation.
Suppose $n$ is a positive integer and $d$ is its positive divisor. If $U(n)$ be the collection of all positive integers less than or equal to $n$ and coprime to $n$ and
$$U_d(n)=\{x\in \mathbb{N}: x\equiv 1\pmod{d}\}$$
how to find $n,d$ such that
$$U_d(n)=\{1,13,25,37\}$$
would hold ?
Clearly here $d$ is divisor of gcd of $1-1,13-1,25-1,37-1$ i.e. $12$. So $d=1,2,3,4,6,12$. How to show $d$ is $12$ only? In the above problem there were only two values 1 and 7. However here we are getting composite divisor as well.
Once we show that, how to find $n$ then?
Basically what I am searching for a general approach if there be any. Can someone help me out on this, please?
Post Work
After getting hints and suggestions ( thanks to both Erik Wong and cgss) I am trying to solve this problem as much as I can.
By Erik's answer, now I understand why $d=12$ only. Therefore $U_d(n)$ becomes now $U_{12}(n)$. Moreover, $12$ must divide $n$ and $n>37$ and each member of $U_{12}(n)$  must be of the form $12k+1$. However $25\in U_{12}(n)$ which means $25\in U(n)$ and so $(25,n)=1$ implying $(5,n)=1$. Thus $n$ must be 5 free.
We consider then, $$n=2^{a_1}3^{a_2}.m$$ where $a_1\geqslant 2, a_2\geqslant 1, m\in \mathbb{N}$ with $(2.3.5, m)=1$. Then
$$U_{12}(n)\simeq U\left(\frac{n}{12}\right)=U(2^{a_1-2}3^{a_2-1}m)$$ iff $(12, \frac{n}{12})=1$. This suggests that $a_1-2=0, a_2-1=0$ i.e. $a_1=2, a_2=1$ so that $n$ reduces to $n=2^2 3^1 m$.
Therefore
\begin{align*}
&|U_{12}(n)|=|U(2^0 3^0 m)|\\
\Rightarrow &4=\varphi(m)
\end{align*}
[The actual answers are $n=48, d=12$. Which means we now have to show $m=1$ in the above equation. The solution of $\varphi(m)=4$ are $m\in \{5,8,10,12\}$
But how can we show here $m=1$?]

First we’ll try to rule out smaller values of $d$.  They each fall in one of the two categories $d \mid 4$ and $d \mid 6$ (these two cases correspond to the two prime factors of $12$).
Suppose $d \mid 4$: then the fact that $U_d(n)$ doesn’t contain $5$ must be because $n$ is divisible by $5$, but then this contradicts $25 \in U_d(n)$.
Suppose $d \mid 6$: then the fact that $U_d(n)$ doesn’t contain $7, 19, 31$ must be because $n$ is divisible by all those primes.  But then $n > 169 = 13^2$, so in order to avoid $U_d(n)$ containing $169$ we need $n$ to be divisible by $13$, contradicting $13 \in U_d(n)$.
Now that we are assured $d=12$, there are a number of valid choices of $n$, and some amount of case-checking is unavoidable.  Firstly, in the range $37 \le n < 49$, all values of $n$ should work except for those divisible by exclusionary primes $5,13,37$.
Once we check values of $n \ge 49$, we need only consider $7 \mid n$.  Up to $n < 61$, this is also sufficient to exclude the only $12k+1$ number $49$ that causes trouble.
After $n \ge 61$, we need $7 \cdot 61 \mid n$.  But this forces $n \ge 169$, and as above we know that this is impossible because $13 \in U_d(n)$.
The general principle in both parts of this argument (isolating $d$ and then $n$) is that exclusions due to non-coprimality tend to yield larger and larger lower bounds for $n$, and eventually force $[1,n]$ to contain a number composed only of primes that we know something about.
