
# q-expansion of newform 200.6.a.f, downloaded from the LMFDB on 25 April 2024.

# 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 = 200
weight = 6
poly_data = [-60, -1, 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], [[-1, 2], 1]]

hecke_ring_character_values = None
aps_data = [[0, 0], [4, 1], [0, 0], [-4, -2], [-100, -21], [-296, -52], [139, -16], [-420, 59], [-976, -98], [-2340, 148], [-2504, -354], [6250, 484], [-2667, 936], [112, 1076], [13036, 0], [-23406, 360], [-40888, -416], [-23466, 44], [34404, 323], [3724, -344], [-54411, 72], [-54052, 3062], [13612, -3841], [35495, 5024], [-48426, -3800], [-75534, -7860], [100276, -1240], [57260, 5165], [70714, -8980], [-32127, 11064], [-54896, 7738], [133880, -988], [-148469, 4104], [122708, 2939], [268884, -12964], [122748, -12134], [-122882, 27104], [386276, 5643], [-166580, -6512], [-174096, -34088], [298028, 21727], [-224134, -20856], [149864, -14846], [76475, -3216], [188770, 33168], [-212480, 18428], [-659420, -22459], [-384176, 15660], [796568, 22316], [-879396, -26920], [-24790, 41936], [-368508, 41148], [-463215, -14888], [-453436, 84869], [767530, 15400], [-1315224, 24726], [-1305376, -42320], [-413976, 98910], [209556, -6676], [337334, -89544], [-577676, -23997], [4254, -24868], [-251700, -87527], [17268, -140026], [1263198, -104824], [214028, -80680], [-2532212, -19145], [-341835, 73864], [1551172, -50971], [230386, 22564], [426594, -133256], [276084, -203418], [-4253640, 27020], [2615534, 37224], [2631580, 54225], [-240900, 116226], [2611998, 153168], [-2094756, 46528], [3088757, 151616], [25317, -390592], [3215004, -157473], [-2173268, 268984], [4301028, 81542], [638459, -184736], [-2772716, 213588], [749996, -340345], [292377, -237504], [-3955233, -282512], [309652, -225080], [1784552, -376444], [8519040, -34268], [-1620336, 444202], [-5713696, -196854], [1389816, 414900], [-4347816, -141572], [141488, 124724], [-2776494, -223808], [524845, 107840], [4661844, -164831], [-7154632, 342520], [2135468, -415751], [443152, 246404], [5566248, 455336], [-3397855, -339872], [-5837488, 587812], [-1959467, 133800], [13406660, -154057], [-4227951, 616248], [-3995972, -204962], [-8185221, 475136], [-8455544, 506536], [4697026, -44144], [-1202638, -453376], [-696520, 171756], [-5065872, -848362], [7369506, 18312], [1625920, -264332], [-1308912, -224580], [-1253826, -995780], [9343556, -390343], [-10216044, -623028], [13850374, 9088], [-9060680, 382008], [-2730188, -400031], [-9371700, -931841], [16653224, -59948], [5239820, -534552], [17202892, 284186], [-24254916, -199948], [13885432, 102028], [8002864, -157148], [-9570928, -382498], [2143780, 1280476], [-4823736, 197576], [8837893, -709064], [-3656659, -486752], [5999676, 537036], [-6642408, 557060], [-6074522, 420160], [747450, 779112], [-614992, 1190724], [14295122, 839880], [-1948856, 322532], [1674852, 690615], [-7901216, 483204], [7754992, -633792], [-377138, -1356120], [-12555853, 583904], [-8787084, 529435], [-1631740, -2012092], [-762700, -1837896], [7282870, -283400], [-27319812, -40447], [34264016, -341876], [-13389200, 938812], [-15082136, 234956], [-11333248, -229134], [-29542418, 598064], [18576949, 67424], [1666080, 384076], [2501624, -2696576], [-28357625, -1458224], [40914408, 699528], [-8974828, -1799837], [-28000417, -222000], [9014204, 2742050], [3733404, -1081514], [18597132, 2007840], [3247629, -1596080], [-11028476, 1482788], [-22541948, -1032783], [1250614, 1053324], [-11748580, 2160574], [-41546243, 1174992], [3882844, 83420], [-10347881, -2900000], [40715668, 334941], [-13868390, 1940628], [41131320, -1063136], [29125570, 2583216], [32089768, -2435700], [10049860, 1518847], [-49402506, 1751996], [-49602511, 1061848], [52581044, -403680], [33175940, 2256400], [25033266, -2713588], [-1120820, -1484139], [38712617, -2972256], [-46202524, -1574004], [15904593, -582400], [58061604, -1632885], [74770636, 546317], [37806550, 1914456], [-3917452, 1383325], [-48817402, -804144], [30184915, -2057120], [36283886, -1853368], [-26906979, -2799608], [33804604, -2745646], [-35109790, 535712], [11581704, 2351348], [36269928, 1314920], [14200779, -1034904], [-8342952, 2052444], [-59786034, 3105592], [29822056, -2753442], [-34145608, 1169092], [-28318194, -3540144], [53076264, -1120064], [64047614, 788352], [-21770794, 1753204], [-6626084, 2314692], [-11822516, 1123321], [7037176, -2133634], [24401481, -1011912], [-13701576, -1215998], [3107517, -40648], [73507956, -2812110], [17830802, -3851108], [39360902, 3271896], [2086732, 6023472], [-61295343, 3975832], [-57301844, 2555050], [-51645052, 633161], [-40879774, -4108844], [-96496751, -858592], [13998116, -3317060], [68905500, 4396184], [-46714780, -2039375], [63290514, -4098092], [-20034092, 6043873], [21223364, -1965966], [-50016705, -1578392], [-104823064, 958832], [26009316, -3756942], [-67792115, 1456960], [-71762068, 557372], [-19501660, 4618365], [-76376920, 3893468], [-10894244, -7616127], [4050028, -2531511], [-92364000, -3950174], [-3640068, -1793992], [129148389, 381016], [43711640, 4823176], [24150548, 206730], [-20755408, 7161964], [39798220, -2720415], [-26291196, 10907908], [45918048, 2477040], [117431659, -1652176], [-50082876, 7851234], [62158059, -2582624], [145080852, -2130716], [85324548, 1532313], [-13991740, 3760380], [-88706044, -1365409], [-45556910, 5254444], [-93515189, -3994880], [101206532, -349422], [112506820, 1908827], [95201444, -5497468], [88149776, 4383748], [11286211, 5082584], [82432324, 3712767], [71680558, -4140592], [-133431018, -5052168], [63591716, 5696705], [-126379294, -585020], [46309600, 2273204], [3492404, 5007327], [-36150407, -211640], [-81863292, -7317596], [-97612866, 9149696], [-4189328, -4731252], [135405524, -2907023], [-8820352, 9315528], [-1104402, -4024208], [63403908, -6145209], [6450984, 1186284], [-44032184, -10018214], [-145137656, -7865488], [-254244828, 409088], [164553572, -5162613], [139089456, -4596296], [59229458, -1914800], [-46811556, 1934580], [-13260432, 15997488], [-49465694, -4326464], [25564382, 7225308], [49749688, 426316], [-123957411, 9891360], [-159200100, -8186499], [24155916, 13716904], [-73259562, 80376], [-2927916, 9540082], [-94593828, 9011964], [44680432, -8595412], [109672492, 6047215], [-248160401, -3448520], [128406222, -9548604], [-254103032, -4313416], [-21699788, -7513003], [-46500052, -3325675], [118836455, 773808], [51605840, -672892], [-269618382, 2536292], [-108361920, 8366694], [-86115338, 14673180], [-164441620, -4049966], [151974962, 9335456], [161550137, -4105552], [-21844120, -7546368], [-5210952, 17696884], [-99793378, -4539272], [-177625196, 2024675], [49344328, -1053344], [293248313, -6197352], [-163600485, 8629624], [-242852456, 4838540], [-19293277, -4290224], [-127002832, -6004228], [-68705880, -6453062], [20994494, 7269976], [-48421558, -13912936], [257042988, 4596173], [-71515080, -21815380], [-107281692, 14528158], [1791984, -14434692], [200212424, 14143500], [183582290, -9060668], [17460852, 7143758], [106417148, 21584029], [-375251636, 5242215], [-228007656, -10027632], [-120976444, -708444], [146843742, 7607328], [-160392649, 17267536], [-34362804, 1648206], [133293736, -2901456], [182285023, 11855488], [96415126, -20284792], [-19609772, -27340432], [192404066, 406936], [289458224, -8461188], [-236429304, 10903388], [75035620, 29002811], [-195589548, 14579244], [-70509962, 2300236], [-282308692, -6558743], [-286945930, -4686712], [273723090, -4573940], [92035108, 3677016], [46122090, 6944296], [110283589, -24406944], [79748556, -738048], [276907804, 9308903], [357904690, 9635616], [-269070952, 8972292], [-90521598, -1203652], [61667011, 18176744], [-437507132, 1159922], [-195089944, -3169132], [-102583444, -5775145], [46356757, 16943096], [145056916, 20258020], [105202392, -26629072], [108919309, 6356984], [4553240, -19151548], [184778348, 5360883], [-429421680, 1998316], [164856196, -20871128], [-363091960, -1569928], [143307118, 16930284], [-265979412, 17079987], [259358972, -8620622], [108872293, -9164544], [361499409, 16990872], [-213380162, 22352256], [-116533814, -9068064], [-315760737, 18740048], [413053436, -656452], [207203809, -16754024], [-272639144, 15706888], [-132232620, -11899402], [-161529432, 31489640], [-84470704, -3468784], [48856328, 24187784], [127473216, 37786082], [-332271909, -1740064], [-194760572, 18648472], [-539198420, -5449259], [130344716, -6128385], [227348640, -14448610], [-190371429, 30536888], [-293088504, -19767932], [-95762535, 20065992], [183571876, 35206907], [-533379438, 14107872], [-164351212, -10273948], [-91165429, 6053696], [325609268, -363240], [338484327, -647952], [333960168, -1060248], [181165444, -9544508], [-57400258, -27100560], [201552258, 5961384], [-113809800, -5048036], [-449480804, -6105275], [-173677303, -9689208], [204704224, 31346512], [343399404, -6022697], [-66720680, -47444340], [-40919879, 17773352], [176939074, 27665284], [705091624, -1528750], [52629752, -20747598], [-118842953, 37504648], [-156807116, 30036682], [376236332, 32656388], [-213350882, 10326740], [88844592, -37571110], [-476297132, -2059855], [-138051965, -27619976], [205587516, -22342188], [-148403672, 2312032], [561082907, -8218456], [45233300, -32629713], [96327432, 36142994]]
