Is it possible to count over the set of natural numbers on a quantum computing system? On a classical computer, the maximum possible number you can count to is a finite number. I've asked around about this, and generally there has been opinion one way or another, but it seems to me that this is the case. This is because a classical computer has a finite number of transistors, and so a finite address space. You can store a truncated version of bigger numbers, but you would need somewhere to store the rest of the number in order to perform the incrementation operation. For example, in Java the maximum number you can count to is determined by the numbers stored in BigInteger, which is determined by memory space.
Using a single qubit, however, an integer can be stored in the probability. If the state of the qubit is
sqrt(1/N)|0> + sqrt(1 - 1/N) |1>, where |0> and |1> are the two states of the qubit and so the probability that the qubit is in the state |0> is 1/N, this probability can be measured by measuring the qubit several times and then inverting the number. N be any natural number, and so the qubit can be used to count to arbitrarily high numbers unlike the classical computer. Incrementing between numbers and finding the number of measurements needed is relatively straightforward, and I have described them in the papers https://www.researchgate.net/publication/344239568_Circuit_Design_of_a_Qubit_Counter and  https://www.researchgate.net/publication/337679430_A_Study_On_the_Potential_for_Quantum_Supremacy. There is another thread post on this forum that asks how many qubits you need to store the answer 16, and the answer given was 4, but I think the answer should be 1.
I don't see anything wrong with this, so tell me what you think.
I just want to mention also that this way of storing numbers is useful because it leads to a very resource efficient algorithm for addition and multiplication. For example if you have one qubit in the state sqrt(1/n)|0> + sqrt(1 - 1/n)|1> and another qubit is in the state (1/m)|0> + sqrt(1 - 1/m)|1>, the state of the two qubits is the tensor product
(sqrt(1/n)|0> + sqrt(1 - 1/n))|1> X ((1/m)|0> + sqrt(1 - 1/m)|1>)
And the probability that the system is in the state |00> is 1/nm and the probability the qubit is in the state |11> is (nm - n -m + 1)/nm, so we got addition and multiplication without having to perform any gates. You just need measurements. Ofcourse you need to peform a gate on each of the qubits individually.
Also, it may seem this is an analog system, but actually it is both digital and analog since the probability is continuous but the states involved are discrete. So it differs from an analog system in that instead of having to detect a continuous signal you are distinguishing between discrete states (and quantum error correction can be used). The probability is still analog but there are still advantages of a discrete representation over a strictly continuous signal.
Another way this differs from analog systems is that a single qubit can involve a single atom or even elementary particle, whereas an analog circuit is larger and involves billions of atoms.
Finally, regarding precision it should noted that if the probability that the state is 0 is desired (as in stochastic computing) the number of measurements required scales exponentially with the number of digits of precision which is not efficient. But if the value 1/N is desired it can easily be shown that the desired number of measurements required is polynomial in N. So this is actually efficient contrary to what many may think. And again this is just one qubit so noise can be dealt with using the Shor code.
 A: 
this probability can be measured by measuring the qubit several times

Every measurement will give you the same result because of wave function collapse, so repeated measurements tell you no more than one.
If you prepare many qubits in the same state and measure each of them once, then you can estimate $N$ (with larger values of $N$ requiring more measurements). But this is a very inefficient way of storing $N$. Also, the same is true of classical bits if the prepared state is 0 with probability $1/N$ and 1 with probability $1-1/N$. There are differences between classical and quantum probability, but your construction doesn't depend on any of those differences.
A: This sounds like it is possible but there are some practical limitations. Big integers are spaced very close together in your setup so you need high accuracy to discern them. This means that you need many measurements to be able to read out your numbers. The closer these states are together, the harder they are to read out and the more measurements you need.
A second problem with this high accuracy is that qubits are very sensitive to noise (maybe this will be better in the future who knows). Since these large integers are so close together this could mean in this case that your $N=20$ is changed to $N=22$ by noise. But I don't know enough about qubits to quantify the strength of the noise.
Possible food for thought. You could space out your states more evenly. This means that every number gets the same spacing instead of the higher numbers getting less spacing. This means you could only represent a finite amount of integers. Let's call the integer $j$ and let it run from $0...N$. Then we could have
$$|j\rangle=\sqrt{\frac j N}|0\rangle+\sqrt{1-\frac j N}|1\rangle$$
or
$$|j\rangle=\cos\left(\frac{j\pi}{2n}\right)|0\rangle+\sin\left(\frac{j\pi}{2n}\right)|1\rangle$$
Also note that spin already shows similar counting behaviour. See for example ladder operators.
