A pronic number is a number which is the product of two consecutive integers. Find all Pronic Numbers less than  or equal to the given integer N.
The first few Pronic numbers are: 0, 2, 6, 12, 20, 30, 42, 56, 72, 90, 110, 132 and so on.
Example 1:
Input:
N = 6
Output:
0 2 6
Explanation:
0 is the product of 0 and 1.
2 is the product of 1 and 2.
6 is the product of 2 and 3.
Example 2:
Input:
N = 56
Output:
0 2 6 12 20 30 42 56
Explanation:
0 is the product of 0 and 1.
2 is the product of 1 and 2.
6 is the product of 2 and 3.
12 is the product of 3 and 4.
and so on.
Your Task:  
You don't need to read input. Your task is to complete the function pronicNumbers() which takes an integer N as input parameter and returns a list of integers. 
Expected Time Complexity: O(1)
Expected Auxiliary Space: O(1)
Constraints: 
1 <= N <= 10^{5}

Source: geeksforgeeks | Difficulty: EASY
Tags: Mathematics

Starter code: #User function Template for python3



class Solution:

    def pronicNumbers(self,N):

        # code here

Solutions:
class Solution:

	def pronicNumbers(self, N):
		i = 0
		k = []
		j = 0
		while j < N:
			j = i * (i + 1)
			if j > N:
				break
			k.append(j)
			i = i + 1
		return k


class Solution:

	def pronicNumbers(self, n):
		ans = []
		for i in range(1, n):
			t = (i - 1) * i
			if t <= N:
				ans.append(t)
			else:
				break
		return ans


class Solution:

	def pronicNumbers(self, N):
		arr = []
		for i in range(1, N + 1):
			if (i - 1) * i <= N:
				arr.append((i - 1) * i)
		return arr


class Solution:

	def pronicNumbers(self, N):
		i = 0
		a = []
		c = 0
		while c <= N:
			c = i * (i + 1)
			if c > N:
				break
			a.append(c)
			i = i + 1
		return a


class Solution:

	def pronicNumbers(self, N):
		ans = []
		for i in range(N + 1):
			x = round(i ** 0.5)
			if x * (x + 1) == i:
				ans.append(i)
		return ans


class Solution:

	def pronicNumbers(self, N):
		l = []
		k = [i for i in range(N)]
		j = 1
		while j < len(k):
			l.append(k[j - 1] * k[j])
			j += 1
			if l[-1] >= N:
				if l[-1] > N:
					l.pop()
				return l


class Solution:

	def pronicNumbers(self, N):
		k = []
		for i in range(N):
			r = i * (i + 1)
			k.append(r)
			if r == N:
				return k
			elif r > N:
				return k[:-1]


class Solution:

	def pronicNumbers(self, N):
		ans = []
		for i in range(N + 1):
			x = round(i ** 0.5)
			if x * (x + 1) == i:
				ans.append(i)
		return ans
if __name__ == '__main__':
	t = int(input())
	for _ in range(t):
		N = int(input())
		ob = Solution()
		ans = ob.pronicNumbers(N)
		for i in ans:
			print(i, end=' ')
		print()


class Solution:

	def pronicNumbers(self, N):
		l = []
		for i in range(int(pow(N, 1 / 2) + 1)):
			a = i * (i + 1)
			if a > N:
				break
			l.append(a)
		return l
if __name__ == '__main__':
	t = int(input())
	for _ in range(t):
		N = int(input())
		ob = Solution()
		ans = ob.pronicNumbers(N)
		for i in ans:
			print(i, end=' ')
		print()


class Solution:

	def pronicNumbers(self, N):
		prev = 0
		now = 1
		l = []
		prod = 0
		while prod < N:
			prod = prev * now
			if prod <= N:
				l.append(prod)
			prev = now
			now += 1
		return l
if __name__ == '__main__':
	t = int(input())
	for _ in range(t):
		N = int(input())
		ob = Solution()
		ans = ob.pronicNumbers(N)
		for i in ans:
			print(i, end=' ')
		print()


class Solution:

	def pronicNumbers(self, n):
		a = [i * (i - 1) for i in range(1, n + 1) if i * (i - 1) <= n]
		return a
if __name__ == '__main__':
	t = int(input())
	for _ in range(t):
		N = int(input())
		ob = Solution()
		ans = ob.pronicNumbers(N)
		for i in ans:
			print(i, end=' ')
		print()


class Solution:

	def pronicNumbers(self, N):
		l = []
		i = 0
		while True:
			if i * (i + 1) <= N:
				l.append(i * (i + 1))
			else:
				break
			i += 1
		return l
if __name__ == '__main__':
	t = int(input())
	for _ in range(t):
		N = int(input())
		ob = Solution()
		ans = ob.pronicNumbers(N)
		for i in ans:
			print(i, end=' ')
		print()


class Solution:

	def pronicNumbers(self, N):
		i = 0
		list1 = []
		while True:
			prod = i * (i + 1)
			if prod > N:
				break
			else:
				list1.append(prod)
				i += 1
		return list1


class Solution:

	def pronicNumbers(self, N):
		a = []
		for i in range(N + 1):
			p = round(i ** 0.5)
			if p * (p + 1) == i:
				a.append(i)
		return a


class Solution:

	def pronicNumbers(self, N):
		list = []
		for j in range(N):
			if j * (j + 1) > N:
				break
			list.append(j * (j + 1))
		return list


from math import sqrt

class Solution:

	def pronicNumbers(self, N):
		ans = [0]
		for i in range(1, N + 1):
			temp = int(sqrt(i))
			if temp * (temp + 1) == i:
				ans.append(i)
		return ans


class Solution:

	def pronicNumbers(self, N):
		n = 1
		st = []
		for i in range(N + 1):
			if i * (i + 1) > N:
				break
			st.append(i * (i + 1))
		return st


class Solution:

	def pronicNumbers(self, N):
		pronicNumber = []
		for j in range(0, N):
			a = j * (j + 1)
			if a <= N:
				pronicNumber.append(a)
			else:
				break
		return pronicNumber


class Solution:

	def pronicNumbers(self, N):
		num1 = 0
		num2 = 1
		l = []
		mult = num1 * num2
		while mult <= N:
			l.append(mult)
			num1 += 1
			num2 += 1
			mult = num1 * num2
		return l