an integer p is a whole square if it is a square of some integer q code example
Example: all perfect squares up to n
def perfect_squares(minimum, maximum) :
# get first number
number = ceil(sqrt(minimum));
# get fisrt number's square
n2 = number * number;
# get next
number = (number * 2) + 1;
while ((n2 >= minimum and n2 <= maximum)) :
# print perfect square
print(n2, end= " ");
# find next perfect square
n2 = n2 + number;
# next odd number to be added
number += 2;