The mid points of two small magnetic dipoles of length in end-on positions, are separated by a distance (). The magnitude of force between them is proportional to where n is:

The magnetic field produced by the first dipole at the center of the second dipole along its axis is
Tagged Bar magnet as a magnetic dipole. Machine-assigned, so read it as a strong shortlist rather than a verdict.