# Finding all possible energy states faster without using a calculator

Homework Statement:
A 3 dimensional box with volume size L^3, the inner potential is zero and the
potential in its bound is infinite. There is a particle with the mass m, if the
system's energy range between ##100E_0## until ##136E_0## with ##E_0=\frac{n^2\pi ^2}{2mL^2}##. Find all possible number of states by:

1. Direct method
2. Approximation using phi = 3.14
3. If particle filled with 15 particles and each states only could be filled with 1 particle and the system is in the lowest energy, find the system's energy!
Relevant Equations:
##E_0=\frac{n^2\pi ^2}{2mL^2}##
I tried to find states in direct method using ##\frac{E}{E_0}=\:nx^2+ny^2+nz^2## and ##100\:<nx^2+ny^2+nz^2\:<\:136##
But it was too long, found it using phi approximation there are around 300 energy states, and Python find around 271 states using direct method but I need manual or recursive method to prove the direct method.

Python code: https://www.online-python.com/r4t0Fv7B3p

#### Attachments

• Capture.JPG
26.4 KB · Views: 6
Last edited by a moderator:

Steve4Physics
Homework Helper
Gold Member
Homework Statement:: A 3 dimensional box with volume size L^3, the inner potential is zero and the
potential in its bound is infinite. There is a particle with the mass m, if the
system's energy range between ##100E_0## until ##136E_0## with ##E_0=\frac{n^2\pi ^2}{2mL^2}##. Find all possible number of states by:

I tried to find states in direct method using ##\frac{E}{E_0}=\:nx^2+ny^2+nz^2## and ##100\:<nx^2+ny^2+nz^2\:<\:136##
But it was too long, found it using phi approximation there are around 300 energy states, and Python find around 271 states using direct method but I need manual or recursive method to prove the direct method
Hi @benagastov and welcome to PF.

There are some problems with the question.

It looks like ‘n’ in the given expression for energy should be ℏ.

The question should state that the box is a cube (though we can infer this from the question).

The question’s wording for the required energy-range is unclear. Possibilities would give:
a) ##100 < n_x^2 + n_y^2 + n_z^2 < 136##
b) ##100 < n_x^2 + n_y^2 + n_z^2 ≤ 136##
c) ##100 ≤ n_x^2 + n_y^2 + n_z^2 < 136##
d) ##100 ≤ n_x^2 + n_y^2 + n_z^2 ≤ 136##

(I ran a short program to count the states. I got 268 states for a) and c), but 271 states for b) and d)).

A simple program to do the counting seems a perfectly acceptable ‘direct’ method.

Note that there are many degenerate states. It is not clear if you are expected to determine the total number of states including degenerate ones, or count each set of degenerate states as one state.

However, if you are required to solve this with a direct manual method, you might be able to take advantage of the degeneracy. For example, if ##n_x, n_y## and ##n_z## are different (and give a valid energy), you get 6 (degenerate) states. This still sounds awkward. But that's all I can suggest.

benagastov
Thank you, the d) is the correct one (with 271 states). My Latex is wrong, sorry
##100 ≤ n_x^2 + n_y^2 + n_z^2 ≤ 136##

And with degeneracy, I still dont know how to calculate it in around 25 minutes. Would you mind to show me how to solve it faster? What I know is the maximum nx, ny and nz is 11 because 12 squared is equal to 144 which is not allowed

Can we use this mathematical method?
https://brilliant.org/wiki/fermats-sum-of-two-squares-theorem/
https://math.stackexchange.com/questions/17496/number-of-integer-solutions-of-x2-y2-k

Last edited:
Steve4Physics
Homework Helper
Gold Member
And with degeneracy, I still dont know how to calculate it in around 25 minutes. Would you mind to show me how to solve it faster? What I know is the maximum nx, ny and nz is 11 because 12 squared is equal to 144 which is not allowed
You mention ‘25 minutes’. Is this a timed examination question? That seems a bit rough!

The following approach will give the number of different energy-levels (most of which are degenerate).

Legendre’s three square theorem is described here: https://en.wikipedia.org/wiki/Legendre's_three-square_theorem I’ll use the link’s notation.

Consider 100≤n≤136. Using the three-square theorem, find how many (of the 37 different) values of n there are, that can not be expressed as the sum of three squares. We then know how many of the 37 values are allowed.

To do this, generate all the values of n=4ª(8b+7) in the range of interest using a=0,1,2,.. and b = 0,1,2…