Because N>0, we need to have x>y>0 for any solution. Since x2−y2=(x+y)(x−y), each solution gives a factorisation of N into two factors, say N=a⋅b, where a=x+y>x−y=b.
If we start with a factorisation N=a⋅b with a>b, there is at most one solution (x,y) corresponding to this factorisation of N, namely
x=2a+by=2a−b.
The condition on a,b for giving an integer solution (x,y) is a≡b(mod2) so that a+b and a−b are both even. If N is odd, any factorisation into two positive integers will give a solution. When N is even, however, both factors must be even and N=4M for some integer M. Each factorisation of M into two non-equal factors will then provide a solution.
To find all factorisations of N, we write N=p1a1p2a2p3a3⋯pkak where all ai>0 and p1<p2<⋯<pk. It is well known that the number of positive divisors of n is then equal to τ(N)=(a1+1)(a2+1)⋯(ak+1). If τ(N) is even, which is the case precisely when N is not a perfect square, the number of factorisations of N into two factors is equal to τ(N)/2. If N is a square, we only get (τ(N)−1)/2 factorisations with a>b.
For the equation to have exactly 24 solutions, we need to use N odd with τ(N)=48 or τ(N)=49, or N=4M with τ(M)=48 or τ(M)=49. There is no need to consider N=4M with odd M since M<4M and we are looking for the smallest N.
Because ai>0 for all i, there are only two possibilities to obtain τ(N)=(a1+1)(a2+1)⋯(ak+1)=72=49, namely k=1 and a1=48, or k=2 and a1=a2=6.
The smallest odd N=p148 is 348. The smallest N=4M is 250 where we have used M=248. Clearly, 348=2716>1616=264>250.
The smallest odd N=p16p26 is N=36⋅56. The smallest N=4M is N=28⋅36 with M=26⋅36. Note that 250=28⋅421>28⋅36 and 36⋅56>36⋅44=28⋅36. Hence, the smallest N we found so far is N0=28⋅36.
We now aim at finding all N for which τ(N)=48=3⋅24. Since ai+1≥2 we can have at most k=5 different prime factors in N. We distinguish cases according to the number k. We will always assure that a1≥a2≥⋯≥ak, because this gives the smallest possible odd N when p1<p2<⋯<pk are the k smallest odd primes. When we allow p1=2, we need to consider N=4M, i.e. N=p1a1+2p2a2p3a3⋯pkak with p1=2.
**Case 1 (k=5):** The only option here is a1=2 and a2=a3=a4=a5=1, which leads to N=p12p2p3p4p5 and the smallest odd number of this shape is N1=32⋅5⋅7⋅11⋅13. The smallest even number N=4M we obtain here is N2=4⋅22⋅3⋅5⋅7⋅11=24⋅3⋅5⋅7⋅11.
(5,1,1,1)(3,2,1,1)
The smallest odd N here are N3=35⋅5⋅7⋅11 and N5=33⋅52⋅7⋅11. The smallest even numbers are N4=27⋅3⋅5⋅7 and N6=25⋅32⋅5⋅7, respectively.
**Case 3 (k=3):** There are four possibilities for (a1,a2,a3):
(11,1,1)(5,3,1)(7,2,1)(3,3,2)
This leads to the following eight possibilities for N:
(11,1,1)(5,3,1)(7,2,1)(3,3,2)N7=311⋅5⋅7N9=35⋅53⋅7N11=37⋅52⋅7N13=33⋅53⋅72N8=213⋅3⋅5N10=27⋅33⋅5N12=29⋅32⋅5N14=25⋅33⋅52
**Case 4 (k=2):** There are four possibilities for (a1,a2):
(23,1)(11,3)(7,5)(15,2)
This leads to the following eight possibilities for N:
(23,1)(11,3)(7,5)(15,2)N15=323⋅5N17=311⋅53N19=37⋅55N21=315⋅52N16=225⋅3N18=213⋅33N20=29⋅35N22=217⋅32
Case 5 (k = 1): The only option is a1=23 leading to odd N23=323 and even N24=225.
To find the smallest value of N, we first note that 2a+2<3a for all a≥4. This is easily shown by induction. This implies that N2m<N2m−1 for all m=1,2,…,12 except for m=1,3,7. After cancelling common factors, it is easy to see that
N2N6N14=24⋅3⋅5⋅7⋅11<N1=32⋅5⋅7⋅11⋅13=25⋅32⋅5⋅7<N5=33⋅52⋅7⋅11=25⋅33⋅52<N13=33⋅53⋅72.
This shows that the smallest N is one of the N2m where m=0,1,2,…,12. If we compare all N2m with N6 we will find that N6=25⋅32⋅5⋅7=10080 is the smallest positive N for which x2−y2=N has exactly 24 solutions in positive integers.
To show N6<N2m in each case we cancel the common factors of these two numbers. To reduce our work, we may first observe that 32⋅5⋅7=316<29, hence when N2m has a factor 2a with a≥14 it is clear that N6<N2m. Similarly, N6<N2m when N2m has a factor 2a⋅3 with a≥12, because 3⋅5⋅7=105<27. Finally, since 5⋅7=35<26, whenever N2m has a factor 2a⋅32 with a≥11 we also have N6<N2m. This last case can be extended to those N2m that have a factor 2a⋅32+i with a≥11−i.