7 edited body edited May 28 '13 at 14:14 asd 844 bronze badges I would like to write a program in Mathematica to look for the integer $$n$$ such that the following definition holds for any $$1 < m < n$$ $$\frac{f(n)}{f(m)}>1+\frac{\log(n/m)}{\log(n) \log(\log(m))}$$ where $$f(n)$$ is for example number of divisors of $$n$$ (and also count the number of resulting sets). I wrote the following code, but the problem is that when it finds the first j1 in the next step of the For, it looks for the value j2 for which $$\frac{f(j_2)}{f(j_1)}>1+\frac{\log(j_2/j_1)}{\log(j_2) \log(\log( j_1))}$$ but I want it to find the j2 such that $$\forall j,\ j_1 \le j < j_2 \implies \frac{f(j_2)}{f(j)}>1+\frac{\log(j_2/j)}{\log (j_2) \log(\log(j))}$$ Note: In the following example k[*] is a special and known sub sequence of integers. i = 20; count = 0; list = {i}; For[j = i, j <= 500100, j++, If[ f[k[j]]/f[k[i]] > 1 + Log[k[j]/k[i]]/(Log[k[j]] Log[Log[k[i]]]), i = j; AppendTo[list, i]; count = count + 1 ] ]; list Print["count= ", count]  I would like to write a program in Mathematica to look for the integer $$n$$ such that the following definition holds for any $$1 < m < n$$ $$\frac{f(n)}{f(m)}>1+\frac{\log(n/m)}{\log(n) \log(\log(m))}$$ where $$f(n)$$ is for example number of divisors of $$n$$ (and also count the number of resulting sets). I wrote the following code, but the problem is that when it finds the first j1 in the next step of the For, it looks for the value j2 for which $$\frac{f(j_2)}{f(j_1)}>1+\frac{\log(j_2/j_1)}{\log(j_2) \log(\log( j_1))}$$ but I want it to find the j2 such that $$\forall j,\ j_1 \le j < j_2 \implies \frac{f(j_2)}{f(j)}>1+\frac{\log(j_2/j)}{\log (j_2) \log(\log(j))}$$ Note: In the following example k[*] is a special and known sub sequence of integers. i = 20; count = 0; list = {i}; For[j = i, j <= 500, j++, If[ f[k[j]]/f[k[i]] > 1 + Log[k[j]/k[i]]/(Log[k[j]] Log[Log[k[i]]]), i = j; AppendTo[list, i]; count = count + 1 ] ]; list Print["count= ", count]  I would like to write a program in Mathematica to look for the integer $$n$$ such that the following definition holds for any $$1 < m < n$$ $$\frac{f(n)}{f(m)}>1+\frac{\log(n/m)}{\log(n) \log(\log(m))}$$ where $$f(n)$$ is for example number of divisors of $$n$$ (and also count the number of resulting sets). I wrote the following code, but the problem is that when it finds the first j1 in the next step of the For, it looks for the value j2 for which $$\frac{f(j_2)}{f(j_1)}>1+\frac{\log(j_2/j_1)}{\log(j_2) \log(\log( j_1))}$$ but I want it to find the j2 such that $$\forall j,\ j_1 \le j < j_2 \implies \frac{f(j_2)}{f(j)}>1+\frac{\log(j_2/j)}{\log (j_2) \log(\log(j))}$$ Note: In the following example k[*] is a special and known sub sequence of integers. i = 20; count = 0; list = {i}; For[j = i, j <= 100, j++, If[ f[k[j]]/f[k[i]] > 1 + Log[k[j]/k[i]]/(Log[k[j]] Log[Log[k[i]]]), i = j; AppendTo[list, i]; count = count + 1 ] ]; list Print["count= ", count]  6 edited tags edited May 25 '13 at 20:21 asd 844 bronze badges I would like to write a program in Mathematica to look for the integer $$n$$ such that the following definition holds for any $$1 < m < n$$ $$\frac{f(n)}{f(m)}>1+\frac{\log(n/m)}{\log(n) \log(\log(m))}$$ where $$f(n)$$ is for example number of divisors of $$n$$ (and also count the number of resulting sets). I wrote the following code, but the problem is that when it finds the first j1 in the next step of the For, it looks for the value j2 for which $$\frac{f(j_2)}{f(j_1)}>1+\frac{\log(j_2/j_1)}{\log(j_2) \log(\log( j_1))}$$ but I want it to find the j2 such that $$\forall j,\ j_1 \le j < j_2 \implies \frac{f(j_2)}{f(j)}>1+\frac{\log(j_2/j)}{\log (j_2) \log(\log(j))}$$ Note: In the following example k[*] is a special and known sub sequence of integers. i = 20; count = 0; list = {i}; For[j = i, j <= 500, j++, If[ f[k[j]]/f[k[i]] > 1 + Log[k[j]/k[i]]/(Log[k[j]] Log[Log[k[i]]]), i = j; AppendTo[list, i]; count = count + 1 ] ]; list Print["count= ", count]  I would like to write a program in Mathematica to look for the integer $$n$$ such that the following definition holds for any $$1 < m < n$$ $$\frac{f(n)}{f(m)}>1+\frac{\log(n/m)}{\log(n) \log(\log(m))}$$ where $$f(n)$$ is number of divisors of $$n$$ (and also count the number of resulting sets). I wrote the following code, but the problem is that when it finds the first j1 in the next step of the For, it looks for the value j2 for which $$\frac{f(j_2)}{f(j_1)}>1+\frac{\log(j_2/j_1)}{\log(j_2) \log(\log( j_1))}$$ but I want it to find the j2 such that $$\forall j,\ j_1 \le j < j_2 \implies \frac{f(j_2)}{f(j)}>1+\frac{\log(j_2/j)}{\log (j_2) \log(\log(j))}$$ Note: In the following example k[*] is a special and known sub sequence of integers. i = 20; count = 0; list = {i}; For[j = i, j <= 500, j++, If[ f[k[j]]/f[k[i]] > 1 + Log[k[j]/k[i]]/(Log[k[j]] Log[Log[k[i]]]), i = j; AppendTo[list, i]; count = count + 1 ] ]; list Print["count= ", count]  I would like to write a program in Mathematica to look for the integer $$n$$ such that the following definition holds for any $$1 < m < n$$ $$\frac{f(n)}{f(m)}>1+\frac{\log(n/m)}{\log(n) \log(\log(m))}$$ where $$f(n)$$ is for example number of divisors of $$n$$ (and also count the number of resulting sets). I wrote the following code, but the problem is that when it finds the first j1 in the next step of the For, it looks for the value j2 for which $$\frac{f(j_2)}{f(j_1)}>1+\frac{\log(j_2/j_1)}{\log(j_2) \log(\log( j_1))}$$ but I want it to find the j2 such that $$\forall j,\ j_1 \le j < j_2 \implies \frac{f(j_2)}{f(j)}>1+\frac{\log(j_2/j)}{\log (j_2) \log(\log(j))}$$ Note: In the following example k[*] is a special and known sub sequence of integers. i = 20; count = 0; list = {i}; For[j = i, j <= 500, j++, If[ f[k[j]]/f[k[i]] > 1 + Log[k[j]/k[i]]/(Log[k[j]] Log[Log[k[i]]]), i = j; AppendTo[list, i]; count = count + 1 ] ]; list Print["count= ", count]  5 edited tags | link edited May 25 '13 at 20:15 asd 844 bronze badges 4 added 84 characters in body edited May 25 '13 at 20:03 rm -rf♦ 82k1919 gold badges257257 silver badges415415 bronze badges 3 added 16 characters in body edited May 25 '13 at 19:58 Dr. belisarius 108k1111 gold badges173173 silver badges390390 bronze badges 2 added 16 characters in body edited May 25 '13 at 19:52 Dr. belisarius 108k1111 gold badges173173 silver badges390390 bronze badges 1 asked May 25 '13 at 19:17 asd 844 bronze badges