
# q-expansion of newform 2450.4.a.r, downloaded from the LMFDB on 25 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 = 2450
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 = [[-2], [5], [0], [0], [-1], [7], [-51], [-30], [50], [79], [212], [190], [308], [-422], [121], [-664], [-628], [684], [-1056], [744], [726], [-407], [644], [880], [-1351], [-54], [-1027], [-314], [-1611], [-366], [-604], [-2914], [-2568], [-1274], [594], [-1527], [530], [3662], [-315], [-1251], [-148], [1344], [-561], [-3016], [3232], [1164], [569], [693], [-4279], [3316], [-3912], [-5451], [-250], [-910], [-6494], [-1434], [5014], [-5420], [-3674], [7331], [271], [4305], [2639], [8514], [219], [4026], [-7036], [-10362], [8422], [7350], [3057], [8392], [8377], [1968], [1052], [-2308], [2281], [-14635], [5641], [-6410], [-4816], [15325], [1875], [-13874], [3442], [-16750], [695], [-5760], [-13440], [7348], [-17925], [-12346], [-15014], [-4723], [11227], [-4557], [14110], [-1902], [-1972], [-25033], [236], [-15504], [-8948], [13866], [9988], [-2585], [19656], [21247], [-9325], [-5362], [15731], [13742], [-18286], [-24722], [-22181], [-23598], [13349], [-24488], [-21622], [-2973], [-18912], [-688], [12791], [7652], [2532], [-2133], [-19153], [21334], [11480], [19763], [-40153], [30896], [11969], [10456], [28782], [14630], [24351], [2329], [-11067], [-3879], [-7518], [39801], [3564], [-10838], [-41956], [28714], [15442], [-17978], [-19308], [-17464], [23962], [35168], [37896], [30368], [33874], [24880], [-25299], [-6792], [-43575], [-45372], [39152], [18632], [-48862], [-19896], [-5130], [-11573], [34600], [-15199], [28541], [-4842], [-12888], [-28126], [42503], [24578], [-11030], [20692], [51515], [49825], [11900], [-34036], [16920], [41104], [31974], [32090], [-43392], [-6942], [53516], [8349], [52177], [-3876], [-29538], [-61350], [-16843], [68864], [67684], [-35401], [-45361], [6812], [20909], [-12227], [56510], [25270], [-68962], [10838], [13286], [-31047], [-90694], [-47312], [-65994], [50668], [10004], [-33586], [-62372], [73929], [77926], [80456], [38018], [-30252], [50142], [15230], [66506], [-47810], [94765], [-49118], [27825], [-10442], [90449], [4451], [-20851], [43700], [14680], [-51406], [56632], [-46439], [28217], [10141], [-83960], [8352], [22829], [5950], [31536], [83032], [-67559], [73814], [-55377], [44070], [-64736], [-27410], [-8415], [70698], [66722], [53562], [-70608], [-118888], [30210], [-103069], [13502], [80764], [-71617], [54959], [-38814], [-25986], [-53408], [49707], [92566], [119558], [-42327], [-22246], [-88496], [132098], [-1024], [-43644], [106937], [43812], [25410], [-111207], [71604], [-113254], [34649], [-82434], [56173], [-11383], [-140784], [-87262], [-88807], [-104637], [33958], [105810], [-72616], [7448], [-46943], [89955], [63456], [-104300], [-128158], [37872], [-116734], [-4473], [-10908], [9429], [159301], [101886], [138263], [56040], [-122123], [16126], [25922], [150808], [6936], [-61172], [51816], [106763], [-167154], [-67402], [474], [-122120], [-65338], [59163], [165781], [-8755], [136530], [-124760], [165270], [43580], [-171198], [-158888], [-54699], [-99356], [-54144], [31428], [198582], [82580], [194334], [167991], [-162324], [-26971], [-190307], [79998], [-78190], [27169], [19426], [140964], [84210], [16375], [-114806], [-33108], [170], [9976], [-130410], [157733], [-18076], [-45548], [24873], [-107935], [-68055], [88074], [-119814], [-66582], [-33270], [125998], [-19532], [-104708], [33216], [97187], [143820], [97658], [146293], [-213282], [36885], [-234165], [-218724], [18180], [206355], [227362], [-142610], [-58056], [-7145], [-138945], [150554], [108899], [73950], [56838], [79896], [5958], [28952], [-130587], [-195637], [134391], [164452], [-56609], [-109919], [45369], [104649], [166756], [-101725], [-100960], [77408], [-32088], [63807], [272250], [147152], [214656], [-17310], [-166647], [-193044], [-107466], [-70174], [-203145], [48900], [80652], [-25527], [-181670], [-135858], [-13756], [-133422], [264920], [-232541], [-225948], [-77210], [-268091], [34789], [-55102], [117066], [-265860], [239827], [-19763], [-276044], [283530], [238520], [281556]]
