
# q-expansion of newform 2475.4.a.f, downloaded from the LMFDB on 21 October 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 = 2475
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 = [[0], [0], [0], [-2], [11], [22], [72], [122], [72], [-96], [-112], [-266], [96], [382], [360], [318], [-660], [-430], [-380], [-168], [-218], [-706], [1068], [6], [-686], [960], [844], [2172], [614], [1254], [-1394], [252], [-1050], [1874], [-1476], [1478], [-854], [-1544], [240], [2532], [-1092], [-2290], [4392], [5074], [1692], [4664], [-1870], [-2300], [-1332], [-6022], [-4716], [6420], [3302], [-732], [-3438], [-696], [7338], [5114], [-986], [-3312], [-4298], [2736], [250], [-7248], [7786], [-4230], [7736], [2014], [7692], [-1750], [8034], [-2304], [2356], [8602], [-12016], [1728], [-8010], [10150], [-11862], [-682], [-10836], [12350], [5940], [12898], [11450], [2100], [11934], [-578], [324], [11788], [-14484], [3084], [5584], [10752], [-13372], [9072], [14586], [-2718], [2086], [13838], [-23546], [15624], [2400], [18300], [25454], [-19802], [18396], [15012], [-15408], [-1558], [-22970], [11482], [246], [11648], [-22024], [-2322], [-14024], [-7152], [-3138], [15876], [-20554], [-27806], [20820], [-7020], [12536], [33276], [9818], [-3216], [10960], [-14618], [36518], [-37452], [-10648], [1258], [-1740], [-10774], [-19146], [30670], [11970], [19932], [-31462], [39720], [28492], [-18324], [21626], [36960], [-31502], [5640], [-2056], [18336], [51346], [-32910], [-15356], [18372], [-7640], [53040], [-11302], [-19254], [-22214], [-41736], [42732], [-25056], [14326], [-45924], [-38946], [21000], [7760], [-21350], [33878], [-36210], [27516], [38234], [50640], [-20498], [-23764], [-50478], [-44818], [-54294], [-41594], [-24166], [68056], [-5700], [12922], [45192], [-40992], [12090], [66814], [-51320], [40454], [65940], [19582], [-65100], [-6076], [3558], [-65352], [-9438], [-11446], [41242], [66936], [-48828], [-34140], [17918], [54082], [11774], [-39732], [-4902], [8780], [23400], [-50172], [-59188], [44458], [-54510], [85408], [-41148], [36264], [20846], [-88982], [42336], [-13008], [-4242], [89606], [2126], [20802], [-5180], [84144], [10418], [-18426], [-66912], [25066], [-101952], [24790], [98402], [-17650], [-46428], [-68588], [60660], [6218], [82632], [40596], [89592], [4476], [-101194], [-114752], [-98674], [-34380], [82248], [28864], [58212], [94526], [-61884], [-25850], [-73152], [89088], [32870], [-12696], [-51240], [6626], [74266], [-6774], [81010], [110242], [99816], [112430], [11602], [-82950], [-55660], [-31470], [34578], [104194], [61668], [58730], [20848], [136390], [51122], [-115634], [-27632], [-13284], [-53254], [54290], [53412], [106032], [-26464], [101556], [-127654], [-64154], [28680], [124450], [104724], [-25504], [-50328], [32886], [88068], [-34548], [61908], [-14510], [-61068], [-31264], [-123090], [-175440], [-14198], [29242], [-173400], [-76546], [-72348], [75332], [81466], [165804], [26966], [37176], [-55646], [-118848], [-54474], [-162096], [-85292], [-151992], [-116674], [147660], [-18936], [169582], [31452], [20450], [71758], [156036], [-70328], [135924], [134594], [70292], [71548], [-41976], [24396], [24662], [-121854], [-102586], [-57468], [-86002], [-174276], [-111526], [42324], [145658], [-94682], [10558], [-22926], [202644], [-45196], [-70026], [-60384], [200702], [-39152], [21360], [-152586], [1706], [12502], [12786], [11158], [-103678], [-196272], [-83520], [76992], [-165864], [-14472], [34330], [-106656], [83928], [80688], [-168308], [242446], [85032], [8638], [2738], [-137220], [-48592], [191988], [210144], [-240910], [-104222], [-163932], [-88932], [71506], [-105204], [205702], [237966], [22842], [97894], [167712], [-45514], [-118248], [5168], [-184754], [-173450], [-252096], [-171970], [114822], [22908], [-77708], [-6360], [189502], [13718], [222486], [-55240], [-136632], [-81502], [196998], [-40994], [288546], [114372], [-5794], [181174], [-5424], [86308], [-154572], [-237734], [192024], [284076], [-221362], [-41450], [27342], [94620], [-7700], [-158718], [-181080], [216474], [165634], [273120], [184872], [233446], [-211650], [-87924], [74856], [-57256], [-25692]]
