
# q-expansion of newform 624.4.a.m, downloaded from the LMFDB on 13 December 2025.

# 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, ZZ
    R = PolynomialRing(QQ, "x")
    f = R(poly_data)
    K = NumberField(f, "a")
    betas = [K([c/ZZ(den) for c in num]) for num, den in basis_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 = 624
weight = 4
poly_data = [-10, 0, 1]

# The entries in the following list give a basis for the
# coefficient ring in terms of a root of the defining polynomial above.
# Each line consists of the coefficients of the numerator, and a denominator.
basis_data  = [[[1, 0], 1], [[0, 2], 1]]

hecke_ring_character_values = None
aps_data = [[0, 0], [-3, 0], [12, 1], [-4, 3], [-18, -8], [-13, 0], [-6, -18], [-60, 9], [-36, -16], [42, -8], [-184, -21], [78, -30], [-108, 45], [-52, 42], [330, 34], [-618, 0], [234, -58], [-326, 84], [128, 87], [378, -8], [-562, -54], [160, -12], [-330, -42], [-1056, 3], [-58, 102], [-462, -34], [-1360, 18], [-240, 68], [-254, 12], [-186, -20], [-1336, 102], [-552, 176], [-924, 333], [1556, 252], [-456, -369], [408, 153], [206, 264], [940, -297], [-606, -222], [3306, -158], [-252, 132], [3510, 24], [-2280, -164], [-1366, -276], [4020, -51], [-584, -42], [2212, -432], [216, -177], [2154, -36], [-2046, 468], [-258, -190], [1002, -552], [-3426, -102], [-1392, 96], [-4290, 294], [-2148, 192], [3642, 264], [-3340, 51], [3510, -768], [-3132, -643], [-508, -918], [1032, -661], [496, -759], [-4404, 840], [-1162, 672], [-4548, -603], [-1352, 1659], [2414, 444], [1356, 156], [2446, 510], [4548, -1027], [2514, -294], [-1016, 72], [7730, 144], [-8980, 621], [6798, -1014], [-2490, 510], [3374, -486], [-816, 1431], [3238, 654], [-5832, 1656], [2290, 1596], [-2130, 834], [8470, 348], [-6968, 570], [1848, -276], [-5304, -1885], [-3194, 1866], [-12300, -999], [284, 1023], [3336, 1952], [-8010, 420], [-3944, -1125], [984, -1832], [632, 819], [3396, -2972], [13956, 305], [3390, -1020], [3468, 1884], [-1534, -288], [-1060, -2460], [48, -1233], [-18300, 1040], [1950, 158], [9516, -1002], [11634, 1116], [-1842, -1618], [11832, -353], [-15948, -1580], [-21530, 1224], [-6216, 1260], [4646, 978], [-20436, 941], [-19384, 489], [-6352, 897], [9690, -3274], [2032, 471], [14832, 1372], [1194, -3780], [-9060, 3300], [-14002, 1206], [-4982, 2880], [6030, 2868], [10350, -1316], [17720, -861], [-24138, 78], [10010, -408], [13524, -1876], [23288, 1638], [17834, 3000], [2064, -4803], [26106, -728], [-13368, -3306], [-23046, -1284], [25908, -759], [-30582, -480], [14088, 3547], [10960, 1221], [-15762, -534], [29646, 1884], [4516, 5253], [28800, -1433], [37368, -1146], [18582, 3576], [10546, -4260], [22470, -1480], [-22562, -546], [-16530, 4118], [4564, -1332], [-21810, -2786], [23262, 438], [-10314, -714], [-2932, 6114], [15912, -800], [-11028, -1194], [-11928, 3456], [-28584, 2988], [5796, -4179], [34950, 2508], [31944, -2845], [-3582, -1950], [-12138, 730], [6496, -3249], [-34884, -2508], [8448, -873], [-22650, -892], [-13728, 1404], [-1858, -5616], [-23362, -4434], [-34470, -2186], [9066, -2988], [174, -6], [34572, 988], [23398, -4074], [-31296, -906], [-21774, 3416], [12232, 1401], [-5832, -517], [-12304, 5418], [-51526, -2520], [-48684, 3327], [-17820, -6164], [8650, -1788], [11448, -3125], [23106, 6370], [3414, -5626], [-20450, 7008], [5340, -10011], [29582, -282], [-27966, -294], [-23774, -192], [74334, -486], [-29716, -6456], [-3432, -4241], [8460, -1340], [-42, -12078], [-37102, -7212], [23338, -600], [-8688, 235], [-4032, -4316], [-18396, 4329], [-20864, 1644], [15914, -8880], [28258, 5976], [-27270, 1930], [29166, 5100], [-21616, 6591], [-61056, -24], [-5736, -1821], [1068, -4158], [52022, 4668], [17910, 5388], [-13568, -9792], [-35682, 8524], [57750, -42], [-40718, 1584], [-11968, 2808], [474, 3988], [-17166, 2608], [8712, 7419], [4030, -4776], [-8156, -12381], [-31560, 5079], [31496, 4179], [-11064, 3708], [-60610, -2892], [10962, -15296], [-8076, 4800], [-42904, 1146], [-14022, 2454], [19390, -7392], [-35452, -264], [20988, 1761], [63426, 2174], [41860, -816], [-23766, 3416], [-6386, 2766], [-24408, 3263], [-20364, -4428], [-89568, 1856], [-28818, -2034], [101396, 1134], [-19032, 5508], [64838, -1398], [-18384, -8657], [21372, -10584], [-23996, -13185], [-58638, -5546], [49228, -6783], [50676, 3228], [54770, -2472], [-9036, -8147], [63318, 4348], [-12250, 7572], [-26430, 164], [75774, -5732], [-20910, -10104], [-95060, -2583], [-15450, 10014], [45682, 6408], [-7576, 5202], [-7284, -11700], [-5110, -6900], [-4442, 5160], [4776, 10419], [-64420, -4296], [-7860, -15643], [-66108, 9661], [74664, -3579], [32898, -10890], [58258, 2160], [8816, 4611], [34902, -3630], [-25400, -1350], [114398, -3072], [44796, 1941], [68778, 3776], [37974, -5790], [-10046, -9660], [-126024, 864], [55272, 7316], [55260, 6135], [-13488, -3028], [59702, 4566], [7104, 4473], [-16800, -5036], [-5674, -12300], [-74232, -5729], [-2624, 4305], [-54210, 4714], [36630, -2436], [-114444, -5716], [-41328, 8079], [17778, 7358], [7582, 11400], [139590, -1974], [1584, -12216], [-714, 7774], [5316, 4060], [-93536, 2145], [92618, 5496], [-110244, 5041], [88968, 12990], [-2124, -15520], [8516, -3984], [-2650, -4350], [20508, 21856], [38214, 15984], [85542, -2804], [-7590, 9996], [-77628, 8496], [-9036, -14147], [-41538, 12708], [-31420, -20100], [18282, -15706], [-52426, -13944], [22674, 5004], [-138, -2206], [-33058, -1854], [-25902, -2186], [-43412, -8910], [-26630, -4476], [-34074, -19848], [20272, -831], [-65640, 7507], [-130250, -84], [27308, -14313], [-61272, -16473], [-68544, 12676], [75354, 892], [38410, 5328], [101922, -7988], [-96056, 9672], [21006, 16692], [-1220, -13995], [10494, -18094], [-3034, 1746], [-43620, 10021], [-13434, -16398], [16264, -25302], [27726, 10806], [-5874, 11424], [50616, -15469], [-1096, 10734], [252, 10201], [38916, 22168], [-52670, 20832], [-58124, 9675], [-60630, 13154], [59766, -10230], [-126112, 1863], [21310, -12078], [-59568, 18099], [-31688, 9906], [41514, 7536], [-16746, 30900], [71298, 5634], [-114678, -8520], [51558, 1554], [-79386, 16362], [-62570, 1782], [-10470, -32334], [17556, -12868], [104346, 3680], [10180, -13326], [52210, -1344], [-26436, -2595], [-6040, -4083], [-106206, -19704], [-79464, -10380], [-137332, -3894], [127554, -2842], [35694, 5232], [-15624, -27780], [-157146, -3528], [21198, 1314], [27144, 17820], [-52990, 10908], [124506, 13204], [-4670, 25788], [121824, 9087], [39372, -35399], [-77316, 23103], [114984, 5915], [123836, 1311], [101790, 20460], [-11580, 19521], [-153430, 3012], [-101996, 27093], [4692, -1684], [-49602, 3342], [-164856, -7705], [187782, -7992], [58876, -6948], [8586, 2610], [152302, 5844], [196308, 5169], [-96630, -1382], [52260, -15564], [-102276, 12021], [-118058, -138], [77970, -22418], [22508, -28605], [-4896, 17975], [15612, 1701], [163072, 6756], [-149750, 13920], [213888, 4719], [17336, -4551], [-59898, -11724], [-83918, 11688], [-95730, 4020], [16716, 14612], [117956, -8226], [39842, -2772], [-141786, -9036], [137586, 9720], [-67792, -2364], [-84264, 22719], [-67788, 12636], [70482, 8062], [-84074, -10722], [184386, 11700], [-40488, 39624], [-37918, -25164], [-93648, -24877], [43008, -30544], [21408, -20049], [-106396, 7707], [-41256, -20408]]
