resulting in redundant looping that can't perform any composite number representation culling; the proper range is to the array index represent odd numbers less than the square root of the range. The code doesn't properly account for indexing of Python arrays, which are zero index based so that it ignores the values at the bottom and top of the array; this is a minor issue, but serves to show that the algorithm behind the code has not been clearly understood. The inner culling loop (the j loop) exactly reflects the way the algorithm is formulated, but seemingly without realizing that the indexed culling starts at exactly the index representing the square of the base odd number and that the indexing using multiplication can much more easily be expressed as a simple repeated addition of the base odd number across the range; in fact, this method of adding a constant value across the culling range is exactly how the Sieve of Eratosthenes culling is generally implemented. The following Python code in the same style resolves the above three issues, as well converting the code to a prime counting function that also displays the total number of composite culling representation culling operations: import math def sieve_of_Sundaram(n): """The sieve of Sundaram is a simple deterministic algorithm for finding all the prime numbers up to a specified integer.""" if n < 3: if n < 2: return 0 else: return 1 k = (n - 3) // 2 + 1 integers_list = [True for i in range(k)] ops = 0 for i in range((int(math.sqrt(n)) - 3) // 2 + 1): # if integers_list[i]: # adding this condition turns it into a SoE! p = 2 * i + 3 s = (p * p - 3) // 2 # compute cull start for j in range(s, k, p): integers_list[j] = False ops += 1 print("Total operations: ", ops, ";", sep='') count = 1 for i in range(k): if integers_list[i]: count += 1 print("Found ", count, " primes to ", n, ".", sep='') Note the commented out line which is all that is necessary to convert the Sieve of Sundaram to the Odds-Only (wheel factorized by the only even prime of two) Sieve of Eratosthenes; this clarifies that the only difference between these two algorithms is that the Sieve of Sundaram culls composite numbers using all odd numbers as the base values, whereas the Odds-Only