
# q-expansion of newform 2400.4.a.f, downloaded from the LMFDB on 01 May 2026.

# We generate the q-expansion using the Hecke eigenvalues a_p at the primes.
# Each a_p is given as a linear combination
# of the following basis for the coefficient ring.

def make_data():

    from sage.all import prod, floor, prime_powers, gcd, QQ, primes_first_n, next_prime, RR

    def discrete_log(elts, gens, mod):
        # algorithm 2.2, page 16 of https://arxiv.org/abs/0903.2785
        def table_gens(gens, mod):
            T = [1]
            n = len(gens)
            r = [None]*n
            s = [None]*n
            for i in range(n):
                beta = gens[i]
                r[i] = 1
                N = len(T)
                while beta not in T:
                    for Tj in T[:N]:
                        T.append((beta*Tj) % mod)
                    beta = (beta*gens[i]) % mod
                    r[i] += 1
                s[i] = T.index(beta)
            return T, r, s
        T, r, s = table_gens(gens, mod)
        n = len(gens)
        N = [ prod(r[:j]) for j in range(n) ]
        Z = lambda s: [ (floor(s/N[j]) % r[j]) for j in range(n)]
        return [Z(T.index(elt % mod)) for elt in elts]
    def extend_multiplicatively(an):
        for pp in prime_powers(len(an)-1):
            for k in range(1, (len(an) - 1)//pp + 1):
                if gcd(k, pp) == 1:
                    an[pp*k] = an[pp]*an[k]
    from sage.all import PolynomialRing, NumberField
    R = PolynomialRing(QQ, "x")
    f = R(poly_data)
    K = NumberField(f, "a")
    betas = [K.gens()[0]**i for i in range(len(poly_data))]
    convert_elt_to_field = lambda elt: sum(c*beta for c, beta in zip(elt, betas))
    # convert aps to K elements
    primes = primes_first_n(len(aps_data))
    good_primes = [p for p in primes if not p.divides(level)]
    aps = map(convert_elt_to_field, aps_data)
    if not hecke_ring_character_values:
        # trivial character
        char_values = dict(zip(good_primes, [1]*len(good_primes)))
    else:
        gens = [elt[0] for elt in hecke_ring_character_values]
        gens_values = [convert_elt_to_field(elt[1]) for elt in hecke_ring_character_values]
        char_values = dict([(
            p,prod(g**k for g, k in zip(gens_values, elt)))
            for p, elt in zip(good_primes, discrete_log(good_primes, gens, level))
            ])
    an_list_bound = next_prime(primes[-1])
    an = [0]*an_list_bound
    an[1] = 1
    
    from sage.all import PowerSeriesRing
    PS = PowerSeriesRing(K, "q")
    for p, ap in zip(primes, aps):
        if p.divides(level):
            euler_factor = [1, -ap]
        else:
            euler_factor = [1, -ap, p**(weight - 1) * char_values[p]]
        k = RR(an_list_bound).log(p).floor() + 1
        foo = (1/PS(euler_factor)).padded_list(k)
        for i in range(1, k):
            an[p**i] = foo[i]
    extend_multiplicatively(an)
    return PS(an)
level = 2400
weight = 4
poly_data = [0, 1]

# The basis for the coefficient ring is just the power basis
# in the root of the defining polynomial above.
hecke_ring_character_values = None
aps_data = [[0], [-3], [0], [8], [4], [6], [2], [-16], [60], [-142], [-176], [214], [-278], [68], [-116], [350], [684], [-394], [-108], [-96], [398], [136], [-436], [-750], [-82], [154], [1216], [-732], [-554], [474], [840], [1484], [-1006], [1400], [2], [-2248], [-2890], [252], [884], [1398], [3612], [3150], [3040], [-1994], [-4066], [-3904], [-560], [-608], [-5124], [1190], [-3862], [1640], [-2334], [-772], [-6214], [-4948], [-7038], [-728], [-7274], [1714], [4316], [6078], [1564], [5216], [5790], [-3946], [-9992], [-3274], [5580], [-4154], [2802], [-11296], [-10536], [2222], [-1512], [-7916], [-9950], [-9554], [-6390], [-13030], [2100], [3478], [8504], [16102], [-1072], [11076], [-9910], [3798], [-8406], [-18040], [8484], [-2136], [-3152], [-11812], [10352], [1300], [-4398], [1650], [17276], [3878], [-9604], [-13546], [16884], [13746], [-15176], [-15106], [17332], [1290], [-20544], [-2630], [-20320], [-15386], [-8934], [20408], [-24000], [15810], [-7716], [27324], [-9450], [10804], [1534], [-1306], [6398], [20396], [-11592], [3618], [30518], [-13088], [-6064], [-3522], [39040], [14868], [-4016], [7958], [15890], [6834], [3694], [-38284], [-3258], [29754], [-42848], [-6454], [-19128], [-7060], [-4666], [-33792], [-23146], [40698], [40136], [-1396], [34646], [-15302], [26300], [12052], [-18260], [-10280], [-34504], [28266], [51494], [5338], [47644], [13906], [-8536], [22572], [51474], [-6412], [-54008], [30846], [7826], [-3922], [-1332], [-50546], [41592], [5950], [-600], [-5838], [-26992], [-3070], [8840], [-10274], [-28224], [59548], [-9226], [57474], [-35724], [7346], [58326], [-17652], [35482], [33360], [-65242], [-18220], [-76144], [19962], [-16524], [-18686], [42818], [35030], [46986], [-65420], [8826], [-49520], [30830], [30002], [-13796], [-74426], [-16328], [13972], [68962], [-31944], [-52554], [5810], [4912], [-33140], [32264], [13402], [-88808], [-11158], [-7764], [-33498], [86518], [69296], [32386], [30696], [64116], [55686], [-68286], [51584], [-8304], [-30972], [47750], [-108408], [-28904], [20306], [21692], [6276], [12658], [-50034], [49740], [79296], [48484], [-54808], [-54152], [-6186], [4882], [15944], [32056], [47508], [85504], [85692], [-11250], [-57726], [51236], [-91542], [29190], [-52636], [-51746], [-105756], [-39474], [-40866], [9008], [-10340], [118], [60814], [80362], [-4560], [-84630], [10298], [-93188], [132702], [-22370], [135596], [55262], [65112], [-19082], [142432], [-57588], [-79178], [-63782], [7292], [135132], [72936], [77852], [-44058], [-85476], [-141520], [49182], [-135954], [65696], [-136286], [-86598], [143652], [19482], [-76956], [8782], [-98166], [-131552], [124942], [-30276], [-98356], [86446], [-162378], [-17152], [61404], [97624], [-94498], [-87852], [-23314], [11368], [-8962], [24444], [-69974], [67834], [-125644], [63612], [-177190], [-142036], [-136192], [45302], [92930], [148568], [-103458], [-55118], [93176], [-37398], [85858], [-66856], [-154892], [40524], [-4994], [-43634], [-55418], [73272], [-155412], [-89552], [-42108], [100462], [-24478], [-180070], [101640], [-117602], [-157062], [-129942], [59608], [-101162], [-49604], [101798], [67916], [-36048], [-157682], [198688], [27158], [71538], [66608], [124878], [92058], [98048], [-74140], [43258], [-49572], [-213826], [92954], [-77892], [-14004], [146660], [-10346], [106854], [136256], [-63462], [99732], [-225320], [-141036], [-184182], [207464], [47854], [-152916], [-115992], [123822], [78138], [21430], [-242598], [-36750], [203224], [-16350], [65224], [14940], [62800], [79190], [114116], [-200300], [-66446], [202974], [5228], [261444], [146424], [84134], [101280], [87770], [-47080], [-187566], [23550], [-79494], [-123464], [-1406], [105658], [56064], [241262], [175018], [156348], [151524], [30878], [57006], [-105204], [228024], [126094], [41426], [263136], [238232], [284362], [218988], [-245078], [-25442], [-284004], [205220], [198270], [-8778], [-15172], [24202], [-60712], [9264]]
