Prime Finding Function

I am trying to see if there is a way to see how much a point (x, f(x)) where f(x) could be a list of functions, is crossed by the list of functions f(x). It is for Prime finder | Desmos , which uses a sine wave with period [2,…n] and basically shows all numbers divisible by 2, 3, 4, ect… and rules out everything else.

I also think this could be used similarly to a “sieve of Eratosthenes“ by replacing [2,…n] to only have prime numbers. (Basically a ticker that iterates the function, compiles a list of all prime numbers<=n, replaces list_n-1 with that list, and repeats)