
// Make newform 342.10.a.n in Magma, downloaded from the LMFDB on 28 September 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_342_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_342_10_a_n();".
// 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_342_10_a_n();".
// 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 := [-170483716854, -293829896134, 50419290137, 19915656, -625764, -2, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0], [-1, 3, 0, 0, 0, 0], [14652669814184201286478, -1624998468090228148900, -399995562051604839, 19223977094691387, -440817033759, -30446374007], [280290977631684526237146, -54120018917260744582720, -23486181588034325343, 664058165449914069, 7295939607357, -1057965228989], [-321405042828072210329502, 47851711158208684707880, 19666960081452118521, -604461966582584193, -1636190558739, 969408695993], [108369377936650159447878, -52704507854608212387560, -17721379604591337177, 652716827272415361, -2973783866661, -1043143392601]];
    Rf_basisdens := [1, 1, 3067358990656162100, 82818692747716376700, 55212461831810917800, 33127477099086550680];
    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_342_a();"
function MakeCharacter_342_a()
    N := 342;
    order := 1;
    char_gens := [191, 325];
    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_342_a_Hecke(Kf)
    return MakeCharacter_342_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 := 10;
    raw_aps := [[-16, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [64, 1, 0, 0, 0, 0], [-1658, 0, 0, 0, -1, 1], [11145, 2, -3, -1, 1, 10], [23822, 15, -6, 25, -1, -9], [83626, -174, 1, 92, -70, -86], [130321, 0, 0, 0, 0, 0], [165461, -381, -49, 143, 53, 310], [-356057, -256, -292, 619, -657, 16], [-561368, 1171, -150, -883, -275, 553], [-1589530, 4763, 730, 3485, 253, 945], [936147, 2928, 2090, -13, -941, 1876], [-3846538, 7368, -640, -1712, -3155, -4773], [7187161, 12097, -796, -3643, -1151, 4480], [17548855, 3314, -5998, -3289, -5657, -780], [31308894, 19838, -3190, 12602, 6486, 7756], [-3088556, 16422, -5604, -6110, 4507, 8425], [1262468, 1510, -3716, -40502, 3526, 25206], [58193850, -10538, 2590, -50594, 33186, -1132], [-35682036, 133002, -2652, 30310, 27735, 55757], [-71426024, -34239, -7418, -33, -99255, -12263], [143366511, -89980, 6844, -30861, 51103, 62248], [74159139, -63140, -10964, 28631, -45245, -119432], [-399697186, -363814, -35388, -105354, -29314, -53946], [-54675086, 472681, 6205, 40188, -670, -78590], [-486034460, -507063, 78014, -101881, 118211, -18017], [-224464918, 754958, 36168, -48750, -49814, 2176], [-515576006, 133377, -186794, 91447, 95279, 48907], [-46353737, -132844, -31108, 97643, -486625, -311216], [-344533912, -57673, -12630, -49111, 487917, 593793], [-340457803, 1533460, -217253, -993865, 312765, 457382], [512432442, -1199270, -230737, -1521208, -56118, 204566], [-450317094, -1031456, -200096, 985904, -492557, -449347], [883648374, -1286581, 606474, 1103202, 394950, -566252], [-1461029112, 832305, -419626, -1330481, -339655, 5657], [-1101465662, 3139208, -200448, 1727432, 177560, -1024136], [-2647494252, 4905028, 531384, -2923612, 997464, 275096], [4062750348, -1940088, -804234, -1032120, 522948, -1138572], [4999141977, 4177248, 667156, 48837, 871033, 577944], [9682585074, 330132, -987622, 1330414, 380986, -230964], [-801827338, 1201549, 1351734, -367685, 822321, -1353087], [6045957079, -6088913, 1383428, -1158053, -3421361, -1876368], [-358435562, -190770, -294724, 5323714, -2332716, -2061656], [11736739916, 3886107, 1503483, -3876982, -772356, 926158], [2040470066, 272902, -2339436, 3405738, -2429021, -313767], [248026220, -5412820, 1516368, -4460044, 2609388, 8327580], [2721585248, 1135219, 3001562, 481597, -7264069, 387915], [21860709884, -10543240, 18510, -3664376, 2047156, 13352804], [9942694696, -1905314, 39260, -3273078, 2303765, -8456849], [22591956048, 11031544, -3456291, -3387310, -827408, -1590766], [20979586775, -2444391, 2158882, 4476135, 1982303, -8289492], [27609541938, -9303610, -772940, 9767482, 10956336, 14287916], [44079685679, 10997928, -2915515, 19695533, -4476729, -2880070], [36411272597, 11300000, -1235802, -10016171, 2556741, -1560596], [27394291023, -35592019, -561074, -16423449, -490137, -3714828], [39603510685, 12358332, 9563684, 9057945, 2085773, -10228856], [40148266584, -14902618, 4810676, 4880834, -9536430, -1918846], [15807849824, 36893502, -10498308, -34482646, 14694361, 18424779], [11975308249, 63983384, 3366148, 8330933, 12639145, 17570152], [-13036049266, 33220628, -507096, -34428148, 3871413, 3999699], [81574382765, 30392864, 978474, -26275483, 4232077, -6495468], [51387845008, 63238434, -5579420, -1092706, -6311498, 36621406], [62486171461, -52662379, 7109980, -3726751, 9901069, 24921232], [32326957254, 2733574, 15167636, 8663778, 15228658, -30446974], [56626593629, 75186220, -7032342, -13441851, -5912587, 13993356], [16007146904, -73118134, -10913676, 40027654, -39969134, -48603774], [16147690702, -56730748, 6712944, -10824020, -25503948, -21877004], [138171639629, -33163306, 9562509, 67630035, 48431477, -18476902], [16275987992, -76911446, 13448260, -6643282, 24659319, -68834667], [87762407118, 110312356, -16350256, 49258582, -47524482, 19836304], [8633960035, 8618371, 8014172, -45870857, -28118485, -59352848], [228591928, -147048710, 5160876, -48599090, 24644834, -9445958], [-22119394346, -82532193, -9267470, 100185673, -85266871, -36843923], [14176531092, 16110666, -27559220, -18272026, -13540308, 80124632], [115075851166, 33677382, -11537192, -83548954, 72941998, 7285824], [105355549440, -43554647, -39652290, 126910732, -19285888, -28889620], [-160761191912, 261226702, 30000636, -50785126, 130685443, 22217569], [-9168742449, 277469712, -16971666, 45555031, -14752185, -56115212], [85025655470, -262148238, 23665932, -25950722, 7326230, -99047298], [-187745320667, -289032650, -25521538, -21799403, 13998581, -11177636], [31299045750, -258507589, -25846822, 2003533, -42232349, 181793723], [-32473419458, 125435930, -72058792, 33059702, 123756838, 15230904], [241789258114, 278777814, -36424164, -30267094, -50462874, -45294554], [233761641732, -67822361, 9669578, -44111543, -129458199, -126833275], [-429795040391, -347269030, 39703469, -52783889, 86827569, -10348790], [-364108266535, 360893544, 985250, -36653951, 12225993, 180852580], [98468384984, 106623856, -65757944, 122333784, 83111447, 97406145], [-356290278230, 178216159, 6135998, 240992750, -107144326, -277643524], [498612864478, -32136898, -14403116, 80924978, 23050077, 132093775], [-194218760797, -4922112, -47224295, 102999993, 46377867, 77950066], [-789222364973, 303217795, -19085997, -10586387, -102128493, 171000190], [354387170516, 632114969, 39221238, -312965001, 248368433, 133787025], [-540266479399, -505503572, -44370112, 159216509, -155982119, -85300480], [676465396790, 86997300, 88329720, -65696460, 79372905, -4220889], [-227034978853, -877482667, 61648045, 112462953, 73927275, -138356206], [-797419983923, 558775010, -42050418, -121609571, 80922533, 187980212], [-349775071377, 886735016, -31202678, -118341329, 10282247, -324870948], [1324806014408, -154348310, -74498068, 76954262, -9087596, -325067280], [816491738300, 601526558, -35089028, 496381098, -189715911, -303712389], [958862564284, 176348930, 17588484, -3230258, 499070184, 444072268], [617784126310, -421220917, -136258788, 81883606, 387230694, -468119784], [-102932365204, -158507658, 88029178, -293586480, -600004036, -120712476], [-1070200604323, 251762336, 65603780, -67757383, 505055573, 36173024], [187149269076, -972935576, -26974944, -884653048, -25543116, 365226668], [657115677384, -1383632884, 92892272, 256835788, -234070655, -274815073], [-16208064757, 794812910, -20642317, -136138507, 347363155, -121731530], [-996333466092, 1900736204, 47840140, -113416180, 191234996, 490647640], [-476929927928, 354516520, -354288484, 167288560, -161284224, 730804304], [-36399393962, 668306416, 70573560, -952725424, 258004690, 403546366], [1344959082584, 1879390237, -168148594, 306131667, -278194857, -816000381], [1335419024464, -1089580708, -12413552, -796732148, 82082443, 830467237], [86608509858, -1324038428, 102750309, -676313748, 251473954, -599660190], [1161053293524, -201176180, 303018376, 975702292, -443241196, -736281340], [-74530536146, 1816243182, 135370340, -163889726, 94361169, -407188613], [-554985301065, -847402460, -342372312, -373456157, -562192257, 874265880], [1046291515014, -1790350636, -17489944, 528525580, 4975153, 104817047], [-1052328946107, 1468423739, 301564346, -602716899, -101539091, 615751452], [-232324921838, -1964704821, -69591160, 367519258, -1098400094, 156862720], [509847183084, 2124000892, 79420194, -1430600976, 595759500, -222535948], [1550005424582, -1071119417, 42172818, -683980207, -314263771, 450870273], [-364996803346, 1300990694, -716087076, 468124026, 235714808, 1125126900], [670295757299, -3283974, -230734394, 2045530475, -752781877, -1001139676], [99078532042, 1974409316, -59112234, 140662430, 67627330, -1182691180], [-1434364721494, -831783212, -326326152, -575103340, -18601873, 592194849], [2412902003530, 1003976697, -88444115, 689609156, 597068666, 24889378], [-3016140608154, 802530340, 589032824, -76243300, 60245540, 410488340], [2683450830885, -1304086491, -631032356, 1304980833, -931348467, -140857168], [-2828722896682, -4578949784, -438250848, -102901272, -725391665, -896104239], [-81937148666, 499103410, 82879276, -1709702850, -973266818, -801850298], [-3382766553822, 2535606644, -137921352, -944854724, 309543719, 1115482865], [1525975904518, -1849634894, -76228970, -1751955798, -616363634, 2104606596], [1143310433360, -3925421387, 253901734, 1841673467, -335355495, -129332559], [-2913300892116, -7671995152, 250895464, -415035736, 1334193317, 92220083], [-1516498674938, -3006581462, 83463417, 3666792, -1120135658, 317428666], [2007879950472, 2767977778, 502390100, -326269650, 307861519, -161295211], [6518602515761, -3751639182, -17934856, -2092780555, 1374915609, -580478584], [-739570312764, -6095136328, -336182912, 1092508120, -2132082024, -1573181080], [5269517296489, -4517312206, 640444052, 2774779077, 527088097, -873979664], [1594560231704, -2313817394, 303587043, -1899177674, -1653934792, 1273857358], [-4322388236444, 3598765702, 492112060, -2085295398, 365712820, 1044399640], [-1485617680210, 1433908877, -392958982, -4675377414, 482295614, 2912422644], [2424271798534, -3611599894, -948904724, -3378059274, -556917631, -723277229], [6253625358622, 3350366896, -943081204, 1979670462, -1301355754, -1021326768], [4188746875746, -2034892035, -954181978, 112167131, -184888145, -2771235949], [5891902459362, 6289153286, -779684360, -2605791366, 520537170, 1899101088], [-824924142482, 8768635912, 286680032, -2997372088, 633310764, 2834540500], [7834538313263, 2491208232, -110194630, 1400781199, -21461193, 3721313836], [1781666068194, 1788672076, -1289574168, 477324076, -1376408585, 4432839641], [4931823800030, -7274905734, 1610704446, 2373588738, -838101346, -627494516], [1757571944666, -8489472897, 469741906, 4503069417, -1994048465, -3453493737], [2709163174950, 1932719124, -1542026507, -1435502832, -1551739802, -1009527486], [2046992284194, 4187701644, -1353860104, -1399626516, -2138177769, 2571655385], [13009011249292, -2385094268, 214372236, 4962223076, 2092683876, -2728654000], [-7866782680160, 7594992530, -915856052, -1164450210, -3636545584, 1812010420], [-4604831104812, 6042049636, -503128234, -1997462048, -1861348524, -3196300676], [-5766799742016, -17141979926, 215628860, -1022183522, 1499171610, -3310319806], [2421971676364, 7853834326, 1943471290, -187455904, 238199212, 1973040068], [4625752945324, 2988191970, 714349460, 5723468638, -372604065, -2849013611], [-5511022737499, -8752192778, 1253553714, 61096781, 3253461445, 4661867044], [6549046379749, 10569756488, -19589432, -6937890999, 3312773653, 882767168], [688323655417, 3714531200, -238801146, 8526776377, 1078744801, 1897118452], [5449419405632, 4099671020, -1083610664, -8314165460, 5130300500, 7759516188], [-5379862676792, -5955599588, -477141332, 3070197568, -2408989448, -1399469816], [4783758763179, -7035366324, -1240484496, -1943983993, 330658059, -6099760240], [-8642477663036, 10309110016, 35797156, 5036872412, -3317573420, -642689896], [-5963173365244, -21086675097, -572485150, 1306394345, 1170617679, 2810420175], [-4974597881424, 13818615020, -1788221056, 9366541580, -2138090373, 1487163077], [-5653915213758, -1601195582, 910297412, -7381395410, -2157290208, -2237004364], [-7196945418494, -4515483833, -3808404474, -3485677258, 717250674, -3554178676], [-6433519413594, 2969860224, 210075464, -5638212626, -4330901242, 5423941648], [1835693125994, -21247410051, -934958970, -1784780917, -1876858787, 3559752597], [-11667776461227, 2461574557, -881496203, 405569755, 7192038437, 7702768738], [-7796452198034, -19426753682, 573692852, 1237864602, 4912718546, 1912685986], [-856592224200, 1063262277, -29087410, 282290395, -2629354873, -9705706381], [-12539461038264, -15540439124, 23899317, 11222835882, -7925163512, -5812415358], [-16545288442892, 12546945420, -513767928, 4025283692, -671726316, -7838245988], [-9640017780238, -5509654885, 1945002474, 278625854, 530905906, 5866527684], [-10036439134820, 15263686531, -2150282918, 2664374429, 13255415, -11278484753], [-19360058905988, -16990492368, -2033166376, 3146804328, 3109072747, 4732928653], [-26259358192434, 5096420990, -2726515564, -2614617182, 1035801481, 2989041971], [-5926030051604, -16720889282, 1288484828, -8197977548, 7720638244, 10798976448], [-6510787114658, -16239196931, 1535519542, 465297147, 3767220685, -13040429531], [-7741901572363, -499430132, -1535148238, -769019683, 7747740749, -3558345060], [-23197026746691, -6833656111, 4195648612, -1548737831, -3947233259, -7539518992], [-2173707728246, -24085548565, 4353277808, 149156274, -1654829046, -1035144288], [-25699613225442, 23923412469, -2601921226, -3639676141, 7780923673, 6767336489], [-34729836245340, 23306263788, -257441472, 11601266692, -921796068, -1003435588], [9274149760630, -24807102246, 300148132, -1671223578, 3033386742, 3308420110], [-45795450620187, -19346653457, -4061325865, 4098481487, 6606207973, 4793394918], [-8670427125306, 9650884860, -980139664, 8954276916, -2044942080, 13334177096], [-10620368997531, 13463370644, -4395835105, 11547402767, 8438766541, 4389104174], [-34915451276660, 29769945186, -6083976580, 2391820494, 3360999076, 7165030720], [-16564464187513, 10890799816, -2085864526, 134615479, -9518635769, -11899772828], [-20146289377039, 4708599198, 6882371238, 4751525969, -737705855, -9486085204], [11148847336791, -16314598920, 2651513488, -14080186893, 2436132607, -15494487912], [-12419940269948, 19047620970, 2026482532, -3385270506, -12633704289, -2974051547], [-8185958709610, -66432089774, -548989380, 12514880318, -3462568642, -977270010], [-14566828432344, 21972483952, -5093782184, 7797842808, 4817514264, -13526593472], [-5225611527465, -9748760105, -1809474624, -21331852845, -3246222977, -4530248712], [27704621468303, -19434833630, -1480921188, 10812568483, -11097458161, 1467007720], [-47998104138508, -6061132175, 6702073422, -4444888129, 11600127437, 1437718341], [45095292206026, -30419380361, -959478134, -5146433839, -14749556875, 5836898113], [-16578507154266, 27062345700, 5575322992, 1848669484, 11161280500, 7525464308], [-26316487888491, 31704280986, -1584456262, 13137869021, -12837012619, 3798041060], [-50180037731146, -14118602739, -5030414636, -5107866298, -2197363642, -9845702056], [15110259807430, -3602942760, -3583655600, -13817955752, 22206876515, 11769961981], [-32262967489450, -39391477120, 897985544, -15417297602, 8522616902, 10027768288], [31734989430910, 20454980768, -1614906727, -10672262032, 6701448078, 6195856634], [24462325768004, 2335355564, 9870962344, -18925605468, -9464984430, -14872587642], [-26701953518498, -5143947084, 4000417304, 10625223148, -14844904632, 12832711312], [-12556254421084, -13619267255, -9919202887, 1298356398, -4992410476, 19210863994], [-41471098458254, -59102187898, -10383431740, 11970199706, -7668473477, -16806271151], [60022426572042, -28361236902, 2158088906, 29836356166, -10225625622, -15089258572], [13310468831838, -59811948666, -5684353984, -3812136282, -30672079802, -19991292760], [-5501437913642, -60194047182, 2316581324, 956727854, -3406395652, -5174079032], [70478587896240, -57194610908, 280336088, 13567872452, 4303488116, -7209458212], [49422016814471, 64625961964, -7030046762, -13588063633, 8847843303, -13717970260], [-26069993679294, 19197728510, 2169385520, -6522075926, -5529638430, -2945386464], [43826169637308, 40870546361, -6055944630, -14211779088, 7223733996, 44253966196], [39620952465490, 37792431589, 47996206, -270889853, -6307983009, 16794719107], [90047143052168, 3919765063, -224871294, -3268402711, 37864541675, -8409625821], [64482186624015, 30132779132, -5831701356, 28124245811, -6016405145, 17338932640], [19576516512994, 36269815030, -2471601676, -3191586134, -8584852733, -25354622999], [135613470352960, -14303751234, 1470518758, -31757294116, 22240170376, -20386556748], [5656611414148, -61517665158, 3451021780, 4493424862, 8612512715, 11525362801], [79640626469981, 67252082404, 12014756990, -21300576163, 20306825413, -2890106476], [44847615706994, -47407340694, 3422164710, 9999400070, 22286378474, -32924766156], [65949907634460, 14803180269, 714475358, -13888503789, 25623233925, -2597193259], [81255432279665, 8347402174, -760087259, 21624469031, 29415412041, -7661670118], [57850933412916, 68522160200, 3945517288, 23306082896, -4694427523, -14320682581], [4200704371860, 43330306844, -1013546856, 23663309572, -37498174, -5016294874], [85157079258008, -48436541955, 16262425398, -37935353661, -9783242049, -23811605013], [42121991144407, 65182266104, -8375739102, -11383130297, 2223527407, 14831812396], [-25341107845250, -29433092248, 13191081040, 10327853576, -41269207167, -8059938497], [67288458088617, -68719356993, 7602583802, -26877847343, -34661288879, 5962242012], [51405154062244, 40515587910, -14385735332, -9517608806, 912297683, -15752092295], [2926687348668, -77405713899, 8983388602, -28905169776, 7918799020, -32211521484], [114467651723381, -26031450820, 1696830996, 20697244065, -42454794859, -22510125304], [-12189127977514, -73448689890, 247113042, 55276205106, -7189994754, -8944509604], [19353486754502, 60887684478, 5324239264, -36756030514, -5372507450, 44761929616], [-33977916885646, 29529423148, 3480996120, -7120870708, -1601720893, 48034422381], [-97813260485264, -15705198388, -10348497720, -1592647524, 5804724208, 37617600400], [40912916336734, 30333488365, 19587836942, 42089611067, 27534044199, -21264671285], [76772453009561, -123191788136, 25960030520, 22369290573, -30905576703, -29906562760], [11568289263259, -37320789935, -10168232042, -11854229101, 48340190483, 10292431332], [-30903210450190, 41697037194, 16766568540, 291752694, -23958222201, -20284559667], [96536875360080, -57804404398, -5538230546, -5407398372, 15935991720, 63451020564], [46487951973032, 3221988692, -10169013784, -18683083188, -8214995156, 6668299164], [-64444139699019, -140272089105, -11882199514, 26736065173, -55980819043, -32711539628], [128906539384810, -2303057664, -10541875808, 36494190768, 4817822988, 57846794788], [-116736379275336, 61531332032, 4147518467, 12289177718, -34835909672, -19713311410], [51091677429893, 102151132865, -2496740731, 13773610347, 41930885333, 54387092994], [-99229875974958, -77608499752, 12638721416, -41474553608, 5157339718, -42986935270], [-29892271586992, 16580859995, 3444232850, -5246694492, 19456815696, -5440442348], [-116233737377975, 12929001358, 10497262518, -46223331639, 12742198185, 25753669980], [150688629024128, -59555279568, -14917968104, 36817459912, -63159922671, -53376391881], [16434510136868, -32297675346, -10189080212, 33441501378, 17736444784, -40487996148], [-56448635796157, -126785132120, -1635750706, 23810150331, -26305620029, -43482900036], [22376943136070, -73866351930, 10384384468, -1922963598, -50095894946, -38025608538], [-130858753412144, -46433632733, -9125459558, -62053797555, 2938816075, 28681343179], [-40493064027216, 9777584302, -31443044982, -106443699660, 34125453400, 60747999996], [-378571281844, 188764295530, 23000322628, -21031716146, 74180744041, 19772460051], [173558062280650, -21972633127, 2652603342, -67504981857, 21980335177, 73736611393], [30036760529756, 37511753594, -12954765713, 14767727378, 43197293484, 51082358806], [-6131198460224, -1632477000, 10905592016, 24049641928, -21250146162, -6455807534], [-5257105972761, -79698665534, -16659911594, 42709252319, 51293612727, 45748228572], [-139275331389364, 57980084624, -8966445169, 55013569826, -30191321236, -55619805562], [-237079083424352, -21016572580, -14601838464, 102533274980, -49068790276, -16617953396], [-58661992003400, 50632050313, 36883573412, -77662979968, 47934281528, -67367736568], [164037308872514, -163417149551, 27721831646, 89720666247, -11437322763, -42379226235], [-61746745446292, -182209739980, 23726790456, 34526742796, 11274365044, 11589835716], [82314278294236, 218667366198, -16400152628, 55205074410, -78850534371, -49911614465], [-315467067979018, 58047918156, 2950857000, -75645879676, 18928507699, -808643499], [279490085717530, 38312127956, -22504789936, -56514669188, -30871421218, -34666030022], [-198801999891328, 355477803226, -17681886692, -132254220546, 21935879450, 53370754386], [109193101207467, -39136602336, 27708860249, -2523316575, -85153233005, -84683086798], [269666641534434, 204582656361, 28845486078, -101262776785, 33405343085, -69086479747], [144978180171222, 88693522748, -14457604656, -82366775212, 92491064026, 73401081854], [-160738312425709, -166117631050, 10852439011, 56173487869, -47296224933, -104313810570], [89549615961286, 194937131758, -17235110238, 112214998882, -16723166370, -41135654420], [-199657224644584, 204970088516, 3230561448, 102476206596, 38153631740, -26614539948], [-134036087886525, 139202925025, -19450427746, -69700924837, -23825244213, 99202131332], [103994735049438, -63283326915, -24413442738, -131976876741, 24351868711, -56423951125], [-14801525940410, 243354069608, -11495576576, 33397559832, 40288399721, 65611666951], [-270092649023163, 194517073907, 14920148194, 34022795677, -15134948259, -125588161508], [37530704352032, -208939365836, 13788216480, 191275015044, -43005114287, -79998348945], [-51416718997743, 178905562998, 18468749502, 38796268337, 54996253945, 135079943652], [170999037059510, -184470881128, -22024472896, 81951975416, -50474485, 10316753685], [-126190172758559, -113060256648, 13094975348, -102923140499, -19664189863, -11798773648], [-200822446391158, -56126400429, -25770280145, -59766217288, 49003406186, 121641566150], [-168560148681009, 329356340464, 9586650673, 7723991285, 33328804359, 83182631538], [15576419134609, 61408800816, -18405650728, 11111400901, 47299078121, -125382459976], [-192474802443486, -175789210648, 13704285716, -73890678238, -54013295894, -53147283952], [3091272765590, -136389635027, -7370489586, -21482928085, -40921534993, 95134253955], [171519192213800, -407387358223, -3497075647, -7365899646, -13808206936, -59907639366], [-268307469690592, -361440538647, 41778659886, 59201388119, -16243959479, -73767644583], [-164877394744464, -295092114289, -20437549012, 124709875256, 15494197280, -66782139000], [-164403638046500, 283413142934, 28682925524, -11206775932, 221985030380, 70628295976], [-311146397552330, 73468346732, 15592072696, 21391672084, -46564903835, -125015004461], [417984774845876, -158091275580, -33456936288, -92849939356, -122432336225, 47008936257], [-454194417814301, -150268917580, -70334779388, -9762893769, -54231887565, 100193985256], [-433811570959206, -162159502164, -39269433560, -109950474300, -83093464231, -116580470641], [223346152796358, -141603502722, -8011205812, 145678874886, 131186591350, 107009095736], [-309340706730810, -70209602588, 8576724808, 180863485924, -60873593491, -167461487101], [509697319141246, 25840649934, 37149639428, 57645484290, -93257823398, -57084925214], [65414966953352, -576278578308, 18448338964, 144091417744, 55909595560, -7655514264], [-51460052093530, -36295200839, -3060251002, 125114527023, 1467296601, 103337644161], [151852926956105, -158357240267, -337906908, -43060885883, 137221141601, -142664634512], [464080799457742, -230554975336, 23578620352, 241414110360, 49910461220, -42786004100], [191185890704763, -268864053465, -20449021504, -82261173513, 7815474195, -5661745112], [-170427744109360, 46943289647, -45797499113, 47149978454, -79805389744, -151607552682], [-68794516270405, -478985345288, 56592137982, 31521740355, 70694795, -44533463268], [-347355658126376, -345002242764, 25255790008, -119711293236, 10522055268, 72431844916], [-604953271408011, -172992058271, 40513039313, -172633730845, 27950116965, 141325481114], [34324435328846, -591571465332, -49991211672, 342154955156, -211479953396, -280873951380], [-48689677516167, 481335975936, 11512288615, -118571000477, 84890133905, -116281013554], [31438731907960, -6455963028, 74537038418, 169931967372, -196761791480, -126162598332], [-99417873721504, 433920977676, -10862808160, 66542501660, 115750266147, 224401703853], [533208202962878, 488326362568, 21515710889, 24040875104, 53736014846, 312114969546], [5042210909140, 856595996762, -9618741348, -75150614954, -20346100050, 21255675190], [-5595462149524, -230852430944, 3914087112, -149074318792, -22544689387, 106843931907], [-487566172225281, -349185844056, 14244648284, 99339771859, 106148565743, -51617094728], [-772456886996356, -61638107005, 23007923258, -228063834227, 38467275729, 48915495333], [349718119819186, -178243408046, 43318418622, 38063914118, 9564075794, -152663621012], [-285663310535646, 126952943494, -12080510516, 30652300954, 15914010524, -52854826864], [-1077937325133324, 173393858866, 35775695204, 1322487646, 198836353932, 94889591144], [-811248405815116, -479586537884, 21628516440, 144770578316, -112589069680, -131373692472], [722492130737774, 407127688930, -19547549646, -22220284358, -27375666034, 23864025940], [102100368456510, 81909620247, -44684114504, -44296341290, 93725191294, -49732841936], [319220002489804, -601978348428, 48998598768, 63819473796, -159552074083, -181679981405], [1156514972564579, -274697467594, 6793069774, 29031484155, -123785352861, 64831882172], [-547943619055816, 575676201334, -35413297644, 233174483698, 73331576814, 126660797190], [999390192619453, 73140007590, -143183311511, 308974421163, -175874582571, -114553455390], [-406312361861466, 125842161936, -54207965344, 222468936432, -30272689755, -387133156357], [-251943798724817, -353960018520, 105133864565, 99348689037, -28482649241, -294872567718], [442383671107538, 26620488987, 32073959050, -145959126659, -8680419369, -39742621017], [806013591926475, -233540320248, 84278056868, -30753563841, -51991013789, 61956885392], [102301932668224, 537625097706, -114581863884, -112357630954, 38099381187, 312022985953], [-1170713069192096, 344096011096, 46892473744, -46002502704, 3108664792, 114587895136], [-393481804773610, -34166881581, 20302075842, -79225392187, 68620464925, -176238102351], [569309689964026, -305432414410, 79031030675, -244077796736, 60480014218, -146800834786], [526003225804475, 12663441910, -30750020926, -87307759925, 75548862259, 264532345660], [-611378277727636, 113160758411, 47571105186, -41269199867, -18557122517, -140790015573], [316143249076059, 175883701364, -126600140634, -83862684365, -122385834813, -104806938316], [-997699403788904, 107450989752, -41304881506, -41353459916, -95797794896, -138745244636], [-38133528328382, -521033392692, -18115960952, 421027606548, -232805881416, -307830078944], [-428034694526368, -119371561066, -79109481252, 38797282554, 36499763948, 116575431216], [995327517180712, -550693346636, -32618276170, -173039724844, -55884800800, -184108581484], [11287536314706, -158651551827, 108636007710, -537234180314, 102571403330, -211468136004], [-790040414501848, -814279921350, -91024123532, 11525904710, -64830634312, -197671051476], [1189405154214002, 389551267286, 70749441780, -292647146182, 154454011920, 173672568396], [548494633950772, 32071661395, -91749243758, -259526585176, 322582678276, 305958905636], [908831618050400, -396638154797, -101733701430, -9946583075, -117037508439, -164327216403], [-478524317629466, -88920219221, 151533069058, 208413815661, 57489552913, -39931096979], [70688572140271, 548192205308, 82420386260, 644033439827, 8909967063, -122044921072], [326947360636279, -152721047695, -24868723375, 355165404861, -318302791977, -318158386422], [-74874462126717, -237183755636, -43945953964, 11267633207, 58425121635, -40340129944], [616832342004490, 559733295266, -82265580585, 79245349800, -302583038214, -227707464058], [1133508067653234, -175295408814, -18201029316, -51224713246, 18218296170, 223783952720], [349176472521944, -13363689322, 94504958508, 185701490546, 238320054927, -65390740155], [562544149190214, 863496807212, 127627974436, 143363407046, 153254173062, 70391586920], [-622101283384182, -496267974162, -103637565374, 311709053542, 173232585082, 227573995684], [344547808225214, -47272188872, 176995115096, 76668886198, -120332223418, -389394573352], [103788555031630, 524269407996, 69506972680, -215352321476, 204402706865, -303014513057], [1500428512807234, -637059025712, -39563952728, 380413327856, 3564200096, -289801189808], [-163056190825754, 368981237469, 131005095473, -300952729080, 58726607254, 148365295530], [-663110718114152, 431493887523, 111646937674, -141721166915, 122046883745, -194157122747], [-825257738981182, 1006356701426, 77398847676, -153179302322, -105350794826, 410495206542], [396054991831983, -103320747428, 29019616932, -89195861181, 104114715279, 323728067912], [363759410164220, 873487029076, -158477611168, 413451018300, -108473723406, -13254790698], [-874158449180959, -735882557217, -61195193918, -482066289159, 138539381881, 326186908316], [639347340128747, -911732941330, 71029197524, 544543962815, -115181310773, -293359296680], [-1080465828193430, 254547269854, -105816275276, 442919414210, -147325653757, 62058450361], [847061764980032, -164990812192, -210020154312, 64253581000, -212314025939, -157905548469], [94790507058232, -326551965364, 83924029134, -588795604844, 359497553232, 540435323748], [-287651014557863, -1105219009981, -93257732525, 687723844539, -416246819783, -64883496802], [1020220328277568, 1293014486158, 99191222524, -706514732750, 243285362793, -284926887293], [-1830130248553504, 71759621658, -148732523691, -395885810334, 156180286656, 418999586786], [1244895159135594, 122927043346, -41372323668, -327908964018, -60093962884, -99635871400], [83761446633363, -925515475442, 42592801686, -402831824357, -133466421677, -532139702900], [857362860161088, -1464910210802, -78881198101, -458518008546, -371683548208, -226196067250], [1577964010522750, 259653547454, -41148417788, -7726651678, -254235787467, 138542442727], [-111193307657228, -1286210107036, -26967353267, 483010176118, 82133202180, 72507079778], [-834925227271016, 2064752346084, -92635877360, -668984708228, 249415815122, 346873507990], [-530365326881850, -326726710410, -39086371184, -751974674290, 200311247230, 640804139384], [-1241719195954144, 404699590460, 211127997864, -998352946068, 124871661764, 556503180732], [1899392491820186, 1146728002090, 88657137900, -155741220026, -93757357938, 1116604374], [-855879508329010, 414792720592, 40951291872, 292779108872, -291404116495, -882839496825], [203898840868748, 41272177468, 68505691314, -15225376608, 40109805860, -83800744116], [-442461661170174, -699152923252, -135093108464, 155053221972, -212536983074, -21725787622], [1659883058370451, -1515905061816, -37512862448, 1165949448383, -186319060509, -427160119840], [-650489548391127, -1237226960148, -30035922000, 264245879949, -196091167671, -392067592416], [329615191339758, -641421543560, 289926895488, 424235841464, 30635747301, 123400619099], [44351068491770, 848865536626, -179070107530, 794325062286, -187514634926, -126026774316], [-794608274060258, 116102163034, 255201385228, 6845621622, -229316512022, -304165485926], [589274672584908, 1320329860539, -282073208430, 114815279765, -30297510133, 398714601275], [-1116022277539823, -1003922480040, -110098978812, 263113450909, 67384573273, -497403198816], [-327794698937984, -1186884814442, -195075451348, 131791589434, 218216070256, -578186757764], [-131009246937512, -264305254343, -182349205055, -618688334862, -115582817144, 632156340138], [-654970578110466, -1004393223503, 116568972150, -330688535977, 157441033323, 215265275855], [-1209686537639684, 460876442058, -143031721281, -193136350494, -136682848836, 387151553542], [1292021713676932, -1170285312289, -65025882566, 455796547377, -258045832651, -51609372119], [1007706593970221, -388096978496, 50161594184, 842550411457, -293592679555, -550459065568], [-3505823643804583, -765300270340, 17285926122, 400576644273, -211659442447, -539042963668], [1020333942558510, -536482152480, 324754079200, 77487527312, -326815317273, -250913547031], [123279308790432, 886626634408, -182541100024, 568483603776, 247210720237, -763011397189], [844781708211105, 776096143508, -53615852326, -772252731719, 176737974481, 959501112148], [-1798658011248988, 728817349588, 302927484096, -427349213364, 278863851334, 393812078514], [267058342912381, 377923014052, -229811972769, 26107638583, -494651692075, 21094004766], [2085921036986882, -422569928848, 8645007776, 420857852352, 800138771104, 210589429536], [-1281821706624220, -1464758288779, -135417700672, 588954433396, -301057394300, 57365330304], [-1860719075418508, 1570734875222, -148062930036, -75595877396, 174872712996, 129878482360], [202477542014690, -1029325056708, -86468566120, -1010569010940, 154691363003, 130206315933], [-973985581359638, -2868864056888, 93142009360, 260009530808, 120537893696, 62709618688], [82320560867754, 1209361038341, 139764021849, 833123773900, -308099205782, 272804636874], [-838953607888888, -174050361652, 391345526986, -234263826436, 253320991984, 52477295660], [-877425358722924, 1696209555693, -80942034754, -293230955581, -505609988711, 107235732737], [-1938445025478578, -607512682718, -42807186030, 83009417642, 134598134398, 560408968740], [-1220529389763626, -265315237234, 42815438688, -870289800722, 97887387302, -187523093392], [-1424160255283413, 511619865558, -59539711368, -234619149033, -171332587773, 470279131320], [1625727146136922, 168936518651, -294793797822, 91173087117, 93167879479, -342562417673], [-974864632421043, 883351608629, 182411969364, 456795544313, -190798885499, -1207978768208], [-1116579311181432, 1246398892216, -214699466118, -757131679076, -50151220416, 612453264636], [942615742623430, 853346267074, 300526042268, -532306452978, -221416569532, 718639279552], [548711619912153, -615805393592, -357438351852, 1113367471925, 374553415489, 305242997024], [-890116679096126, 190172044586, 151899983460, 274418479506, -110699515910, 629577651408], [-2379768179042148, 1256806484008, -125064378513, 770596958050, -558329083204, 47778240326], [-2054810144281806, 393029311028, -207108965608, 331067594764, 466008283243, 359594119133], [-3327718493907315, 1062633917995, -25886058182, 481277606853, -286965680251, -1043393646036]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_342_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_342_10_a_n();".
// 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_342_10_a_n(:prec:=6)
    chi := MakeCharacter_342_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 10));
    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_342_10_a_n();".
// 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_342_10_a_n( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_342_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,10,sign)));
    Vf := Kernel([<5,R![20360100221352000, -573950767982400, 3848466710700, 1951716384, -5570451, -384, 1]>],Snew);
    return Vf;
end function;