"""
Created on Fri Nov 16 22:30:05 2012
Euler Project, Problem 29
"""

#how many distinct terms are in the sequence generated by a^b 
#for a and b between 2 and 100 (inclusive) after repeats are removed from the sequence?

seq = []

for i in range(2,101):
    for j in range(2,101):
        seq.append(i**j)
            
print 'Answer is:', len(set(seq))

    