Description
This problem is a programming version of Problem 29 from projecteuler.net
Consider all integer combinations of ab for 2 ≤ a ≤ 5 and 2 ≤ b ≤ 5:
2 3 4 5
2 = 4,2 = 8,2 = 16,2 = 32
2 3 4 5
3 = 9,3 = 27,3 = 81,3 = 243
2 3 4 5
4 = 16,4 = 64,4 = 256,4 = 1024
2 3 4 5
5 = 25,5 = 125,5 = 625,5 = 3125
If they are then placed in numerical order, with any repeats removed, we get the following sequence of 15 distinct terms:
4,8,9,16,25,27,32,64,81,125,243,256,625,1024,3125
How many distinct terms are in the sequence generated by ab for 2 ≤ a ≤ N and 2 ≤ b ≤ N?
Input Format
Input contains an integer N
Output Format
Print the answer corresponding to the test case.
Constraints
5
2 ≤ N ≤ 10
Sample Input
Sample Output




Reviews
There are no reviews yet.