
// Make newform 245.6.a.i in Magma, downloaded from the LMFDB on 19 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_245_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_245_6_a_i();".
// 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_245_6_a_i();".
// 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 := [560, -3204, 2208, 41, -109, -1, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0], [-36, -1, 1, 0, 0, 0], [-704, 1744, -86, -103, 0, 1], [5552, -2380, -460, 103, 6, -1], [1736, -2536, 50, 115, 0, -1]];
    Rf_basisdens := [1, 1, 1, 48, 48, 24];
    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_245_a();"
function MakeCharacter_245_a()
    N := 245;
    order := 1;
    char_gens := [197, 101];
    v := [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_245_a_Hecke(Kf)
    return MakeCharacter_245_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+1)]];
    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], [3, 1, 0, -1, 0, 0], [-25, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [-151, -32, -4, -9, 4, 1], [-29, 4, 0, 7, 10, -3], [256, 2, 20, 34, 0, -4], [67, -230, -8, 43, -8, 3], [-646, 49, -60, -34, -20, 53], [240, -264, 112, 147, 38, -103], [-1206, 434, -12, 148, -68, 18], [-2445, 14, 220, 9, 10, 25], [607, 44, 168, 198, 112, -62], [-3909, -871, -40, -193, -120, 112], [7483, -1402, -120, -59, -80, -135], [-135, -1068, 240, 567, -110, -155], [-10892, 968, -476, -342, -68, 598], [11694, 2444, -112, -727, 22, 443], [-23351, -239, -460, 1901, 260, -234], [-26588, 3068, 396, -1874, -116, -114], [-882, -34, 500, -276, -20, -1010], [-37458, 2576, -1116, -820, 380, -60], [31123, -1645, -1420, 1275, -540, 222], [6542, 6634, 140, 3531, -186, -429], [-12738, -2152, 1480, 464, 120, 1744], [-49346, -12580, -600, 2475, -170, 85], [8309, -8211, -2100, 2791, -140, -852], [-391, 5161, 3300, -2335, -220, -1470], [-47602, 13128, -136, 1023, -518, -2447], [-802, 6970, 60, 2450, -1360, 852], [-83891, -1286, -1760, 5587, 720, 839], [-42821, -10750, 540, -8955, -500, 505], [-8676, -19224, 440, 11056, -440, -144], [-43350, 46574, 528, -4782, -608, 1288], [110632, 320, -88, 2813, 902, 3], [11084, -2130, -7220, -3610, -2060, 3980], [32181, -5458, -2220, -12451, 290, 741], [-103772, 18076, -3580, -6168, 820, -4232], [92460, 60357, -1200, -3824, 640, -1821], [52135, -24718, 1580, -5275, -430, 2193], [-106497, 38052, 1152, 5371, 4064, 3361], [-160008, -24940, -1160, -4615, -3030, -545], [122214, 18954, -5792, -5642, -2808, 9128], [-343120, -16248, 680, 582, 4780, -3350], [42545, -49238, 9780, 4501, 5810, -5951], [245188, 27616, 3200, -2896, -3184, 12744], [-372673, 20694, -552, 18943, -208, -6557], [479804, -54192, 8700, -4156, -5220, 1552], [92604, -33024, -9660, -10444, 6820, -2224], [-252768, 52976, -2576, -6710, -3700, -13850], [231136, 44870, 9180, 26514, -8600, 6808], [-87100, -7514, 1852, 27742, -2372, -348], [9819, 13766, 9332, 2747, -1882, -273], [108607, -56416, -3312, -41677, 6872, 5493], [-562992, 126828, 3400, -27524, 2720, -1160], [-616155, -32823, -11420, 7247, -21460, 6480], [-208902, -92700, 10288, 11707, -7742, 2817], [-519136, -35868, 22964, 7234, 5076, -7846], [-699936, -67114, -700, -59394, 12640, 316], [-1175583, -155118, 5884, -4531, -5974, 3489], [301770, 57032, -11540, -76678, 5660, 3690], [294693, -26310, -4380, 17455, 7670, -3353], [-129, 12005, 13020, 6295, 13420, 7944], [-401936, -54952, 17356, -94414, -756, -26354], [1010096, -110640, -41360, -59776, 760, -1432], [-16328, -288730, 1940, 4562, 3960, -4520], [-392681, -134144, -1688, -17973, -15192, 1197], [-1472504, -5450, 31540, -21580, 12380, 2334], [-162591, -120699, -21180, -21419, 4420, 11706], [-150860, -133256, 5728, 17003, 11582, 26553], [476298, 6006, -12820, 64454, 16000, 39140], [714372, -7818, -29004, -99158, -10132, 17632], [299396, 140607, 35660, -39056, -11100, -24259], [-1632882, -335764, 34240, 40862, 3620, -25362], [-1004025, -79690, 14160, -9505, -12880, 11715], [968322, 296373, -20860, 34118, -6540, 12553], [-151332, -171240, 5648, -27238, 15148, 19502], [-1022738, -42140, 67440, 50732, 31240, -34600], [2704509, -312828, -12616, 67274, -2724, -18926], [-602202, -70402, -65196, 143993, 6622, -4507], [67835, -331898, -1836, -100231, 16716, -56111], [-862688, 514024, 35048, -54797, -20438, 4293], [-475886, 39482, -99416, -44826, 18776, -46096], [-2126898, -153058, -34460, 119266, 17000, -12848], [-544278, -217816, -8880, 13006, -32216, 21066], [-650567, -102679, -66920, 62777, 1400, 57918], [1569645, 263808, 16736, -40774, 38664, -56294], [-296990, 167044, -9000, 176854, -28780, 16750], [298822, -145192, -46224, 241676, 26584, 44156], [1968542, 76467, -82520, -115574, -31240, 109267], [-2168349, 171237, 21180, 743, 11580, 36640], [1983218, 65374, 66396, 89660, 76740, 16630], [-2803768, -308100, 64420, 157928, 20420, -38664], [253882, 97466, -1988, -114828, 15908, 141722], [-1735938, 361730, 105632, -79122, 45832, -36032], [610019, 255043, 81960, 95649, -47080, 53912], [983652, 56928, 5808, 36799, -63114, -50611], [1027869, -634950, -39780, 41885, -60230, -74935], [3664376, 435600, 59100, 53064, 51100, -28652], [-2029826, -712376, -26992, -50417, -38298, -27067], [958241, -531495, 86700, 112125, 35260, -23066], [5000365, -431866, 55980, 221105, 67090, -48319], [98757, -140097, 137940, -112775, 42260, -81620], [2476177, 385418, 73068, 32969, 9866, 71949], [-3729676, -148356, 33028, -308122, 51772, 71678], [-1750748, 638980, -94080, 205878, 25420, -13994], [-1492328, 506768, -301580, -236856, 900, -90036], [316114, -651346, 56460, 57346, 3600, 75128], [-311222, 625436, -158440, -102606, -107624, 86794], [-265978, 182604, 193288, 202048, 43112, -126332], [6360150, -904561, -74180, -42106, 4700, -172065], [-2191495, -210108, -266600, -67343, -58010, 266595], [-4341666, -477456, 11000, 154842, -45100, 27854], [-2481747, 101672, 184452, 200831, -19356, 70321], [-1138438, 823194, -55472, 172678, -19248, -9592], [6714379, 1440320, 41360, -78550, 55120, -100270], [-7756670, 620116, -14620, 131158, -35340, 25442], [-500064, 832287, -121900, -29916, 52740, 38001], [4846551, 530520, -50720, 279179, 5530, -116107], [450900, 843288, 220916, -239314, -716, -218974], [879774, -489604, 252512, -232243, 121878, 63967], [-4053342, 240200, 58040, -449750, -54180, -230818], [2916739, 417116, -49000, -641185, 70250, 114045], [282809, -185171, 145200, 111393, -7040, 105130], [2710094, 645198, -205224, -224094, 44504, 104216], [-861008, 1515476, 93072, -119093, 133658, -12743], [-2487528, 67340, 278232, 472323, 79542, -32067], [216042, 1087710, 128632, -490022, 36072, 46208], [-1166664, -81715, 427160, 309340, -8760, -60121], [-1305429, -172090, -146540, -426361, 44870, -108117], [-3271607, 2001376, 158300, -177521, 50316, 95729], [-7576130, 1386911, 29560, -491262, 114960, 129087], [-7855846, -720948, 179304, 670674, -55544, 11914], [2666340, -20158, 11500, -264654, 134800, 120124], [3070109, -770330, -120220, 729245, -4670, 127325], [-8383145, 1212850, -285380, -249565, -22170, 138475], [-10329763, 1229608, -240920, -503555, -142050, -4885], [7282487, 260625, 274820, 100763, -144620, -45544], [7638218, 1247836, -54600, 310238, 25100, 436374], [2992483, 344720, -350912, -452098, -135092, 96842], [-9062623, -1686792, 76416, -129839, -166856, 212751], [16319614, 657584, -16752, -506432, -78848, 142848], [2790799, -1433501, -67480, 62053, 37080, -429340], [7627029, 1349319, -380280, -340183, -12920, -37336], [3451558, -229232, -147056, -275852, 127192, -308292], [-8917920, 2551074, -139392, 428608, -21848, -411642], [-7094527, -1082160, -391440, -351085, -93710, 12317], [8388722, 805900, 310160, 36888, -27960, 89196], [7121272, -871784, 251024, -194640, 69400, -63320], [9317568, 2728791, -481920, -236088, -20840, 13393], [-3240769, -443928, 155360, -588727, 186150, 68215], [1171677, -1922640, -185680, -337640, 301420, -467580], [2672620, -568904, 157740, -525092, -152740, 378712], [9144521, 2170297, -10040, 287663, 204120, -237020], [3049185, -3411241, 23600, -454875, -3360, -89724], [19806472, 333026, 151552, 182632, -71672, -271698], [-5089818, -1030216, -170100, 133736, -174196, 190296], [-11556203, 1442060, -403608, -566022, -131488, -11842], [17573170, 915532, 482920, -446014, 79940, -414126], [11222924, 356344, -341392, -1662622, 12092, 110838], [-11860009, -829583, 362660, -10557, 71540, -433600], [645864, 3272268, -432280, -778696, -102600, -38228], [6136425, -650503, 98400, -1509809, 64800, -101716], [16898079, 397662, -154916, -583891, -234924, 200749], [7651334, -200444, -264680, 678056, -327600, -132884], [4732202, -30557, 659680, -747230, -111640, 3835], [-13936526, -1253102, 80916, -360664, -171396, 26326], [-10123948, 1679610, -724860, -982152, 9060, 527406], [1319595, -3737968, 172864, 2081054, 9796, -147526], [-25463171, 2889044, 720560, -793729, -23270, -259147], [-17264392, 1030372, -69128, 1576476, 296104, -227384], [9682182, -561664, 232672, -298833, -86442, -324963], [-17658586, -1609202, -44164, -524504, -7716, 301826], [6523824, 3422414, 3180, -310892, 67660, 596790], [26037578, -868254, -56020, 305524, -266564, -435966], [-4797330, -3906498, -321836, -436641, -173314, 784499], [-28415033, 2427070, -253240, -1027185, 230760, 388875], [-7104206, 6546320, -467280, -1225600, 142320, 340000], [-4950832, 14925, -382540, -304940, 280740, -73453], [-4357838, -1344752, 807128, -944521, 21866, -189951], [-20301006, 1688381, -175480, 162650, 33640, -110095], [3535817, 802540, -290800, 165505, -40680, -495085], [-14400921, -1930402, -12140, -156001, -230690, -584053], [-654750, 2610144, -93400, 1000324, 64280, -521300], [-15996673, 2197558, 109240, -2074195, -75960, -582215], [-17726072, 54860, 1115528, -342773, -240202, 116677], [1622425, -186266, 413060, 1651155, 70670, 673151], [-23382990, 583232, 190700, -80918, 17260, 275010], [8967137, 1530096, 557904, 690190, 293720, -288890], [7016374, -5820202, 263096, 1495066, 389264, -638744], [-8034344, -2680760, -59720, 567044, -342800, -439732], [-6791342, -120580, 345740, -1578310, -149460, 187942], [-16009041, 1255940, -517620, -290835, -734340, 179535], [-34151966, 2819180, -1439120, -1618595, 225110, 573535], [16824918, 2780448, 1025060, 407382, 31700, -904834], [-9900138, 3589548, -81360, -3120, -194160, -563700], [2925129, -1161052, 343976, -2265184, 386884, 180776], [10938046, -1544000, 367760, -1564636, 265880, 567708], [37521158, 2224666, -416780, -1508422, -152360, 657524], [9019008, 2073276, -36580, 879072, 72300, 850008], [-18637942, -3842696, -41184, 167585, 146290, 275075], [-559168, 7716366, -100148, -82158, -188252, 850672], [2272268, -7194702, -566940, -2238704, 185700, 755870], [-16973387, -3567212, -177176, 483388, 20712, 467528], [-26941590, -1489266, 209308, 809868, -208628, -109322], [17313687, 537660, 372280, -471467, 598030, -732369], [-8149888, -931380, 322812, -1083162, -283428, 179838], [-20976480, 2019792, -19060, 1205880, -298980, -226812], [9360865, 193940, 19080, 3058980, -271480, 170600], [-11855631, 4403138, 873436, -292889, 419484, -905089], [14185326, -40738, -131940, 1855518, -304800, -290700], [-489678, -2757660, -1133920, -888175, -205690, 335835], [-1355131, 1350453, -326060, -208041, 104140, 707212], [7311597, 8561595, 175440, 218877, -250480, 40400], [24180748, -3623686, 888496, 1174700, 487680, 204250], [-38769581, -3564062, 1003276, 1662671, 466574, -1581969], [1930976, 9091497, -1168600, -1396616, 141680, -328169], [-10935811, -8203316, 144088, -472162, -48588, 1346038], [-16103567, 925118, -911960, -4165869, 270720, 680355], [35779465, -1179454, -529340, -2735337, 365750, -14833], [41701614, 7553168, -70024, 39261, 36494, 50891], [-33077650, -5952534, -976888, 1910902, -334992, 469952], [-8411693, -2655520, -343408, 465658, 594292, -161322], [22440001, 4847710, -572640, -3395581, 468440, 14763], [1558367, -4995617, 1771600, 2229159, 799280, -1710766], [-16182530, -4354376, 669208, -2012257, 1091162, -613647], [5378898, 8302716, -180360, 2320822, -50500, -689042], [-45172172, 5657498, 749744, 955328, -520128, 494878], [-6377834, -6032003, -161080, 601678, -263600, 512205], [-45874326, -2078958, 1274884, -286916, 632076, -713326], [21194443, 8786056, -565360, -1070741, -1020270, 1166525], [-12800597, -2371778, 868392, 1181471, 442824, -1345709], [-19544628, 5349830, 116520, 4105700, -18320, 289190], [6932389, 296408, 609696, 462816, 403924, -282524], [2007955, -2612399, -679600, 3019763, -275760, 1072132], [86070373, -728287, 687680, 1025707, -216320, 389976], [-51127738, -6149778, -1970044, 1667877, 420038, 1252937], [-3846211, -2392736, 339200, 3803921, -431930, 1280543], [42142325, -2947778, -486736, -392071, -502464, -439391], [-57358528, 3285610, 2227760, -779520, 494680, -298850], [-67803974, 4037180, 150900, -329314, 153700, 990050], [-33407971, 6960690, -1392500, 1178935, 20020, -1352865], [46143084, -5106736, -1366780, -3028232, 99060, 152540], [38188112, -2201412, -954872, 4260019, 207246, 1964069], [20734026, -11613216, -1017880, 2537002, -103540, 437062], [-36159788, 2174678, -423832, -2320236, -504984, -880146], [804118, 1235911, 399340, 736058, -280020, 1310059], [-21535131, 4182600, -542080, 1324445, -1094920, 1423515], [-46980352, -2077356, -1534664, -945180, 117400, -1460960], [53898299, 403618, -138680, 861569, 1282840, 37097], [-8613126, 1587464, -1388400, -751558, -1354700, 991334], [-30888521, -200692, 508696, 4431716, -204456, -212504], [-19944620, -6968641, -415140, 902380, -425940, 2044601], [33765795, 3362480, -1495600, 225100, -641140, 675280], [1416052, -817222, 1644340, 1107390, -326080, -1378720], [-31238203, -8852498, -182024, -1723383, 325488, -359223], [51372684, -14445568, -1542016, 843609, -60334, -892621], [-37231417, -6012357, 1093600, -2725833, 283760, -483514], [18671951, -10678130, -1023420, -2829405, -457730, 460039], [47867208, -10474822, -946780, 217556, -965220, -519470], [17290698, -14456269, 488200, -620186, 522760, -825225], [-31610799, 10408485, 2759900, -1818075, -204740, -660446], [-38222422, 4373160, 2169328, 3111432, -480592, 1354832], [33359400, -15219754, -850620, 1682518, -277960, 108892], [-19237838, -3403660, -2995840, 4019518, -716220, -239194], [-18619093, 5665404, -1136540, 591081, 424244, -1923349], [-26645560, -7719812, -25944, 288926, 1143884, -1542714], [-44814053, -597958, 620444, 2102019, 345286, 1768579], [-79479925, -1240539, -2337080, -1196117, -212680, 1128112], [-21779611, -14599646, -299700, 2801303, 1029030, -2772665], [41405014, 8481220, 1639720, -205305, -1397690, 906505], [65452698, -2343412, -779580, -2012798, -1167420, 850886], [-90876524, -8587310, 760220, 285896, -1043620, 225630], [40117762, 8496880, 1725432, -3144782, -258048, -932002], [113582838, 1913336, -1001560, 1537328, -656800, 515304], [47741299, -12590066, 514960, 563981, -885880, -1042527], [7374368, -8886392, -2446580, -4974324, 377820, 509040], [-5115832, 1698420, -469752, -2888213, 792198, 1751597], [37799329, -7914536, 788128, -5040792, -1356948, -311772], [60370249, -4635214, 1308592, -460763, 1934368, -55263], [83050096, -2487115, 948940, -727244, 101140, -739005], [41573344, -151592, 2847656, 2760336, 1122504, 690096], [96597459, -17505186, -1006360, 636797, 627080, -620631], [397922, -3627144, -141728, 973267, 657798, -2848663], [23720801, -689433, 4318880, 7906313, 1312960, -2635000], [17958454, 16171868, -89664, 3735046, -737336, 558006], [2553754, 640654, 1334900, -2365722, -719720, 1830820], [-51863839, 19015450, 1518940, 4513295, 199470, -2574281], [-25599512, -3062042, -198516, -3534042, 1204852, -1335092], [-79733945, -8289358, 3140044, -3611041, 1744846, -2449921], [18765104, 7675084, 3499408, -5303797, 457362, -3090407], [83155847, 20379085, -284660, -7057177, 343420, 685856], [-29827996, 11230474, 1692180, 454346, 167760, 1443868], [-10747143, -14861532, 2366476, -3631809, -1035716, -1711859], [65269805, -934344, -347040, 2774323, 364690, -1356723], [-17889362, 10980560, 2296488, 5069607, -1065262, 2425337], [-30470826, 27449360, -3940500, -8402480, -114580, 2394520], [-55312904, 8348654, -1585420, -4350808, 417500, 427962], [81128367, -3489120, 2527092, 2676473, -1368148, -1443297], [49706784, -19244896, -2439980, -3382128, -1298700, 800964], [-21529470, 5594702, 126180, -5267620, 278860, -837682], [-3176001, -7622904, -3429000, -881375, -21010, -1863785], [-10979882, -8753630, 128648, -5925418, -202752, -3156248], [29073993, 12918525, 80800, 388505, -2131760, -1653598], [-25645786, 4559214, 2340228, 4839868, 2228932, -1253562], [7280522, -29008122, -1969660, 6472004, 1439180, 238014], [-790542, -10129872, 3274580, 6011002, 489620, -65174], [-87076280, -2615312, -2021824, -4718189, -236786, -591639], [-23325838, 17264194, -1125060, -8482064, -904636, 2040646], [68970515, -12098808, -2361160, 3156455, -2118630, -1949447], [-47848824, 10804215, 1277200, -263756, -665720, -2825907], [74720688, -8251860, -4088232, -1191778, -125172, 1726582], [28710574, 8509226, -2932548, -3390883, -304702, -3466143], [38692299, 1709489, 3333760, 8550703, 67840, 782640], [120480816, 10931685, -1900680, -5994880, 1423160, -3654141], [-18839547, 9082640, -6033712, 1578492, -462392, 532252], [-51780285, -5995494, -3043028, -625043, -924492, 1245017], [54713994, -8412516, 3987588, 1865488, 75292, -1968492], [-16972380, 27758156, -1137080, -5660662, -1780660, 1082562], [74207410, 13268162, -1989076, 8194029, -2175154, -595651], [-4263406, 11627898, -4720044, 4935436, 431204, -329774], [-21471452, 15480418, 4229380, -2427134, -657600, 266780], [54493002, -14572404, 5010112, 1875517, -410402, 2870487], [7235930, -11335779, 5631460, 6371898, 1041780, -830763], [21260062, 9630098, -4756180, -8346520, -880660, 263790], [14592719, 9645408, 1807456, 5849466, 476224, -1860974], [70809197, 28946724, 262600, -5106899, 1741264, 554991], [-31482769, -9519105, 2745740, 7502679, -212900, 2797438], [162687100, 8000624, 778060, 1373144, 288140, 229620], [-56366912, -10601950, -1100580, 475840, 1558180, 2253342], [-58925396, -428396, 2267048, -949322, 1562652, 3179798], [-142550538, 16437180, -1313040, -198182, 961900, 3621666], [104715290, -34312428, 164724, 1061744, 1874356, 2893604], [-79456659, 16869465, 1814440, 5062801, -1664360, -620370], [-38730841, -12028704, -3367668, 4464997, -96052, -430973], [222244781, 3778525, -2840940, 951685, -1787900, 209034], [28490920, -1088180, 7846680, -769310, -328620, -3634750], [-211453332, -5228844, -1705200, 1849382, -2241260, 2066318], [-24105683, 42496204, -3025272, -2749472, -1669068, -305752], [-6824391, 11270726, -2690760, 1403515, -1182920, 2555475], [-81904846, -1365636, 574360, 2803818, 1041740, -3106030], [-187861170, 7765752, -565360, -378454, 1657180, 2527694], [15977200, 19991228, -1771024, 4713641, -1277906, -2708269], [-2676798, -17773192, 31076, 8117436, 192524, -2690524], [-75278682, 7613856, -1615040, 9993952, 671160, -406072], [64198280, 51340792, -4204276, -6251626, 889476, -1210046], [14426074, 9555436, 4831632, -11471063, -1648762, -869813], [-205278155, -2517851, 3052740, -4170031, 1887220, 1100270], [-110716808, 13531358, 1667436, 375646, 1448404, 4895436], [-22177255, 19660714, 1537100, -13803721, -666570, 1353175], [46875099, -12771448, 2029084, -2519711, 2009676, -2026441], [-64966458, 16258190, 1473820, 3521948, 1648740, -5279834], [-19977918, -2040468, -5197296, -3408451, 516006, 1997599], [-101799240, 12383807, 2504080, 6978532, -1044040, -1599275], [-162570478, 31169016, 1539584, 940305, -2467510, 2961995], [-259842362, -12091840, -4753920, 650590, 2161660, 1919562], [-83408158, 529354, 1213140, 28996, 2589684, -1747534], [19050394, -22657810, 1699480, 8397770, -495280, -2292960], [135695474, 36142666, 230020, -7624520, 868380, 1535510], [24639263, 7060135, -126880, -4132755, -3837760, -729808], [-164446109, 12159400, -239320, 3596945, -508770, -469841], [-11387566, -19745516, 2635048, 8396128, -1057848, -151732], [74226171, 1834527, 3253580, -9683491, 1788660, -4402124], [-48308633, 16642898, 2987828, -8234091, 1433796, -4055511], [-142189707, 612023, -1663560, 13574657, 716440, 70976], [-228104420, -20603978, 4029620, 1428610, -181960, 3233128], [128356365, -7733028, 2261840, 12138961, 1106550, -2015941], [-32881845, 36962282, 1020920, 8416617, 57520, 3052825], [-139295773, 24984216, 4246672, 3730442, 111128, 62202], [-58953981, -20466882, 5546336, 8820291, -1892776, 2702591], [-59716613, -22227860, -7537968, 7097463, 603312, 3899733], [107395021, -18375415, 6730100, 18609879, 1522940, -4031512], [-31584110, -877732, -7435064, -6300724, 357984, 760456], [-125081706, -24816196, -5802752, 12827658, 550152, 4228218], [-301467912, -17986762, 4910940, 5008486, 108920, -1294580], [-175457967, 24159126, 9454480, -1251151, 2002936, 670409], [237007872, 9553542, 2113504, 16252964, -2198664, 1872454], [-145935554, -7681490, 3893180, 1110476, 935420, -1309650], [254948482, 3264440, 5316192, 10064068, 558952, -1017852], [-218657100, -19608178, 4894500, -12620984, 2747220, -1470046], [119064274, -41627452, -24024, -2226649, 1557494, 906441], [-70656556, -56035142, 1187420, 16289194, -1202880, -66868], [134413702, 7571533, -3138920, -1331866, 1505600, -5482011], [-262002284, -23528608, 933000, 4990324, -818160, -3749884], [285733295, 11862300, 6249840, 6977975, 1584080, -6692955], [26363230, 8403287, 3200680, 15370382, -310960, 52035], [-151135726, -28545930, -4783280, -5082950, 1522640, 1189600], [-141495277, -8176422, 59420, -11162483, 3517210, 5491881], [-413433, -11931487, -997880, 22818863, -1544200, -2255232], [30748499, 20965759, 884460, 1487057, 6888820, 206504], [-120412930, -25813368, -4715536, 2047544, 1129456, -2060656], [13000906, -53417080, -860520, 908434, -4300500, -5384602], [180274018, -31540966, -7132964, -938760, -1772500, -5047690], [19408596, -11047648, -363260, -1090652, 3230980, 611520], [179881204, -33019270, 596920, -10009860, -1301360, -4522550], [-88724308, 20120058, -10848860, -18126660, -1698060, 5941410], [106425338, -8855844, 9552060, 11616304, 5218556, -8551916], [-66069105, 4377720, -611200, -14122610, 3566380, 496290], [-115388893, 6631314, -4483972, 9242873, 3160692, -159347], [-83962236, -1837464, -3844088, -17545753, -58222, -4739103], [108831462, 18470540, -2093568, 245203, -2551918, 1158913], [-26636752, -28240904, -7708840, -1602018, -2165860, 5474258], [-209125898, 69103495, -3693900, -18258738, -820300, 1389095], [-50314358, 49858640, 3370400, 817482, -2970740, 2558470], [-206162862, 22346592, 2181352, -11106069, 1064314, 41461], [-114511416, -640228, -3514876, -7410686, -4255524, 4778954], [-33436233, -53007850, 3704940, 5895813, 174130, -3457379], [-8563918, 10009030, -4209100, -9351795, 2479810, -6441395], [160412579, -13873011, -2818320, 20334203, -163280, 6302000], [-42882863, 22039856, 3153664, -9018835, -4708480, 4088475], [187370188, 32863306, 815700, -21416048, 1283620, 4504038], [201405930, -52098576, -8294320, -1310836, 1269720, -5184140], [199595102, -18789008, 1693340, -3448994, 1053100, 3049182], [-127703871, -55322266, 5462268, 12637463, -1393748, 2807843], [-78871604, -34497020, -2130280, -198630, -4203820, -1455646], [-60862276, 24984352, 2755504, -3201566, 491196, 4419614], [186937692, -38207826, 592240, 14930016, -9856, 105146], [12549625, 11351434, -342480, 473015, -7115160, 4501411], [87048998, -1074284, -8022880, -20802852, -1888720, 1946624], [44541174, -5251941, 274360, -1526534, 1766960, 3405163], [-24383852, 20114276, -3597040, -12067011, -950954, 6646759], [-162483451, 6625926, -6606900, -6684785, -458370, -2379085], [185124205, -21698683, -3160400, 16080311, 4340720, 5188944], [-119455710, 11337138, -1876364, 8694096, 3725164, 4980406], [-57179128, -5473068, 136880, -16822094, 2073660, 1623362], [492967565, 48881134, -6940740, 9819125, -2817870, 8100541], [129990028, 11407796, 1892980, -28736248, 1931620, 1446128], [149050755, -24699624, 881232, -19897848, -2475972, 3043572], [-399432251, -28928102, 1396036, 2965951, -387676, -3635009], [-58328142, 27903654, -4480464, 8936610, 1284760, 12422560]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_245_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_245_6_a_i();".
// 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_245_6_a_i(:prec:=6)
    chi := MakeCharacter_245_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_245_6_a_i();".
// 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_245_6_a_i( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_245_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,6,sign)));
    Vf := Kernel([<2,R![-504, 900, 1682, -385, -99, 5, 1]>,<3,R![6879276, -2078280, 87921, 13100, -718, -20, 1]>],Snew);
    return Vf;
end function;