
# q-expansion of newform 98.14.c.c, downloaded from the LMFDB on 31 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 = 98
weight = 14
poly_data = [1, -1, 1]

# The basis for the coefficient ring is just the power basis
# in the root of the defining polynomial above.
hecke_ring_character_values = [[3, [0, -1]]]
aps_data = [[0, -64], [1026, -1026], [0, -4320], [0, 0], [8787312, -8787312], [-20420932, 0], [-1719462, 1719462], [0, 109702942], [0, 646760160], [728867274, 0], [-1028049116, 1028049116], [0, -14229390962], [44544458406, 0], [-54689828968, 0], [0, -47868325716], [169986882858, -169986882858], [300765540198, -300765540198], [0, -369996272360], [787010801908, -787010801908], [559441472256, 0], [-121137579650, 121137579650], [0, -290426785064], [-3965105603046, 0], [0, 6025919250630], [11302818199190, 0], [-17141087691360, 17141087691360], [0, -11450898959900], [0, -28787521180092], [6835876748206, -6835876748206], [-23230926547386, 0], [-93328006821712, 0], [0, 66112607301390], [-48082381438194, 48082381438194], [-129911145086002, 0], [0, -126590121115902], [238305988864792, -238305988864792], [-331263463313660, 331263463313660], [0, 309482090257120], [18962425972308, 0], [0, -514033087970676], [138537219537852, -138537219537852], [-879858200754988, 0], [0, -219512885897784], [798168343166770, -798168343166770], [797364406952766, 0], [-17340438865844, 17340438865844], [-1277347446473908, 0], [-1510632403961464, 0], [3785828334386382, -3785828334386382], [0, 2204812569827524], [0, -258261933275034], [4425537557387928, 0], [2491488907895530, -2491488907895530], [-2254475908467090, 0], [0, 5441075353988910], [-4127539038295104, 4127539038295104], [2725803065529996, -2725803065529996], [0, -8990725625077232], [6661881220856122, -6661881220856122], [2115190829277402, 0], [8155789670969014, -8155789670969014], [-13102161422235144, 0], [9484535638893602, 0], [-6030282325809192, 6030282325809192], [0, -15648465364869590], [0, -10503529046620662], [0, -34912919178151640], [44170206115569998, 0], [10624296510371784, -10624296510371784], [-34574832254176732, 0], [-50769951639351570, 50769951639351570], [0, -7667711423613384], [15728765153092408, -15728765153092408], [0, -51894328533584414], [-43847066001485248, 0], [0, -39703585677979140], [34198163675791614, -34198163675791614], [0, 30642782514276652], [0, -69521331773589678], [116045930580869650, -116045930580869650], [140052127502098182, 0], [-96502238705954170, 0], [151333479717078696, -151333479717078696], [197235331866449534, 0], [0, 53828214714755704], [0, -155428794576032484], [252502017478699410, 0], [0, 255752078076742762], [-8909857880064372, 0], [201346672873047872, 0], [0, -101466587449768794], [-144100733056736508, 144100733056736508], [-333007070612297744, 333007070612297744], [141802917806200548, 0], [0, 384702796637866228], [567444881542142016, 0], [0, 629561044832013468], [360434784072112026, -360434784072112026], [0, 247278766818287518], [0, -1389548700111638], [-475093605859565320, 0], [1093282473499439946, -1093282473499439946], [-1025650363577317278, 1025650363577317278], [0, -434266555373358438], [-555274254886825136, 555274254886825136], [-1230427143948859202, 1230427143948859202], [-1562619679758799914, 0], [0, -1095329705754220602], [1470450423954855576, -1470450423954855576], [731234774776900058, 0], [0, 547903716260740384], [376450437312351502, -376450437312351502], [-1609291383819655002, 0], [-1576956616783443962, 1576956616783443962], [396768388489314032, 0], [1058302886419130130, -1058302886419130130], [-445532425466433970, 0], [-521651127656194644, 521651127656194644], [0, 710699816297245086], [678921538633536984, 0], [2180629826303257480, -2180629826303257480], [-135117903327985702, 0], [0, -3219268814042860020], [809935635242923548, -809935635242923548], [0, 1118453704804713934], [-5965205354387949150, 0], [0, 4107583738732399678], [0, 4671993312451702740], [-1833468870703859956, 0], [0, 1915349785225575880], [-6472974137290292000, 6472974137290292000], [2824866175107576504, 0], [0, 6088956441140722216], [8688954254978459954, 0], [0, -3797002487494570446], [4024661108793915758, 0], [-1219051064934675192, 1219051064934675192], [10120608013983587446, -10120608013983587446], [-6891526132912691340, 0], [11164429876009755354, -11164429876009755354], [8007682110815464994, 0], [0, -8203244618168343894], [8646774991842485416, -8646774991842485416], [6187226858611033356, 0], [9341554851179698984, -9341554851179698984], [5159412643664498604, 0], [665104898125244780, 0], [-16155143668013460750, 16155143668013460750], [0, 4545414035794059826], [0, -6026090600154402312], [0, 2942760373318168582], [7227141945146149194, 0], [-8750726772979308892, 0], [0, -18654481979660075004], [-16630628343219644444, 16630628343219644444], [6962836095648712176, 0], [0, 6186314603272726024], [0, 19678057563562476378], [13369550642361123266, 0], [-38508618671336182344, 38508618671336182344], [0, 7960554411010165752], [-3649915779748828182, 0], [-15521590767886514176, 0], [0, 16262528879268016806], [-30475360382471664378, 30475360382471664378], [37730356697412192132, -37730356697412192132], [-27324713659225854800, 27324713659225854800], [-60441954122917038248, 60441954122917038248]]
