Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I used this as input

Table[600851475143/i , {i, 1, 600851475143}]

but got an error

Table::iterb:Iterator {i,1,600851475143} does not have appropriate bounds.

But this gives me no error why?:

Table[600851475143/i , {i, 1, 13}]
share|improve this question
1  
If the error message is followed by two little angle brackets (>>) you can click on these to read more about the error. I didn't realize this for a while... :) –  cormullion May 12 '12 at 9:17
1  
LoL. I was just going to write the same question for the third problem of the project Euler, then the SE suggested your question. I laughed when I saw the number. –  Vladimir Putin Aug 26 '12 at 10:51
    
I solved it like this: Select[Divisors[600851475143], PrimeQ] –  Vladimir Putin Aug 26 '12 at 10:58
    
Last[Select[Divisors[600851475143], PrimeQ]] for more speed! –  Vladimir Putin Aug 26 '12 at 11:02

2 Answers 2

up vote 11 down vote accepted

This is because the number you used is extremely large. The number of iterations supported (in either Table or Do) seems to be $2^{31}-1$, i.e. the maximum size of a signed machine integer. I believe this is also an upper bound on the size of an array in Mathematica.

This limitation is not unreasonable: the size of the Table you are trying to construct is too large to fit into memory anyway. (Even if each element could be stored on a single byte, you'd be asking for 600 GB of memory.)

If you change the step size in the iterator to a large number, it will work:

Table[600851475143/i, {i, 1, 600851475143, 100000000}]
share|improve this answer
    
Thanks......... –  The-Ever-Kid May 6 '12 at 10:53
    
@Szabolcs This is weird, isn't 1 the default step size? I did Table[x, {x, 1, 10}] and it gives me {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}. –  Vladimir Putin Aug 26 '12 at 10:54
    
@Szabolcs I also tried the same with this 600851475143/Range[1, 600851475143, 1] and it still gives me this error. –  Vladimir Putin Aug 26 '12 at 10:59
    
@Gustavo Yes, 1 is the default step size. I don't understand your comment, can you explain? –  Szabolcs Nov 12 '12 at 19:55

As Szabolcs has said the trouble lies in the size of the table you are trying to produce.

It does not however stop you plotting the function you want to investigate.

Plot[600851475143/i, {i, 1, 600851475143}]

Mathematica graphics

Or sampling the function at discrete steps and then plotting it as in:

z=Table[600851475143/i, {i, 1, 600851475143, 10^6}];
ListPlot[z];

Mathematica graphics

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.