Limits and While Loops Question: Consider the following program. Does $f(1)=\infty$? 
  
  \begin{align*}
f(i):=&amp;|\text{while } \frac{1}{i}&gt;0\\
&amp;||i\leftarrow i+1\\
&amp;|i
\end{align*}


I would say that $f(1)=\infty$ is a true statement. The program does not terminate, but one could consider the sequence of points $\{x_i\}_{i\in \mathbb{N}}$ given by $x_i:=\frac{1}{i}$, so that  $\{x_i\}_{i\in \mathbb{N}}$ converges to the limit $0$ which makes $\underbrace{\frac{1}{i}}_{=0}&gt;0$ false which means $f(1)=\infty$. However, I could be wrong.
The only thing we can say here is that $f(1)$ is not defined, or that the program does not terminate for the input $1$.

We cannot say that $f(1)=0$.
Instead of a while-loop, a better programming analogy of limits is the lazy list.

In Haskell:

naturals = [1..]
my_limit = [1/n n &lt;- naturals]
take 100 my_limit


Outputs:

[1.0,0.5,0.3333333333333333,0.25,0.2,0.16666666666666666,0.14285714285714285,0.125,0.1111111111111111,0.1,9.090909090909091e-2,8.333333333333333e-2,7.692307692307693e-2,7.142857142857142e-2,6.666666666666667e-2,6.25e-2,5.8823529411764705e-2,5.555555555555555e-2,5.263157894736842e-2,5.0e-2,4.7619047619047616e-2,4.5454545454545456e-2,4.3478260869565216e-2,4.1666666666666664e-2,4.0e-2,3.8461538461538464e-2,3.7037037037037035e-2,3.571428571428571e-2,3.4482758620689655e-2,3.333333333333333e-2,3.225806451612903e-2,3.125e-2,3.0303030303030304e-2,2.9411764705882353e-2,2.857142857142857e-2,2.7777777777777776e-2,2.702702702702703e-2,2.631578947368421e-2,2.564102564102564e-2,2.5e-2,2.4390243902439025e-2,2.3809523809523808e-2,2.3255813953488372e-2,2.2727272727272728e-2,2.2222222222222223e-2,2.1739130434782608e-2,2.127659574468085e-2,2.0833333333333332e-2,2.040816326530612e-2,2.0e-2,1.96078431372549e-2,1.9230769230769232e-2,1.8867924528301886e-2,1.8518518518518517e-2,1.818181818181818e-2,1.7857142857142856e-2,1.7543859649122806e-2,1.7241379310344827e-2,1.694915254237288e-2,1.6666666666666666e-2,1.639344262295082e-2,1.6129032258064516e-2,1.5873015873015872e-2,1.5625e-2,1.5384615384615385e-2,1.5151515151515152e-2,1.4925373134328358e-2,1.4705882352941176e-2,1.4492753623188406e-2,1.4285714285714285e-2,1.4084507042253521e-2,1.3888888888888888e-2,1.36986301369863e-2,1.3513513513513514e-2,1.3333333333333334e-2,1.3157894736842105e-2,1.2987012987012988e-2,1.282051282051282e-2,1.2658227848101266e-2,1.25e-2,1.2345679012345678e-2,1.2195121951219513e-2,1.2048192771084338e-2,1.1904761904761904e-2,1.1764705882352941e-2,1.1627906976744186e-2,1.1494252873563218e-2,1.1363636363636364e-2,1.1235955056179775e-2,1.1111111111111112e-2,1.098901098901099e-2,1.0869565217391304e-2,1.0752688172043012e-2,1.0638297872340425e-2,1.0526315789473684e-2,1.0416666666666666e-2,1.0309278350515464e-2,1.020408163265306e-2,1.0101010101010102e-2,1.0e-2]


In Python:

import itertools
naturals = itertools.count(1)
my_limit = (1/n for n in naturals)
list(itertools.islice(my_limit, 100))


Outputs:

[1.0, 0.5, 0.3333333333333333, 0.25, 0.2, 0.16666666666666666, 0.14285714285714285, 0.125, 0.1111111111111111, 0.1, 0.09090909090909091, 0.08333333333333333, 0.07692307692307693, 0.07142857142857142, 0.06666666666666667, 0.0625, 0.058823529411764705, 0.05555555555555555, 0.05263157894736842, 0.05, 0.047619047619047616, 0.045454545454545456, 0.043478260869565216, 0.041666666666666664, 0.04, 0.038461538461538464, 0.037037037037037035, 0.03571428571428571, 0.034482758620689655, 0.03333333333333333, 0.03225806451612903, 0.03125, 0.030303030303030304, 0.029411764705882353, 0.02857142857142857, 0.027777777777777776, 0.02702702702702703, 0.02631578947368421, 0.02564102564102564, 0.025, 0.024390243902439025, 0.023809523809523808, 0.023255813953488372, 0.022727272727272728, 0.022222222222222223, 0.021739130434782608, 0.02127659574468085, 0.020833333333333332, 0.02040816326530612, 0.02, 0.0196078431372549, 0.019230769230769232, 0.018867924528301886, 0.018518518518518517, 0.01818181818181818, 0.017857142857142856, 0.017543859649122806, 0.017241379310344827, 0.01694915254237288, 0.016666666666666666, 0.01639344262295082, 0.016129032258064516, 0.015873015873015872, 0.015625, 0.015384615384615385, 0.015151515151515152, 0.014925373134328358, 0.014705882352941176, 0.014492753623188406, 0.014285714285714285, 0.014084507042253521, 0.013888888888888888, 0.0136986301369863, 0.013513513513513514, 0.013333333333333334, 0.013157894736842105, 0.012987012987012988, 0.01282051282051282, 0.012658227848101266, 0.0125, 0.012345679012345678, 0.012195121951219513, 0.012048192771084338, 0.011904761904761904, 0.011764705882352941, 0.011627906976744186, 0.011494252873563218, 0.011363636363636364, 0.011235955056179775, 0.011111111111111112, 0.01098901098901099, 0.010869565217391304, 0.010752688172043012, 0.010638297872340425, 0.010526315789473684, 0.010416666666666666, 0.010309278350515464, 0.01020408163265306, 0.010101010101010102, 0.01]


Your question might be interpreted to ask what the last element of such a lazy list is.