Given an integer n, we need to find a range of positive integers such that all the number in that range are composite and length of that range is n. You may return anyone range in the case of more than one answer.
Input:
First line consists of T test cases. Only line, consists of an Integer N.
Output:
Single line output, "1" if range found else "0".
Constraints:
1<=T<=100
1<=N<=100
Example:
Input:
2
3
5
Output:
1
1

Source: geeksforgeeks | Difficulty: EASY
Tags: Number theory

Mathematics

Starter code: #User function Template for python3

def Range(n):
    #return 1/0
    #code here

Solutions:
def Range(n):
	return 1


def Range(n):
	x = n + 2
	fact = 1
	l1 = []
	for i in range(1, x + 1):
		fact *= i
	l1.append(fact + 2)
	l1.append(fact + 2 + n - 1)
	if len(l1) == 2:
		return 1
	else:
		return 0


def Range(n):
	if n == 1 or n == 2:
		return 1
	for i in range(2, n):
		if n % i != 0:
			return 1
	return 0