
# q-expansion of newform 336.10.a.f, downloaded from the LMFDB on 24 September 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
    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 = 336
weight = 10
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], [81], [-76], [2401], [-38386], [98298], [104524], [420580], [139118], [-1916290], [6379488], [-6629278], [-6692112], [23269732], [22000596], [18919770], [-179035544], [-19797786], [263015240], [-22447678], [11023774], [284917908], [226865924], [-191377296], [-1162236578], [564206624], [1885460656], [1928238654], [1497370462], [409160906], [-1936735596], [-4221024644], [4635073886], [-1846737604], [-3726525606], [-5170737400], [4177969070], [11520523984], [8688362332], [-8179496032], [24342898434], [6566299578], [35935708578], [21954022070], [-32299183862], [-22769771504], [16477580644], [23832574264], [-12603574560], [62208236938], [-1663056338], [76341398262], [68677987886], [11434461240], [123667712856], [36682176030], [129425162972], [12629210952], [-63189979702], [85736948758], [69251124572], [-6717973680], [192055922780], [-229228404260], [-30924333686], [-80630853390], [192838688380], [430629345594], [184612629930], [202101247798], [377213421468], [-481749507950], [30084769744], [267225054070], [-545054331172], [79910602808], [-203684466730], [-619487918706], [-188580843186], [-170054755834], [-762833715168], [-303434361126], [636708034866], [135209004314], [-804798054312], [-1336381237174], [599221428146], [1710737095114], [1643719494968], [-889212853348], [482868852328], [-1699194968452], [1681658550352], [1015484788890], [-2316230860108], [-2452452453288], [-1317937198068], [-3030207822948], [1451193984988], [-1869304669950], [-179081104728], [-2197514470342], [231442765976], [-2779814001666], [3157634617560], [-2428130030054], [-339248570752], [-4418084276388], [-5146388525430], [-5791319124910], [-1506148936320], [697459308006], [1914797919238], [-3431873139628], [-2534880124532], [2427638373334], [5892724631284], [-5019013660908], [-8255188139514], [-4646809555378], [5352950465590], [3221458115870], [1183052013048], [3183013880082], [-6299245620260], [-10498137341938], [671563112774], [1939532975232], [10347603742736], [5213813974074], [8103703276224], [6652297471218], [1581126535296], [14219084228982], [-5906007724592], [-4857048150950], [-9128426466232], [16230963087756], [16976754092688], [20024673660362], [17421019463780], [16299227303458], [2255355382580], [4197360084798], [-529028830286], [-25819723145548], [-20384887895698], [3478393709952], [18733722423796], [4355115747838], [10435271763022], [-31477444511052], [31324807510132], [-75327562260], [11435517709332], [-23102480127390], [-34550844720016], [18353962884192], [17346842450882], [-22795390802932], [-37776577430522], [-29350468464470], [-37156776008372], [35541798913116], [-14803753352514], [-36125440855248], [-11868301479416], [-18111174918970], [46823386669262], [-40676544563568], [-11858376808394], [-6791224541330], [-53115784400454], [35488640405574], [-24057799568856], [-6793386466348], [-29405255825136], [-32573130967898], [-32227058597624], [26552025691454], [-4618208840196], [53030272502252], [-19889201997062], [-42401162841988], [-52075927655186], [31333354454376], [-70298970248538], [104974129893076], [-75066741546858], [41468369813016], [30037806781198], [-10392586600002], [65846379953132], [-21795600536936], [92109915483438], [86329153001524], [14767786326302], [-95387857643486], [-39004507122576], [-99612646206780], [60140877014274], [-110648710396776], [96703516924994], [67572835189518], [-8197728624828], [162315566696592], [43530036072568], [42243543984486], [-7030353663750], [-138825416607788], [-141976213401982], [-80300873838820], [15548093772912], [85538650897852], [1130782352892], [-86811491379022], [118010417265224], [43985072442724], [-148576354990162], [206941166146318], [-105932440040906], [-158726732896816], [-227515239510486], [-27490829789200], [-38996735314020], [-68444639612014], [111201985968976], [-3454432830026], [47413984878192], [47162013684018], [312841173890814], [183770137938764], [-133072229497144], [113146835439354], [-110640611171036], [365278325905152], [55287267884254], [292209717509922], [-40443051056958], [163122439924120], [242727582728954], [269354956694740], [-2832730195184], [-257474072884350], [9311148547696], [352129579249020], [-361141904074032], [68272061065280], [260317082144824], [-162197264984226], [177227639245414], [53505699457836], [194392311657018], [-269932428234002], [-28779345077696], [-453270689473186], [-86888793620038], [59982792409668], [388810779398072], [1247734004018], [315426771130388], [165082023942586], [-315376008344246], [-70167012375434], [-212710543368684], [-52875889528084], [-335877977942070], [-556540103056660], [-191122690610176], [631186223922102], [151034888189238], [-566879110709636], [81525685893390], [83891186443576], [192186531248518], [-824796789661296], [-401047848240922], [-746608165398558], [-452122737935954], [843886908982416], [516345432305256], [48235662418140], [621882932590512], [-790964291973610], [-233645530734180], [165265869931154], [752332204017042], [-739301917796318], [172072901239792], [-344891321192952], [459245108803506], [-595261167120468], [-206993932753386], [-503565722793536], [784258723962878], [610949233871376], [557448682495480], [176323307122956], [-797704654607544], [409897375243044], [1268104027707850], [-956257147523922], [449190942441164], [-962153864120946], [-826365687850952], [704224881680762], [-170509822185950], [-1005852399686062], [-399223818046030], [-1099164578242486], [-602871795002136], [754543617613262], [-175609307338450], [-510469264766876], [612638969179630], [134583842158334], [-1365281185047780], [-3957219452378], [-1752558640538794], [103900171266966], [1692765712909540], [284682473925142], [-576418542534168], [1188984120087416], [530222379969026], [-292648539282298], [-1151800599050456], [796712311774748], [427904230321994], [-474170840894186], [1080442468173254], [-789788364290186], [895325722616280], [1299637733845376], [333375837999776], [-446479617184088], [464591794417470], [-352426389648616], [1385447080141622], [-65457290062888], [-1681227752818858], [-379642710713610], [1851919274591676], [-523875051720048], [-75396385725426], [-1537518453400722], [295841359744082], [-1805294227914092], [-2387491199573640], [153792817716960], [777259845338668], [1666673260796966], [1920379610074674], [2679304983586536], [2546528014762390], [109845520311604], [-1384925913714704], [1181229971914764], [-3307698818644742], [-1312493856228694], [2138636730178294], [-1397137640059832], [2937573124831906], [-1824802855537546], [-1288803908356468], [1166527610235638], [97253148881028], [2534446598638332], [-2761018145745314], [-1439596270939798], [2739373906373396], [778424102645034], [811791789573410], [-1240932625933072], [-529859449083710], [-1202367732634308], [-2023450597034746], [1391632473257626], [-1821451448495300], [695484942791150], [4356027342861960], [-816684349951846], [-965722504602784], [-2510400767573958], [-2058495313936732], [1939966759952704], [-3469161572282576], [-1472966349457454], [2947164355615712], [-1997026586322052], [-1555187718390466], [3351608266818516], [3501251585393486], [-653490827904548], [-1284625182998222], [-1486692371820606], [1034780396476616], [1200186321569956], [4636628518588560], [-4505671971978050], [-5345693292725914], [-2808203580150726], [3332793907485764], [4575322124361728], [-645579024315708], [2974556310727864], [1743619955962258], [-1649208531894414], [-1654712621582924], [-3277128494039632], [-4455174886027262], [-1347429808170362], [2070753369031394], [1963292635538700], [749070749396102], [5440153133720644], [234382535287838], [-3002269220904856], [-2485130890481388], [-5018330072737028], [3535612401699358], [723357986504918], [-4128554640972334], [6022106736040404], [4553890744594394], [4158259810981664], [3296077454629594], [2620391551571478], [-1349473169207508], [-3362640579978196]]
