Conditions n∣3m+1 and m∣n2+3 we label by (1) and (2).
By (1) 3 and n are coprime: (3,n)=1 (3).
Let n≤9. Due to (3) n can take 1,5,7.
If n=1 from (2) m∣4 and since m is odd we get m=1. (m,n)=(1,1) satisfies the conditions.
If n=5 (1) and (2) become 5∣3m+1 and m∣28. Since m is odd m∣7 but m=1,7 do not satisfy the condition 5∣3m+1.
If n=7 (1) and (2) become 7∣3m+1 and m∣52. Since m is odd m∣13 but m=1,13 do not satisfy the condition 7∣3m+1.
Now n>9. By (1) and (2) there are positive integers p,q such that np=3m+1 and mq=n2+3.
Now let us prove that m≥n+1. If m≤n then 4n>3m+1. Therefore, p can be only 1,2 or 3. But if p=3 then 3∣1 and if p=1 we get np≡1≡0≡3m+1(mod2). Thus, p=2.
Now m∣n2+3⇒m∣4n2+12=(2n)2+12=(3m+1)2+12⇒m∣13. Thus, m=1,13. Since n=23m+1 if m=1 then n=2 and if m=13 then n=23⋅13+1=20. In both cases n is even, contradiction. Thus, we have proved that m≥n+1.
Now n(n+1)>n2+3=mq≥(n+1)q⇒q<n.
From (1) n∣3m+1⇒n∣3mq+q=3(n2+3)+q⇒n∣q+9. Thus, n≤q+9.
Now since q<n and 9<n we get n≤q+9<n+n=2n. Therefore, q+9=n and we get n2+3=mq=m(n−9).
Then m(n−9)−n2−3=0⇒(m−n−9)(n−9)=84=3⋅4⋅7.
Since m−n−9 is odd and n−9 is even 4∣n−9. Since by (1) (n−9,3)=1 we get that either m−n−9=3,n−9=4⋅7 or m−n−9=3⋅7,n−9=4.
In the first case (m,n)=(49,37) and in the second case (m,n)=(43,13). These pairs satisfy the conditions.
Thus, there are three solutions: (m,n)=(1,1), (49,37), (43,13).