Avatar ·

Calculate the number of numbers in a given range of the cube of which ends by 4 or 9

📁 Advanced Python Topics, AI

Number of numbers

Two integers A and B (A ≤ B) are given as input to the program. Write a program that calculates the number of numbers in the range from A to B inclusive, whose cube ends in 4 or 9.

Input format

Two integers A and B (A ≤ B).

Output format

The program should output a single number according to the condition of the problem. Note. A number cube is its third power A^3.

Sample Input 1:

   1   10  counter =  0   for  i  in