"""
Consider all integer combinations of ab for 2 ≤ a ≤ 6 and 2 ≤ b ≤ 6:
    2^2=4,  2^3=8,   2^4=16,   2^5=32,   2^6=64
    3^2=9,  3^3=27,  3^4=81,   3^5=243,  3^6=729
    4^2=16, 4^3=64,  4^4=256,  4^5=1024, 4^6=4096
    5^2=25, 5^3=125, 5^4=625,  5^5=3125, 5^6=15625
    6^2=36, 6^3=216, 6^4=1296, 6^5=7776, 6^6=46656
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 ≤ 100 and 2 ≤ b ≤ 100?

notes:
we can get rid of an powers of 4 upto 2^100 after counting the powers of 2.
there are 100-2 total combinations of the 2^b (99 numbers) 
but because 2*2 = 4 == 4^1(which isnt counted) we know there will be 99-floor(99/2) possibilities
the same is true for powers of 8 however it will be 99-floor(99/3)
the divisor is the power of 2 that = 8
"""
import math

MAX = 100

#bruteforce
def attempt1():
    arr = [] 
    for a in range(2,MAX+1):
        for b in range(2,MAX+1):
            if math.pow(a,b) not in arr:
                arr.append(math.pow(a,b))
    return len(arr)

print(attempt1()) 

