
// Make newform 585.6.a.p in Magma, downloaded from the LMFDB on 10 January 2026.
// To make the character of type GrpDrchElt, type "MakeCharacter_585_a();"
// To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
// To make the newform (type ModFrm), type "MakeNewformModFrm_585_6_a_p();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_585_6_a_p();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function ConvertToHeckeField(input: pass_field := false, Kf := [])
    if not pass_field then
        poly := [-3899136, 2477700, 433844, -346839, -27536, 13727, 608, -205, -4, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0], [-47, -1, 1, 0, 0, 0, 0, 0, 0], [113984, -26996716, 9786032, 2476749, -601957, -55376, 10912, 351, -59], [182771520, 103940556, -106346776, -15477745, 6097941, 410960, -109064, -2859, 587], [-132330560, 87609492, -1404152, -7383375, 669267, 162320, -17128, -1013, 109], [-141024320, 94220372, -1132472, -7473935, 669267, 162320, -17128, -1013, 109], [-246852672, -27052284, 65985116, 6123863, -3185691, -173992, 53092, 1245, -277], [109852736, -117142036, 18379600, 11355611, -1521415, -261664, 31376, 1657, -185]];
    Rf_basisdens := [1, 1, 1, 45280, 271680, 90560, 90560, 135840, 90560];
    Rf_basisnums := ChangeUniverse([[z : z in elt] : elt in Rf_num], Kf);
    Rfbasis := [Rf_basisnums[i]/Rf_basisdens[i] : i in [1..Degree(Kf)]];
    inp_vec := Vector(Rfbasis)*ChangeRing(Transpose(Matrix([[elt : elt in row] : row in input])),Kf);
    return Eltseq(inp_vec);
end function;


// To make the character of type GrpDrchElt, type "MakeCharacter_585_a();"
function MakeCharacter_585_a()
    N := 585;
    order := 1;
    char_gens := [326, 352, 496];
    v := [1, 1, 1];
    // chi(gens[i]) = zeta^v[i]
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    F := CyclotomicField(order);
    chi := DirichletCharacterFromValuesOnUnitGenerators(DirichletGroup(N,F),[F|F.1^e:e in v]);
    return MinimalBaseRingCharacter(chi);
end function;

function MakeCharacter_585_a_Hecke( : Kf := Kf)
    return MakeCharacter_585_a();
end function;


function ExtendMultiplicatively(weight, aps, character)
    prec := NextPrime(NthPrime(#aps)) - 1; // we will able to figure out a_0 ... a_prec
    primes := PrimesUpTo(prec);
    prime_powers := primes;
    assert #primes eq #aps;
    log_prec := Floor(Log(prec)/Log(2)); // prec < 2^(log_prec+1)
    F := Universe(aps);
    FXY<X, Y> := PolynomialRing(F, 2);
    // 1/(1 - a_p T + p^(weight - 1) * char(p) T^2) = 1 + a_p T + a_{p^2} T^2 + ...
    R<T> := PowerSeriesRing(FXY : Precision := log_prec + 1);
    recursion := Coefficients(1/(1 - X*T + Y*T^2));
    coeffs := [F!0: i in [1..prec]];
    coeffs[1] := 1; //a_1
    for i := 1 to #primes do
        p := primes[i];
        coeffs[p] := aps[i];
        b := p^(weight - 1) * F!character(p);
        r := 2;
        p_power := p * p;
        //deals with powers of p
        while p_power le prec do
            Append(~prime_powers, p_power);
            coeffs[p_power] := Evaluate(recursion[r + 1], [aps[i], b]);
            p_power *:= p;
            r +:= 1;
        end while;    
    end for;
    Sort(~prime_powers);
    for pp in prime_powers do
        for k := 1 to Floor(prec/pp) do
            if GCD(k, pp) eq 1 then
                coeffs[pp*k] := coeffs[pp]*coeffs[k];
            end if;
        end for;
    end for;
    return coeffs;
end function;


function qexpCoeffs()
    // To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
    weight := 6;
    raw_aps := [[1, -1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [-25, 0, 0, 0, 0, 0, 0, 0, 0], [-16, -3, -1, 0, 0, 0, 1, 0, 0], [53, 9, 3, 0, 0, 0, -1, -1, 1], [169, 0, 0, 0, 0, 0, 0, 0, 0], [192, 46, 11, -2, -1, 4, 3, 3, 1], [-262, -15, 7, -3, 3, -5, 2, -1, 1], [439, -8, 6, 5, 5, 3, 5, -2, 2], [882, -29, 27, -3, 1, -3, 30, 11, -5], [-395, -265, 5, 19, 1, 5, 0, 8, 12], [-609, -188, -3, -16, 13, 20, 5, -10, 8], [1745, -516, 67, 2, 25, -6, -3, -4, 22], [-3289, -5, 163, -17, -33, 25, -22, 26, 14], [5478, -688, 28, -38, 10, -18, 42, -56, -36], [5630, -203, 138, 21, -34, 7, -57, 44, -2], [6046, 48, 12, 0, 20, 24, -8, 46, -26], [4239, -1048, -151, -70, -29, 90, -101, -64, -2], [9568, -1942, 412, 18, 44, 70, -194, -82, 70], [12728, -1716, -524, -57, -3, -79, 59, 83, -15], [-4793, -2182, -24, 106, 16, -60, -180, -171, 69], [-2588, -3280, -758, -49, 23, 65, -51, 121, 115], [183, 2209, -259, 95, 103, 153, 8, -162, 126], [10302, -4859, -466, 89, -122, 79, 291, -98, -32], [9172, -7552, -37, 90, -3, -220, -213, 247, 21], [5986, -2325, -835, -35, -181, 17, 532, -155, 137], [13707, -5759, 505, -183, -71, 55, 694, 400, -216], [57321, 215, -1041, -362, -260, 330, 497, -153, -15], [-1473, -1378, 132, -118, -144, 420, 88, -263, -175], [15545, 1756, -3192, 200, 172, -10, -134, 209, -123], [-9403, 2749, 1501, 219, 87, 285, -512, -456, -480], [77402, 1485, -2631, -95, -147, -105, 180, 227, -383], [-28293, 7111, -2515, -311, 107, -329, 646, 560, 312], [-10839, -3121, 1115, -28, -358, -180, 1691, 673, -377], [95385, 11022, 1413, -86, 605, 510, -621, -1076, 522], [-91889, 7845, -4037, -601, 113, 385, -246, -590, 458], [-56761, 4979, 2493, 561, 623, 15, -546, 436, 900], [-80333, 14179, -533, -798, -240, -210, 197, 651, -803], [216592, 13440, 3520, 938, -650, -202, -1278, 190, 422], [106297, -19423, -2501, -945, -51, -235, -114, -438, -550], [192644, 11313, 2117, -393, -585, 521, -1750, -269, 97], [-133927, 29126, -3293, 72, -515, 100, 1339, 856, -98], [147192, 12852, 1316, 842, 222, 294, -754, 1678, 266], [64780, -6536, -5811, -178, 811, -2300, 2037, -983, -485], [153967, 39857, 1507, 619, 945, -751, -2078, 186, 410], [-126505, 55395, 5451, 1069, 65, 1075, -152, 872, -176], [-145716, 41870, -14450, -238, -1158, -1650, 292, 318, -302], [43113, 35446, 608, -1768, -458, -400, -854, -107, 883], [124214, 20070, -13882, -2490, -242, -126, 908, -636, -1520], [237567, 49872, 1600, 284, 1372, -1190, -3050, -1931, 1265], [403106, -32630, 3881, 846, 193, -1476, 17, 1163, -35], [378643, -29291, 3745, 1022, -1892, 714, -781, 2085, -433], [58886, 58556, 1280, 1040, -300, 440, 2456, -1380, 1980], [176924, -10627, 6333, 93, -755, 2915, -5336, 2129, 1843], [-19931, 117884, -8392, 888, -1476, 302, -574, -1611, 145], [57838, -10579, -12911, 645, 729, -1565, -4944, -1733, 585], [163064, -33633, 12615, -3855, -2099, 1021, 90, -2475, -2307], [-137223, 30323, -10023, 1721, 2283, 1415, 2082, -2934, 1610], [-123345, 93121, 697, -1497, -157, 2945, -1984, -1048, -1628], [-172463, -14689, -36893, -87, -63, 3159, 2724, -1024, 292], [17607, 72447, -861, 313, 489, 3575, -3348, 388, 20], [-287955, -56751, -23091, -4165, -3173, -1919, 148, 2142, -926], [349671, 10297, 8213, 3644, -106, -1500, 3469, 1161, -1089], [561770, -1234, 8450, -1488, 1968, 1880, -15062, -4590, -2338], [538516, 20654, -7528, 1766, 1368, 30, -1342, -2934, -3930], [-9188, 97210, 12690, -182, -630, 5278, 5572, 420, 4052], [76616, -106609, -15779, -4697, -1627, -2775, 10650, 427, -6203], [315212, 41090, 17394, 298, 370, 2470, 7788, -4736, 4688], [159359, 65967, 39811, -186, 2968, -7966, -823, -4627, 2347], [251173, -90010, 30686, -4806, -7438, -460, 2874, 7189, -2095], [-391749, -108195, 20541, 6459, -3905, 2773, -13040, -8132, 6368], [-661761, -131255, 12093, -4393, -5817, 2809, 3488, 634, -2542], [176971, -7865, -51533, -351, 3729, -1465, 7116, 7776, -1864], [1749115, 52253, -13859, -1041, -181, 4865, -9372, 5336, 4476], [-892012, -150975, 16031, -4761, -1055, 3545, 4528, -11453, -1611], [317972, -12404, 30820, -5784, 1472, 8056, 7476, 2920, 3140], [-178976, -297265, 28539, 101, 2733, -8807, -2558, 7257, -1359], [-477523, 85970, -5729, -7982, -1429, -750, -3087, -2150, 1636], [89298, 54150, 33058, 4322, 1782, -62, 19248, 5094, -2890], [-1013594, 158456, -11390, 356, 4390, -10520, -7046, -4802, -3734], [831472, 2459, 13275, -3271, 6805, 13799, -15234, 765, 3871], [1305593, -3268, 9788, 1052, -6484, 16790, -6666, 2327, 1555], [-527174, -43598, 21194, -510, -638, -9858, 1692, 6032, -6156], [1257080, 121820, 29150, 10976, -2806, 6440, 110, 6372, 2048], [-901185, -62649, -17287, 4906, 8218, 10630, -18009, 4371, 8145], [-30293, -157941, 28759, -1570, -2688, 1474, -3035, 2437, -6701], [257134, -283973, -35682, 9803, 6994, -731, 11989, -6086, 760], [-44506, -61738, -16447, 9808, 13363, 8710, 4783, 13087, 3197], [-356367, 52490, -2661, -2642, 2467, -7178, 3097, -19938, -5544], [1632604, 273647, -68291, 790, -9510, 7210, -14719, -730, -4950], [1273599, 179333, 128001, -700, 1758, -7212, -7607, -757, 2941], [783483, -173367, 23545, -2928, -12594, 3896, -11955, 435, 881], [-522836, 58105, 25367, 3110, -17162, 4250, -12489, -15842, 7914], [212826, -82703, -116451, 7579, -3933, 8317, -11238, -4903, 3675], [-4049892, 101249, -35225, 3707, 2525, -7075, 10260, 9971, 6117], [1299230, -144199, 74901, 5777, 7773, 15079, -17448, 6183, 12109], [-378263, -344612, -46109, -10940, -337, 7800, -6809, -9342, 7296], [778900, -390280, 92938, -8092, -13290, 12392, 13562, 18774, 8258], [162920, 354816, -2480, -13736, -1552, -16960, 3072, -16460, 1988], [2228961, 138500, 13988, 6212, 14596, -10930, 34742, -14713, -445], [-2861938, 188798, -116986, 8108, 832, -16700, -13998, 4806, 1394], [108548, 443322, -33998, -9626, 7758, -22006, -200, -21404, -11236], [2648479, -4353, 34395, 9946, -15236, 3742, 33557, 2085, -19309], [-1106910, -176506, -154256, -5866, -15840, 1142, -23110, -8738, 7394], [656129, 507967, 69023, -418, 13068, -16750, -11855, 4799, 7721], [2240156, -308306, -44103, -2824, -11973, -10950, 26195, -775, -17153], [-521078, 369942, -99622, 4842, 238, -3986, 28868, 21504, -18012], [-1200583, -298489, -89725, -15223, -6503, -1049, -3884, -3960, 204], [4298384, -395380, 68352, 19670, 10158, 13250, -28746, -26854, 16158], [2549976, 143615, 35564, 9085, -14918, -4125, 20965, 22552, -6394], [-435163, 844697, -16935, 1203, -15145, 31765, 3516, 8784, 4768], [1054961, -204836, -91281, -3880, -3145, -1460, -16417, 8530, -1760], [2554553, 550637, 53709, -3729, -12605, 4781, 22056, 17742, 2882], [-3677826, -227429, 121893, 5815, -17927, 4585, -25842, -14567, 2119], [68627, 1019683, -39199, -1397, 12025, 15845, 17728, 754, 2698], [5966370, -170370, -72498, 10986, 15850, 7958, 5048, -10084, 17868], [-351031, 515903, -95581, 10762, 34652, -26930, -41391, -13627, 10603], [1184509, -165792, -132106, 9203, -12569, 6261, 3727, -6938, 3658], [4535557, 161555, 105533, -23427, -17293, -22741, -5438, -15956, -8756], [8104818, -190903, -5047, -2013, 30407, -1939, -43810, -611, -8985], [1738363, -106828, -86450, -9336, -21110, 18050, 14644, 25267, -31061], [4539314, -1098502, -165318, -8118, -2222, -6710, 1200, 23814, -22674], [3860832, 135269, 166110, -6191, 21830, 20399, -46989, 2910, -3224], [3693651, -262455, -54155, 19647, 11391, 22641, -27440, 1930, 39426], [-1128918, -1425383, -83617, 9809, 13919, 1255, -60626, -30169, 25321], [4407420, 46501, 198315, 54911, 15761, 4351, -25180, -16175, 8677], [-3985225, 417772, 200508, -6144, -16376, -7530, -25610, -13583, -25027], [2796080, -148018, 36374, -17726, -18734, 48326, 43372, 39382, -6158], [2949023, -1241013, -9657, -33033, -17965, 15305, 34926, -42494, -3938], [7224679, -901944, 15365, -1788, 16853, -32280, -30039, -17686, 20996], [-2710872, -1866819, 147963, 7935, 1817, 32345, -7460, -43513, -4559], [5585566, -11928, -179052, 19372, 20344, -588, 38396, 4114, 11106], [1824221, -1244595, -77353, -36708, -12004, 18500, 124151, 49347, -6015], [-18948, 283622, -221778, 36502, 31230, -19230, -44260, 34976, 23792], [6647490, 1410878, -97662, 26282, -30586, 18962, -57104, -8766, -20174], [-6049210, -1550372, 45724, 32, -20144, -8080, -16764, 22972, 24860], [682557, -1099829, -158167, 34193, 12595, -30901, -24290, 4214, 46598], [1304874, 974062, 153964, 2514, -8768, -16130, 64674, 42824, 18100], [8088542, -583121, -263946, -27933, 14158, -20199, -6551, -16828, 34650], [-1375488, 1578776, -207104, 33732, 12692, 22260, 940, 15368, 3416], [3214158, -1782387, -63921, 13707, -10935, -11115, -95112, -21019, 18067], [-305615, 959268, 31781, -19040, -5947, 9872, 26729, -26412, 20326], [7284219, -472431, -139855, -14377, -15813, -53815, 70284, 5886, -44086], [654663, -533027, -148843, 1793, -21303, 23631, -95638, -28404, 22232], [568896, -2519382, 152030, 22966, 54722, 14290, -46228, 18820, 8132], [8384613, 213995, -64041, -37444, -2502, -61396, 78671, -36523, 11911], [6726691, -1925894, -53391, -18778, -26775, 33630, 32351, -24114, 22452], [2465778, -732544, -60889, -10208, -11965, 72310, 37653, 60653, -14945], [-9235229, 1039467, 80327, 67740, 3674, -29660, -62869, 32399, 4777], [-203500, 1603764, -5284, -14358, -24650, 5590, 42558, -11942, -59230], [7381330, -90136, 284336, -38120, -60944, 18240, 31288, -25464, -20832], [-457304, 1015548, -296298, -22072, 13306, -14444, 48706, 28406, 24034], [7380146, 288802, -99266, 40380, -5012, 48500, -73710, -33682, 22714], [5711477, -638770, -156616, 16737, 53273, -47145, 48635, -3068, -13300], [8542595, -3498173, 100887, 24095, -29965, 39745, -16986, 40110, -24870], [308226, -136360, 37744, 32888, 39640, -75440, -9148, 50102, 16930], [-6554601, 189015, 226009, -63988, -27472, -6700, -14311, 77549, -71409], [-1445830, 564033, 392818, 17293, -19102, -525, 59027, -4606, -35068], [6548922, 1095292, -104330, -46132, -3178, -83800, 139382, -22934, -46666], [1753175, 673054, -2151, -27822, 43625, 53362, -160925, -47258, 97620], [9144037, -141473, 183531, 60839, -1437, 43281, -104930, -35092, 27112], [-601442, -1431356, 2713, -7152, -2271, -54582, 189595, -51001, -71835], [9598463, -279606, 189004, 15400, 55174, 71920, 23610, -47101, 68157], [9803580, 137781, 202349, 3761, -66519, 26007, 95716, 55637, -7065], [2783105, -877645, 172819, -10871, -40435, 43791, 90796, 39532, -44256], [1887048, -2153774, 248802, -3630, 24874, -16018, 10968, 89166, -13354], [-3294596, 1961828, -161510, 20273, 7169, -36945, 63119, 11923, 50745], [6766205, -1308777, 606127, 48061, -8095, 41675, -41572, 40088, 97716], [-2898598, -171474, 655444, -4494, -608, 14230, -2706, -7100, 13312], [-1186936, 1254299, 180188, 48783, 23660, 105269, -254565, -54536, 20138], [12984808, 1601290, 242550, -12114, -37158, -20214, 129536, -6010, 15310], [2625337, 3278718, -640846, -53422, -4338, -104780, 110382, -1659, 22889], [3538948, -1418426, -39070, 54188, -1012, -111516, 52554, 98200, 65496], [14156466, 60888, -104609, 2038, -23171, 16980, 208575, 92693, -4245], [2828130, -319398, 127540, 11867, -9529, -17355, 262891, 11507, -59695], [1115754, 1832122, -39336, -25842, -38140, -16490, -75598, -91618, -77470], [3291236, -2558457, -530743, -3491, 33979, -2205, -39876, -39259, -55709], [-11400687, -403976, 644643, 8572, -23709, -50808, -132217, -51926, -8968], [17360377, -904265, -234053, -18263, 40297, 33175, -43856, 12538, -7722], [-17613422, 1582834, 367622, 45254, 66066, -34690, 114056, -103642, 99822], [2469448, -180055, 283847, 68892, 4952, -31820, -205371, -68632, -30752], [1748978, 2833385, -72667, -57363, 93753, 36875, 38452, -103401, -17467], [9277642, 5206262, 102504, -42454, 69636, -7370, 116522, 11284, -51936], [-19092913, -539321, 182977, 72181, 104635, 7947, -123466, -28784, 120808], [693644, -1389744, -59344, 31234, -90850, 200334, 3554, 24298, 378], [-11477986, 1994583, -68097, 3913, 37541, 48257, 45038, 96439, -64489], [-6489790, 656866, 295716, -46986, 2128, -119470, 51578, 110920, -5772], [-3194591, -1795849, -682505, 52096, -54934, 117640, 60467, 12299, -16771], [-22583856, -182214, 352784, 9994, -76640, 156730, 42022, 62522, 13094], [-288819, 1118027, -89245, -72266, 3764, 103650, 192509, 70795, -70287], [754920, -1336076, -437170, -61332, 18102, -68220, 122834, -77124, -48496], [-9325912, -2614756, 881144, -94778, -28626, -38398, 5054, -17478, 83738], [-6434705, 4614293, -88059, 16168, -118178, 7480, -131951, 48871, -57111], [-6296787, 2594670, 426363, 3862, -72945, -23986, -84255, -79606, -79276], [-6980392, -2019410, -179910, 1686, -3326, -6870, -133956, -179010, 111106], [11850882, -808678, 254519, -93010, 44615, -98208, -146205, -149183, 54423], [-14814632, 234360, 1016408, 17044, -8596, 52760, -272728, 89426, 26026], [4970903, 2344221, -211555, 136807, 86051, 201145, 2780, -51688, 148780], [-3682429, -102363, 269367, 59391, 109261, 83597, -334710, -79354, 65966], [-22714765, -2048326, 512484, -32277, -67985, 18477, 97685, 21012, 6740], [20583248, 921864, -688632, 26776, -68296, -126532, 298460, 87934, -136618], [5742915, -2961989, -186447, 3472, 30520, -208240, -105475, 50581, -3993], [-10388739, -1757318, 576813, 135326, -27523, 69090, -320441, -33640, 50702], [-12565588, 2537245, -66644, -31857, -58978, -10975, 378271, 139336, -53966], [-8068339, -122481, 535925, 247584, 3584, -3712, -38499, 66675, 153173], [-16482964, -157145, -269602, 14763, -40106, 43069, -355051, 110794, -74040], [9954537, 126171, 698489, 24901, 62231, 139155, -107714, 654, -11266], [16871196, -200054, -1375970, 14174, 72650, -102182, -89128, 71130, 70886], [-21770909, 742864, 192009, 76102, 121351, -126562, -32825, -27808, -3826], [1993937, 1268051, -27269, -83148, 53678, 96140, -144373, -97411, -32869], [-1030172, -2876466, -782662, -12834, 115802, 42890, -429344, -149680, -40968], [-31567406, 2212207, 54919, -125667, -46343, 117949, -145590, -119113, 14071], [6705569, 2695127, -61153, 17025, -184347, -67425, 300068, 52758, -129366], [24798791, 1211861, 179477, 49731, 153735, 12781, -153220, 6726, 22718], [-18211532, 3530000, 50928, 15364, -26140, 215804, -2820, -9796, -87368], [-6265388, -2515034, 538794, -80934, 25438, 81750, 183292, 131096, -69440], [7415695, 3660369, -225055, -13235, -30827, 254875, 395058, -93112, 66664], [-4826138, 5249162, -743052, 143010, 110636, 20290, -364990, -142686, 65174], [-29228548, -1063870, 951738, 125774, 11814, 3378, -133820, 64854, 3334], [14088726, -2283002, 1148860, 174786, 123256, 7038, -71242, -11200, 137652], [-25186311, 3475270, 728913, 2500, 27335, -135580, 22513, -64930, -127120], [-5318583, 692889, -441457, 32165, 35491, 125155, -282520, -97954, -14682], [-17182116, -1023624, -1198788, -54632, 100924, -26564, 493984, -8554, -402], [13500527, 2176694, -375736, 22124, -157574, 177980, -459182, -158417, 200657], [52647487, 164303, 571975, -166502, -105032, 41606, 251257, 129285, -187509], [10300585, 2719686, 359095, 78404, -80315, 204640, -264237, -270968, 168574], [34473096, -7611384, 225455, -8068, -61225, 116678, -75923, -233565, 94773], [15196108, 2620678, -567586, 104388, -30192, 171436, -476266, -117688, 85424], [3104377, 445209, -1235147, -75955, -81607, -138525, 51786, -67462, -85706], [9891359, 3712749, 449583, -148624, -109616, 183232, -20409, 401129, -85033], [8357791, -2587185, 1228921, 108081, -18897, 36135, -270382, -243944, -26320], [7779325, 6375131, 774431, -105120, 73950, 178880, -276533, 136785, 74615], [5701769, -2525269, -111511, 100617, 95099, 308815, -49462, 259790, 87894], [-24288120, 1969566, -1546722, 245926, -24922, 28342, -81000, 235614, 149294], [6793707, 5265935, 1135631, -240823, 143301, -41145, 73800, -6828, 74500], [8060304, 8415614, -1347322, -63784, -85148, 179888, 122418, -220036, -33984], [-25062166, 5821946, -851134, 112202, -90166, -58710, -107080, 96350, 33654], [-27859150, 2052098, 924200, -158958, 74976, 210894, -170958, -135540, -2824], [41589874, 3456611, 103751, 110499, -18537, 247005, -59664, -171827, -12793], [11648196, 4041398, 417874, 170014, 205186, -153806, 109644, -136518, -6898], [-2123379, -6766261, 363235, -139975, 5133, 167711, -351608, -161110, -15606], [5996099, 397353, 104309, -45210, -157716, 280010, 497159, 33669, 70747], [18068817, -623325, 1484167, 95515, 65271, -276315, -56490, 191516, -28372], [-4249209, -3616064, -309382, 199244, 150638, -304210, 380340, 35675, -272397], [-18127217, -5304227, -300743, -44533, -35829, -210211, 837108, 239736, -243740], [32379366, -786610, -1036270, 51482, 10014, -458218, -260468, -38600, -41360], [-5937293, 11685708, 764094, 120442, 178216, -252770, 237426, -173423, -20745], [-948395, 6098261, -762445, 29492, 90104, -185348, -234093, 180935, 31385], [-4864414, -1384147, -153649, -258205, -188567, -306235, 287168, -46647, -46001], [33345230, -8836571, 613933, 125661, 50629, -55989, 69212, 339819, 51537], [-32344568, 1927184, -340972, -437560, -184452, 197980, -112904, -134442, -21466], [-48951423, -1301957, 2545075, -151627, 45713, 238971, 140592, 44520, 96116], [3564760, 7264388, 404616, 80884, -1816, -277596, -161012, -234732, -122320], [53586357, 126658, 170145, 3634, -286419, 91390, 72463, -26112, -225898], [-65012204, -5408195, -1106204, 184461, 43904, 55471, -129399, -159952, -86122], [33544793, -7488197, -507631, -238472, 114272, -382536, 529025, -184233, 37881], [-27459918, 8865582, -745590, -33414, -2546, 97210, -229328, -230538, -168562], [21032177, -2349891, 1454281, 127880, -150046, 133960, -25703, -65161, 362057], [-33018007, 859101, -147045, -96661, 10557, -111695, -659918, -392210, -122418], [11830994, 7503722, 5837, 327900, 259271, 110770, -96913, 318491, -44247], [-31884707, 3221557, -541675, 153371, 112351, -296315, -47632, -372216, 66864], [10098839, 3033789, -863903, -231946, 47388, 36306, 38363, 162501, 173179], [-12893411, -4147834, -1955550, -156474, 2274, -88000, 299746, -62743, 30133], [-39529374, 4869064, -1391472, 267084, 122836, -411620, 140612, 99508, 68892], [26887193, 2295727, -2679435, 178945, -30069, 32707, 315394, -98110, 222098], [19967901, 2897057, -1484623, -68788, 123282, 260100, 237381, -260067, 10723], [-98709615, -2758148, 1416347, 30408, 101555, 408996, -360525, -53634, 86356], [-37014892, 1209695, -675564, -12949, -301340, -165019, 984787, 171718, -207264], [-7021959, 8042767, 335443, -190100, -94766, 445380, -259293, 120259, 68117], [13997533, -10230513, -1576879, 116457, 30807, 109583, -172358, 96288, 298016], [23166118, -5657356, 2024492, -56660, -99084, -257100, -143336, 41616, -327952], [19570883, 7593467, 290323, -38840, 4210, -192160, 468275, -131535, 104895], [-14454576, -537402, 2513897, 22312, 4595, 126410, -449469, 187721, 313007], [16455386, -3349226, -322674, 227318, 188494, -438950, -336244, -68972, 297420], [42832246, 2425076, -757614, 232280, 20974, 142940, -602946, -193666, 159322], [-11010376, 7715353, 747207, -133426, -107890, 249970, -181273, 9622, -379166], [-53985790, 2893358, 1321406, 193946, 197642, -64050, -333840, -152692, 264792], [31721161, 9752066, -1757180, 80282, 21972, -24120, 301188, 564243, -22077], [-87692370, 8237468, -205170, -88596, -106770, 98600, 616670, 150242, 67934], [21948216, 10562913, -646819, 5185, 180925, -45025, 548228, -222707, -168513], [35058279, -4292242, -212520, -94481, -106573, -141063, -498995, -74660, 89372], [-89122601, 4644631, -1650987, -729, -56027, 192665, -208704, -508034, 19150], [-18904050, 9040673, 1984793, 42193, 40025, 118519, 123140, 212919, 364013], [-62856653, -3643406, 1056500, -96818, 23832, -182680, 338916, -449367, 62073], [35507892, -6945654, 1418976, 74490, 203320, -69450, -254678, -248270, -139550], [27512252, 4849126, 1225078, -11200, 117332, 188368, 143618, 83164, 23132], [-11071988, 5170908, 3490696, -66680, -12492, -13700, 63468, -330042, -130466], [-44028545, 5284847, 252499, -39071, -65879, -348269, 25672, -254858, -379958], [42946531, -6242641, -1822299, 306543, -62627, -225615, -88312, 278742, -250018], [-48402272, 5112128, 734320, -43272, -343688, 516248, -426176, 379940, -99412], [-26899600, 13085651, -271171, -189027, -313061, 82053, 413728, 287687, -294973], [29358662, 17810506, 717178, 32154, -292454, 120766, 551804, 185144, 80240], [-87247531, -12124867, -280251, 17299, 162727, -99127, 737316, -292598, 31110], [49752844, 8629328, -625532, -324708, -39280, 9260, -510776, -16816, 291324], [23933338, -5557542, 2329408, -27866, -62468, -72950, -129986, 482384, 50500], [-3697100, -12480005, 539347, 94757, -55167, -198351, 401170, -110399, -76519], [-85516019, -1425915, -1104787, -74149, -241673, 143285, 674912, -505140, -72028], [-873116, -13828489, -2327490, 195587, 240190, -76075, -369635, -56830, 254808], [42033832, -3827917, 2515347, -104089, 46599, 71681, -48356, 31631, -382315], [-31804963, -4037503, -196451, 264768, 219890, -440680, -87675, -249101, 86293], [-16437448, -19453774, 1126208, -146226, 121828, 281110, 98130, 288370, 125038], [-135448055, 9121275, 507801, -32643, 44847, 27463, -342078, 47938, 24986], [80216224, 6954672, 2701894, 72047, -106557, -62655, -414919, -236031, 404331], [-39000071, -12486319, 4088557, 54882, 121056, -430410, -423313, 270531, -215515], [-61503630, -11230406, -1551506, -21102, -385770, 134990, -291728, 388164, 245268], [46514404, -7046484, 1344365, -240962, -214513, -332980, 54861, -376079, -344541], [-24505941, 11455825, -404555, -120486, -6768, -210810, -6093, 605185, 86167], [33797563, -8891688, -1553001, 109774, -130155, -101470, 860713, -150058, -78736], [-7671700, -13642056, -906520, -450244, -120900, 22516, -525476, -502300, -119536], [-75590480, -5554364, -3683958, 80504, -362834, 716360, 379018, 136148, -99368], [147330431, -7370568, 1686970, -163411, -29663, -5669, -29959, 74030, -279158], [-178673620, 3788052, 616052, -161028, 216780, 11336, 459180, -79554, -164778], [-162933698, 12744280, 1794460, -90296, -46556, -90484, 187448, -161130, -97162], [-60569598, -9810474, 2569206, -232286, 23074, 286070, -766024, 227156, -69524], [20132146, 6984104, 40836, -14210, 95574, -494758, -516050, 586048, 4], [150540917, -3171038, 1831789, -124394, -50987, 434050, -87097, -424624, 313590], [-72214773, -15808213, 1108241, 318240, 189976, -740848, -152003, -11887, -232785], [62436130, -5253654, 330246, 78997, 144031, 311075, -911621, -371937, -333547], [-42167499, 848904, 2971062, 378212, 327154, 628410, -744476, -433155, 476069], [-59515500, 3458204, -980988, 47680, -400464, -234984, 272356, 513676, 12372], [-82978474, -22046520, 157544, 76876, 134212, -540, -363992, 19450, -203778], [25140959, -3018734, 3611472, -242446, -133432, 190180, -308396, 617705, 10313], [-14690744, -4539239, 106519, 209783, 204249, 224807, -951496, 403957, 515897], [69244238, 143173, 2564807, 220420, 423292, -48100, 26601, -348058, -10894], [-131356143, -14621923, -1114741, -299085, -305635, 310797, 562910, 196812, -106372], [-85674638, -18671675, -2083314, 534895, 235280, 67745, -87719, -399200, -59250], [64076292, -1043267, 553743, -122467, 320847, -58445, -305274, -447079, -72841], [-138340775, -2419421, -2493549, 217326, 2812, -319390, -419211, -298475, -447893], [74241315, 4679590, -3134096, -308669, -420273, 438725, 1465249, -495688, -150592], [-124761907, -8663659, -409033, -189253, -449359, -556879, 828406, 464666, -15990], [-119214873, -5516382, -3222454, -270966, -616398, -217080, 408882, 156099, -67105], [-167691546, 6133513, 246724, 351877, 205220, -224861, -1040107, -245938, -21764], [108128392, -19489760, -2698424, 328048, 306952, -117440, -13784, -113084, 128004], [69658680, -17643912, -4328140, 77928, -254060, -404168, 100188, -498060, -294928], [-170609006, -3661267, -909985, -116883, -275561, -340885, 280666, 635355, -109491], [56862540, 4897056, 3289472, 659754, 88430, -13738, 483354, 330926, -167650], [97403601, -2737940, 2681988, -438992, -49384, -135230, -680990, -85425, -84269], [-93690975, -2564665, 1497171, -167319, 199817, -323617, 269772, 618668, 226032], [63099662, -7375214, 2786942, 10982, 255378, 172510, 157408, -195366, 724786], [54198539, -17340971, 514789, -315827, 338901, -244365, 1430510, 212580, 260596], [-119086357, 14852992, 1427839, -163388, -347905, 38580, 600847, 716596, -15878], [56981686, 11408404, -2900385, -536256, 707599, -877282, -199579, -76515, -147177], [-116725863, 4713166, -3700615, -663638, -335775, 297782, 553583, 114840, -201202], [-44547871, 16017541, 561369, 57835, 199075, 773685, 695020, -203080, 199840], [-109328169, -17902461, 4493843, -200263, -9787, 565683, -1036776, -126186, 201018], [49135420, -1292501, 3270115, -20727, 47029, 326479, 898230, 437825, -91901], [-101212959, -1217054, -2933893, -145528, 426641, 226620, -1268613, -529808, 645910], [-15038679, -19150645, -1795657, -394130, -70152, -6390, 1189217, 539193, -460521], [56753733, 27947555, 1250183, 670425, 62233, 177175, -901228, -129886, 347370], [-59913626, -5610011, -525256, -213379, -342276, -187149, -776495, 366882, -438816], [-7510630, 6539187, 4715389, 771135, 377377, 48945, -286458, -646663, 144231], [-10245748, 31392512, -1137319, -41442, 32735, -139020, 150257, -455871, 478043], [-65650979, -16221162, 293211, 603422, 668239, -397082, -223271, -224302, 88972], [68838053, -11563847, 3642141, 54127, -313945, 493425, -1583220, -624264, -57048], [32795873, 768462, -5013207, -762564, 383727, -195300, 821169, 143910, 46152], [-173135817, 2213076, 4790548, 492256, -7048, 182762, -568926, 266899, 541751], [117010675, 7686385, -3606731, 742862, 405292, -922390, 933199, -164203, -94433], [-81074124, -6772400, -2180036, -403164, -525568, 914564, 1238520, 414992, -73172], [-11106963, -2793398, 1189678, 304546, -430506, 895696, -603578, -60321, 209787], [180867366, -25524000, 968724, 540118, 539486, 384922, 145206, -6828, 600248], [127777116, -152030, 138902, 460886, -253854, -459230, 197668, -100636, 195044], [113393380, 6527366, -1256292, -347798, 15560, -275714, 1799998, 130964, -425336], [97039562, -34519507, -4573687, -193223, -516723, -361649, -837660, -261141, 229865], [3455210, 5928984, 1659580, 619052, -792128, 276300, -9108, 679070, -54506], [46335379, 20841903, -1398741, -373003, -679099, 1042315, -272984, -423728, 70400], [3262658, -38425204, 788264, -605860, 359832, -914100, 898636, -623268, -485884], [103464853, -731001, -4242463, 251425, 71079, 412659, -964914, 339286, 593526], [-54034294, -1095043, -1687181, -442540, -565584, 401260, 1509989, 435566, -195342], [30334013, -7038394, 7832561, -108042, 68861, -638710, -815981, 774560, -243394], [294925196, -2816345, 2133043, -359079, 122353, -277313, 1332950, 289829, -77521], [-25973240, -5367938, -942570, -816222, 92034, -367730, -297212, -427502, -849770], [9255012, 16455620, -861696, 683346, -97990, -234506, 141338, 358822, 332102], [-32044726, -7552947, 7639531, 193387, -7107, -566297, 683948, 456523, -376681], [-4466780, -18715128, 1681822, -658447, -653159, 1184015, -154709, 1126055, -520739], [-14488436, -891332, -1849190, 371920, -558954, -480840, 502666, 473516, -101312], [124395653, 13263625, 815043, -470154, -47454, 102586, 1578709, 631189, -3557], [167298362, -5486590, -3951178, 219398, 357146, -550662, -634196, -540404, -233116], [-101684676, 8017482, -3811283, -297672, 208219, 41330, -733025, -964727, 731495], [55402348, 26422232, -1980774, 79824, -508998, -401852, 31262, -2562, -51846], [149987392, -3683330, 856668, -76194, -613708, 750710, -766498, 496850, -231978], [-126226054, 5088792, -1478224, -31968, 372040, -900824, 152152, -1299252, 559420], [63377147, 27365683, -5456389, -1097363, -442215, 417879, 860204, 75558, -306710], [-99322141, 22239832, 2024258, 593362, 65696, -642410, 689094, 440577, 378935], [123076843, -6071061, -2304421, 28533, 506505, -756441, 2672188, 18842, -492530], [133306490, -660413, -1442983, 565829, -320633, 97315, -1880808, -723941, -373875], [171900954, 22460514, 1215506, -479440, 114660, 565616, 310122, -639362, 793982], [-35142647, 3150385, 4786947, -124917, 59441, -90595, -881926, 897980, 13296], [63123826, -21106910, 3562604, -392314, 382984, -651950, 208754, -1157928, 103188], [-156204538, 24043472, -2897762, 264016, 313382, 368040, -668746, -1658590, 842042], [231026819, 9794506, -1792508, 1076091, 197279, 79741, 765669, -390464, 397520], [101284216, -7324396, -3888890, -8612, -337442, -571500, 2486242, -882968, -120908], [25725630, -6486858, 6707296, -255446, -449364, 608214, -1250350, -255932, 6576], [21422035, 11488747, -4993159, -759246, -505722, -233842, 978903, 450603, 237], [40984210, -39093754, -4468706, 502784, 631076, 194520, 372190, 46538, 394822], [226288310, 18926714, -1611418, 161901, -199897, -530405, -1024821, 633491, 200697], [75558662, 2310080, 6447434, -357612, 768910, -631200, 1250658, -1076566, 310638], [214343171, -10595223, 4410135, 15701, -542949, 686195, -532092, 213804, 694464], [64504046, 15901298, -1064586, -1249970, 335282, 54826, -492532, -359808, -509256], [-168600481, 20345507, -4245085, -283496, -142910, -362120, -153821, 147067, 62549], [-159130632, 22963978, -4495866, 405262, -156030, 542770, 1747972, 675712, 884576], [151392859, -13160664, -4762950, -52676, 117710, -1461090, 1085028, -69673, 145839], [-556796, 3240714, -8194291, 642150, -534451, -649904, -1266415, 445437, -342185], [7647242, 12357253, -3554057, 332334, 108122, -1643790, 832779, -320096, -679800], [-126813607, 4043991, 1894225, 382209, -723025, 583851, 726454, 761990, -67474], [140742269, 27164902, -2420117, 599430, -641369, 778198, -958023, -579746, -598376], [-137277841, -13517381, -909019, 647134, 300198, -1113310, -521329, -1259145, 167813], [145458812, -20295592, -7375048, -765192, 201656, -587780, -877588, -435010, -323994], [-160458079, 27749515, 3536011, -943259, -1847, -773101, -1812848, -264252, -878400], [-91593003, 7662685, -8313907, 534402, -426092, 147470, -472777, -180791, -283009], [89174621, 17423739, -2929291, 333160, 475076, -16632, -2316235, -474233, -350319], [30317810, -32572748, -6005238, -819492, -566646, -25040, 24530, 531578, -122210], [-70652350, -29581817, -3550690, -88965, 430214, 788785, -602511, 1116720, 872262], [261032863, 14591911, -5144329, -90178, -9124, 149922, 1051437, -322487, 100143], [-6847865, -56415997, 360039, 400200, 814214, 83640, -62961, -1234681, 268217], [34735732, 21045966, 4327244, -400922, -787292, -519850, 770318, -377038, 540102], [40414386, 1738277, 4542827, 1129615, 109593, 1865611, -133352, 764791, 502843], [-31316721, 5527013, -7048275, 377736, -307258, -1626528, 1947865, 28575, 15805], [237906955, -31474295, 1918517, 441805, -750975, 1579915, -954458, 713400, 262000], [91073289, -20331651, 3824775, 1012459, 182377, 709301, -1571054, -1419800, -565168], [80496229, 31409836, 4636430, 122719, 485983, -518119, -1727213, -263670, 84310], [73399436, 10713381, -6383831, 60107, 633747, -4137, -890814, 1092767, 394167], [177294171, 27967470, -3276237, 319122, 590827, 112590, -230215, 1063728, -144582], [199237382, 10427262, 6497138, -153970, -194622, -205286, -2068312, -1442276, -271520], [-79511372, 29443869, 230841, -216941, 88331, 191069, 1539010, 478983, -390219], [-128316739, -3104304, -7096482, 1321660, 416218, -561110, -107812, 613753, 1166609], [-110539932, -18065900, 3502310, -715076, -576522, 1146508, -734590, 1187500, -578160], [183254721, -22666689, -1151733, 873002, 470892, -825130, 371913, -588909, 511053], [115812176, 18348285, 3222600, 666657, 142248, 268895, -1837227, -327790, 1082632], [-241348796, -2844619, 4736415, 575491, 208489, 1485085, -4315764, 367727, 898753], [229807988, 9848536, -4524176, -188732, 27956, -1474876, -385396, 128132, -128172]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_585_a_Hecke( : Kf := Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_585_6_a_p();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
function MakeNewformModFrm_585_6_a_p(:prec:=9)
    chi := MakeCharacter_585_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 6));
    S := BaseChange(S, Kf);
    maxprec := NextPrime(2999) - 1;
    while true do
        trunc_vec := Vector(Kf, [0] cat [f_vec[i]: i in [1..prec]]);
        B := Basis(S, prec + 1);
        S_basismat := Matrix([AbsEltseq(g): g in B]);
        if Rank(S_basismat) eq Min(NumberOfRows(S_basismat), NumberOfColumns(S_basismat)) then
            S_basismat := ChangeRing(S_basismat,Kf);
            f_lincom := Solution(S_basismat,trunc_vec);
            f := &+[f_lincom[i]*Basis(S)[i] : i in [1..#Basis(S)]];
            return f;
        end if;
        error if prec eq maxprec, "Unable to distinguish newform within newspace";
        prec := Min(Ceiling(1.25 * prec), maxprec);
    end while;
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_585_6_a_p();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function MakeNewformModSym_585_6_a_p( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_585_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,6,sign)));
    Vf := Kernel([<2,R![1347840, 2265552, 629880, -314868, -42890, 12972, 855, -201, -5, 1]>],Snew);
    return Vf;
end function;