Faster finding of all cubic numbers I want to improve the performance of this program.

count = 0
store = []
n = 9238899039
for i in range(1,n):
    if i*i*i &lt;= n:
        count += 1
        store.append(i)
print count


At the moment it is very slow. I need to find all cubic numbers up to n.
There's no reason to use brute force like that.  I couldn't even get the program to complete without crashing.

To find the count, just take the cube root of n, and round down.  Then, it's a simple matter to construct the list you need.

n = 9238899039
count = int(n ** (1.0/3))
store = range(1, count + 1)