Total number of turns in solenoid N = nl
Magnetic field inside the long solenoid B = μ₀ni
Flux through one turn Φ₁ = BA = μ₀niA
Thus total flux through N turns Φt = NΦ₁ = nl × μ₀niA = μ₀n²lAi
Using Φt = Li where L is the self inductance of the coil
∴ μ₀n²lAi = Li
⇒ L = μ₀n²Al