Very easy to do in Python
This commit is contained in:
20
29/main.py
Normal file
20
29/main.py
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# Distinct Powers
|
||||||
|
|
||||||
|
# Consider all integer combinations of a^b for 2 <= a <= 100 and 2 <= b <= 100
|
||||||
|
# How many distinct terms are there in that sequence
|
||||||
|
|
||||||
|
import math
|
||||||
|
|
||||||
|
def main():
|
||||||
|
print("Hello, this is Patrick")
|
||||||
|
|
||||||
|
s = set()
|
||||||
|
for a in range(2, 101):
|
||||||
|
for b in range(2, 101):
|
||||||
|
s.add(a**b)
|
||||||
|
|
||||||
|
print(len(s))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
Reference in New Issue
Block a user