diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -3,6 +3,6 @@
 count = 0
 for i in range(n):
     temp = m + (i * p)
-    if i == temp:
+    if temp <= n:
         count += 1
 print(count)
