## Pages

Python Arithmetic Exercises With Solutions For High School Grade 12

#### Exercise 750|| Solution

For each natural number n, we set: Sn = 1 + 2 + 3 + ... + n. Write a Python algorithm that finds the integer n for a given Sn. Example if Sn = 10 then n = 4 since 1 + 2 + 3 + 4 = 10.

#### Exercise 751 || Solution

Write a program in Python that finds the smallest divisor strictly greater than 1 of a given positive integer n.

#### Exercise 752 || Solution

Write a program in Python that searches for the greatest divisor strictly less than a given positive integer n. Example for n = 18 the greatest divisor of n is 9.

#### Exercise 753 || Solution

Write a python algorithm as a function which takes as argument a positive integer n and returns the list of all the tuples (u, v) of integers such that: u2 + v2 <= n.

#### Exercise 754 || Solution

Write a Python algorithm as a function that takes an integer n as argument and returns the smallest prime integer greater than or equal to n. Example for n = 8, the function returns the smallest prime number greater than or equal to 8 which is 11.

#### Exercise 755 || solution

Write a Python algorithm as a function which takes as argument an integer n and which returns the list of all the prime integers contained in the interval [n, 2n] Example for n = 9, the function returns the list of the all prim numbers contained in the interval [9, 18] which is L = [11, 13, 17].

#### Exercise 756 || Solution

Write a Python algorithm as a function that takes an integer n as argument and returns the largest prime integer less than or equal to n. Example for n = 15, the function returns the largest prime number less than or equal to 15 which is 13.

#### Exercise 757 || Solution

Given a non-zero natural integer n, write a python algorithm as function which determines the remainder in the Euclidean division of the sum of the first n integers by n.

#### Exercise 758 || Solution

Write a python algorithm as a function that takes as argument a pair of integers (d, s) and returns a list of all the couple who determine the list of all pairs of integers (m, n) of greatest common divisor GCD(m, n) = d and of sum m + n = s     (*)

#### Exercise 759 || Solution

Write a python algorithm as a function which takes as parameters two integers m and n which returns the list of all the divisors common to m and n.

#### Exercise 760 || Solution

Write an algorithm in python as a function that finds the list of all prime divisors of a given integer n.

#### Exercise 761 || Solution

Write an algorithm in python as a function which takes as parameters an integer n and which returns the list of integers tuples (p, q) such that p and q are prime between them and p + q less than or equal to n.

#### Exercise 762 || Solution

Write a Python program as a function which takes an integer n as a parameter and which returns the sum of all divisors of n.

#### Exercise 763 || Solution

Write a python algorithm as function which take as argument an integer n and return the list of all tuples (p , q) of positive integers p and q shch that the Euclidean division of p by q gives 3 as the quotient and 2 as the remainder.

#### Exercise 764 || Solution

Write a python algorithm as function which takes as parameter an integer n and which returns the remainder in the Euclidean division by n of the sum of the first n integers Sn = 1 + 2 + 3 + ... + n

#### Exercise 765 || Solution

1 - Write a python algorithm as function which takes as parameter an integer n and which returns the tuple (n! , Sn) where n! = 1x2x3x...xn and Sn = 1 + 2 + 3 + ... + n.
2 - Write a python algorithm as function which takes as parameter an integer n and return the quotient and remainder in euclidean division of n! by Sn.

Younes Derfoufi
my-courses.net