Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
from sage.all import *
def is_good(N):
number_of_opt_curves = 0
for d in divisors(N):
number_of_opt_curves += number_of_divisors(N//d) * len(list(cremona_optimal_curves(d)))
dim = dimension_cusp_forms(N)
return number_of_opt_curves == dim
good_primes = [2, 3, 5, 7, 11, 13, 17, 19, 37]
to_be_checked = {1}
good = set()
while to_be_checked:
new_goods = set()
for x in to_be_checked:
# add the children to to_be_checked if good
if is_good(x):
good.add(x)
new_goods = new_goods.union({x*p for p in good_primes})
# now check the new_goods
to_be_checked = new_goods
list_of_goods = list(sorted(good))
print('There are {} good integers and they are:'.format(len(list_of_goods)))
print(list_of_goods)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment