PY
py
1
2
3
4
5
6
7
8
# Challenge✋: Square and cube numbers
# Find all the positive integers "n" from 1 to 10000, such that
# n=2k^2=6p^3 for some k,p integers
sqcube=lambda n:(lambda s:[2*x for x in s if not (x**.5)%1])(3*p*p*p for p in range(1,int(1+(n/6)**(1/3))))
print(sqcube(10000))
print(sqcube(100000000000000))
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run