
// Make newform 304.6.a.k in Magma, downloaded from the LMFDB on 18 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_304_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_304_6_a_k();".
// 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_304_6_a_k();".
// 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 := [3103, -84, -140, 0, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0], [0, 4, 0, 0], [287, -79, -5, 1], [-71, -2, 1, 0]];
    Rf_basisdens := [1, 1, 12, 2];
    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_304_a();"
function MakeCharacter_304_a()
    N := 304;
    order := 1;
    char_gens := [191, 229, 97];
    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_304_a_Hecke(Kf)
    return MakeCharacter_304_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 := [[0, 0, 0, 0], [-3, 0, 0, -1], [-26, 1, 2, 3], [-10, 1, -3, -5], [-176, 3, 10, 1], [202, -14, 15, 10], [75, -36, 48, 30], [361, 0, 0, 0], [-1450, -4, -95, 42], [1382, -67, 19, 144], [174, 5, -150, -82], [-5004, 133, 330, 358], [-2580, 13, -320, -58], [3146, 81, -378, 15], [1424, 299, -32, 435], [-19254, 53, 251, -266], [-5779, 661, 420, 391], [-8072, -611, -570, 97], [-1667, -1426, 660, -823], [-30112, -376, 130, 426], [-26095, -1382, 96, 160], [-29016, -17, -1326, 532], [-23412, -1344, -834, -408], [-742, -953, 1494, -4478], [3510, -908, 1104, -4466], [-14766, 1694, 2312, 2404], [-30914, 1358, -1536, 1280], [-50633, 819, -3704, -3083], [-13422, -1467, -999, 642], [120298, 4123, -5656, 2448], [152156, 2101, -1902, 6862], [-45750, 2277, 3606, 261], [109451, 3386, -3236, 4014], [163210, -2923, -4542, -1909], [-33088, -8783, 7056, -6173], [149482, 1896, -1044, -11220], [-167656, 6554, -9294, -4726], [-93230, -6408, 11394, -14778], [-66980, 5549, -4932, 2426], [36536, 172, -8514, -2870], [-131804, -11053, 6792, 8066], [-16676, 2148, -5850, 6666], [-58762, 507, -6823, -32545], [317016, -5097, 26226, 19728], [253576, 1282, -7024, -15906], [-106430, -8745, 3717, 6027], [383029, 8321, -21480, -13189], [-52018, -12061, -11688, -9316], [-48711, 5879, -27520, -23591], [-272140, 9909, -24570, -25041], [282630, -753, 35556, 29967], [-565258, 22915, 3249, 5131], [-60416, -16143, -7596, 25566], [-96334, -33421, 7396, 10785], [-286978, 9648, -11626, 2630], [-221916, 1581, -29796, -59445], [616856, 16411, 8238, 11860], [220230, -15178, 47505, 10610], [-826802, 6753, -11214, -8919], [186732, 39358, 6964, -28930], [623544, 6729, 8082, 1161], [34602, 18948, -55899, -37662], [-613452, 14499, -22140, 52236], [234362, -3075, 33869, -31063], [557881, -42743, 28140, 59959], [-995690, 12332, -17139, 33860], [-1060557, -31304, 68424, 35071], [1185754, 28338, 63810, -1062], [-464106, 64535, 6260, 13933], [-454232, 67983, 24606, 10983], [1683417, -6807, 4464, -44637], [-514902, 14757, -19545, -116193], [1917620, -41532, -13968, -109308], [1829178, 25124, 65649, 48506], [-2096363, 28103, 16644, 36947], [-3410866, -1269, 14360, 73742], [75830, 114079, -65220, -49673], [-2492566, -18927, -84510, -19839], [-1477912, -11041, -27380, -30744], [-939358, 96701, -26070, 98546], [1819670, 12136, 34950, 60058], [1174846, -39563, 124251, 134446], [101836, 36026, 86010, 7844], [1683928, 79915, -26634, -124262], [-1883212, -66571, 164964, -11206], [618320, -64563, 114014, -35329], [2124988, -18354, 108898, 105532], [-3485643, -66562, -97476, 101930], [-6329920, 4395, 11012, 8543], [-57704, 74083, 114468, 255823], [1868826, -74293, 69848, 46105], [-1786948, -75240, 55016, -64912], [-839786, 53506, 15468, 78628], [-3487988, -125526, 48760, 46840], [-2812398, 71153, -62070, -101047], [2105030, 133018, -235743, 36550], [-1474512, -66114, -53106, 9840], [-822912, 125213, 14816, 74020], [2767079, 45461, -173292, 81365], [6334082, 42627, 77832, -106557], [-792816, -496, 446988, 214364], [-6653198, -110763, -41354, -129779], [-1312648, 247237, -156048, -170474], [6383420, -23680, 223396, 385620], [1299008, -44740, 138756, -207340], [3939139, -117098, -270624, -217448], [3505892, -91949, 148800, 293659], [-5217222, -20906, 122368, 82748], [1613832, -76125, 199668, 263496], [6089734, -321852, -92250, -272364], [149956, -99924, 408150, 303132], [254146, -316101, 32112, 90813], [-5726966, 120491, -242712, -141955], [3689022, -122404, -251952, -394894], [-5739020, -135177, 242100, -287055], [-897268, 82654, -431742, -60356], [1449714, -299449, 16176, 148859], [10936842, 37867, -23699, -272125], [625182, 31731, 271002, 136317], [-570201, 180103, -44060, 488897], [396894, -179198, 67713, -271838], [-88504, 137118, -30276, 263706], [-7290350, 144111, 98413, 100252], [-1826520, -246466, -81436, -244196], [11652130, -28747, 248484, 227837], [-5584664, 736, 343004, 451218], [7726300, 264470, -52206, 121634], [-8459818, 377469, -274987, -22933], [2612990, 391347, -169263, -11691], [2080354, -23494, -60522, 330440], [-6010848, 350623, 95496, 882553], [-12438710, -259443, 135886, 37870], [-3469048, -421330, 336, -455632], [-2441900, 217203, 431982, -19299], [-3444653, -48490, 100392, 348482], [2207913, -395270, 151116, -113486], [12316046, 82048, -505023, 148744], [1193689, 98689, -17400, 872449], [2594162, 265897, -319089, 648454], [-11006347, 138280, 129756, -244274], [-8141929, -98813, -507756, -964973], [-1646134, -631247, 430542, -404423], [2704494, -35879, 71511, -905837], [-10087367, 16092, -529796, -33299], [-5103442, -429452, -52383, 547642], [-12084558, -460598, 702454, -66712], [13694546, -132518, -534432, -321632], [-18005820, -304956, -79800, 43938], [8620848, 580853, -608370, 628901], [-18137192, 103655, -354678, -396622], [-8970774, -459656, 602745, 253108], [9698922, 683475, -201972, 316329], [-4355854, -293343, 950148, 748431], [-13254868, 125514, 173282, 13874], [27703255, -547932, 37728, -142737], [2910598, 854540, -1036374, -638548], [-11302618, 846014, 115815, 342950], [-66551, 476725, -1034272, -135249], [5097513, 252962, 849288, 539408], [6452974, -623958, 165859, -1438604], [-11022382, 160678, 344766, 433990], [-11513888, -450455, -699574, 378780], [-3085896, 799092, 768312, 392904], [-22033428, 503056, -1080368, -1692160], [-5763438, -83635, 526910, 976486], [22951980, 1004808, -140802, -554424], [2460726, -193807, 1456842, -122356], [-12986386, 423053, -121038, -966187], [26412362, 923471, -1048434, 569114], [20920958, 138403, 1194906, -292211], [5825623, 15116, 1326804, 1672553], [-10847586, -74107, 1568703, 1031582], [-20610224, -374548, -1373136, -812848], [14622707, -240495, 818172, -131955], [1774684, -218272, -409092, -468160], [-15959238, 357693, 546012, -318141], [-4801870, 831356, 48630, 395294], [-15183798, -91089, -1223700, -207135], [19151338, 681298, -17706, 224962], [-13214816, 328075, -641352, -354935], [-33925734, 916307, 252615, 1598177], [-23904981, -188515, -565540, 329191], [49397984, -260278, 303906, -1059934], [-17501014, 302666, -1016402, -2143356], [-14992306, -703619, -383799, -542093], [-18349786, -1204835, 1995756, 5101], [29097598, -375812, 745521, -105356], [12890384, 616890, 1800216, 572478], [10598634, 637613, -965976, -1465060], [15558138, 330294, 342093, -2106750], [6840476, -12685, 508854, -1099342], [5112784, -360039, -358460, -528515], [36925196, 234033, -106344, -99048], [-40331078, 932219, -1176807, -318964], [29783050, 276334, -1509934, -368886], [-22204694, 34064, -1422798, -418594], [-29201723, -39236, 571956, 50560], [11031104, -593996, -1063380, -1634450], [7926755, -337917, 2588552, 1855409], [38210262, -507843, 1871763, 2003301], [-31088264, -455824, -629010, -86548], [-8277122, -551195, 1809942, 2168860], [-31400554, -505513, 1098255, 902942], [-76714360, -572697, 702648, -672690], [-18862088, 120426, -1011830, -858644], [5485836, 765749, -2440828, 561223], [1607374, -452103, -2601027, -2167287], [34234445, -1633757, 672876, -79943], [-27557947, 787756, 1543848, 1515748], [-36149491, -545671, 644952, -1326541], [51204741, 398987, -456216, 2283215], [-58561126, -907434, -607114, -388792], [24626312, -101135, -843636, -2848871], [-40869389, 724289, -196128, 2586539], [-7215050, -1114807, 2916306, -142564], [2696260, 770747, 565986, 3390674], [-25477786, 151342, -1088931, 1833586], [13144940, 470428, -720774, 665104], [-30234660, -2582365, 2731322, -721244], [-11381946, 685113, -1715508, -1015545], [-509728, -761408, -454170, -1549358], [29109718, -2029335, 1321452, 901140], [37395758, 444069, -2107360, -521008], [-50595974, -1964247, -192843, 418197], [-27042325, 1425641, -343856, 2698665], [-90050130, 317541, -1418832, -772833], [-14396934, 235694, 1208864, 125560], [-3889754, -2077441, -545076, -675622], [18834876, -2042390, -1786854, -3240074], [11133854, 219625, -191268, -2979977], [-22862200, -88985, -3313866, -2273243], [53718449, 1097006, 1331976, 1071725], [-185484, 363483, -3136320, -4526772], [6212114, -734974, -1649168, -1285512], [26521318, -892617, -322956, 1192665], [-68572430, -106039, -133149, -906349], [-9353610, 2877903, -516024, 831057], [-24070880, 1173013, 1757480, 1034109], [-6666252, 1797640, 1102894, 3122996], [35553336, 156921, 1241112, 1359624], [25364256, -212500, 3951260, 394438], [-53902410, -1250779, -466764, -2058271], [41016794, 2260452, -1151181, -294354], [18744734, -1909260, 83835, -2923692], [56396724, -430227, -681564, -4103322], [63721272, -1899795, 1329588, 1672539], [-86853644, -21551, -861420, -1102625], [-43413836, -2221275, 344524, -669704], [-64175660, 687636, -1259064, 4174740], [95169046, 692921, 861213, -1363915], [-7940458, 89612, -1540104, -6101932], [22534535, 972546, -699556, 2170964], [-110108158, -743110, 1466113, 1174962], [-28990256, 12049, -3128646, -2929604], [-11323636, 2099067, -1718896, -4256803], [-24160408, -1059570, -2631358, 3250412], [31839464, -3555479, 208770, -1057517], [51737456, 1827881, -1436424, -2574310], [48611712, -3673839, 1601298, 528054], [-26751470, 2119170, 549036, -1796976], [61418762, -634395, 4920678, 7308492], [1848236, -462752, -3186936, -2504318], [79601120, 447205, -3458712, -2839259], [57715042, 3322796, -2724261, 2073908], [52164718, 2232491, 1784916, -653509], [119547621, -796504, 3267552, 3065813], [84475886, -2204339, 1775685, 691210], [44182879, 537074, 4824300, 2050112], [17657755, 784929, 1048104, -4769163], [37596886, -414637, 1552884, -2221045], [74555454, 1002681, 1199583, 5436774], [27678147, 4269980, -2116752, 58469], [-74736111, 4348014, 1096560, 5639088], [16160314, 1919115, -5330097, -974577], [22284710, -425931, -832284, -5096886], [18844270, 1035368, -6472005, -1232638], [79805396, -2123183, 4895562, 5872141], [-49396118, -631545, -440325, -1349778], [31335074, -377422, 2503866, 6738452], [165868846, 378215, 2736282, 2812955], [37729928, 1340386, 5737062, 6044806], [77853422, -4514250, 5054949, 4835982], [5547118, 5333579, -1722015, 1918985], [-41584530, 5537214, -823905, 5073756], [-33299582, -1922921, -3027918, -4158425], [-43252776, -2001291, 1318656, 4830429], [42207029, 1804666, -1087140, -5232938], [20376136, 402494, -9736206, -2534932], [95981962, -2729195, 535407, -3117977], [130005900, -3171712, -115678, 1537516], [-36527212, 3301360, -1268874, -4683866], [51431756, -2691611, 3240504, 118405], [48189388, 2450588, 865806, 3665708], [-113761004, -326058, 927640, -6213302], [30991224, 1138988, 771978, -3679762], [114009426, 801056, -1968502, 1762792], [29528616, 3343228, 1616658, 6786280], [-42452100, 60785, 6430106, 3080389], [-147208905, -2755594, 1790480, 3203263], [74825150, -2267639, 1327884, -61883], [-2743074, -746807, 9762000, 4267105], [-59211394, -5737656, 5154773, -4161124], [-213215154, 2390693, 824781, 3331763], [8882817, 2963572, -7903592, -3426007], [-147990020, 2330759, -2070528, -4171333], [17307890, -2009469, 3729384, 8290842], [-133018075, 1450465, -395460, -359051], [-66156158, -4762925, 7213317, -4087532], [17938456, 681281, -4866720, -4054819], [32011238, 2514600, -6015762, -5062716], [-107473612, 2427759, 965108, -782095], [46989176, -2756834, 592110, 6382198], [96294878, 1729892, -130364, 5464830], [-15815356, -5830997, 3365268, 631978], [28589912, -1639838, 3735576, 5553736], [-2662372, 1699843, 10044312, 3877576], [6795290, 1412173, -4364688, -3147407], [1950926, -1223991, -6920332, -9329662], [-138427393, 989526, 3009060, -282912], [-128545094, 3381039, -1181204, 6444073], [8111455, 9379954, -5252664, -3087911], [-165886113, -985194, -3822984, -2325618], [-340598, 1901378, -3943605, -2192308], [-106345390, -1203457, -2116140, -2825794], [29732483, 970597, 2243940, 2962465], [-82800530, 2667923, -2067792, 6166094], [-117400379, 3740803, 3695820, 9224701], [68264855, -876234, -5360436, -126003], [223543020, 798329, 5349608, -142130], [-135027548, 2378839, -3321904, 1272723], [-151455374, -173397, -6429042, -181629], [-105255114, 2169528, -3438963, -4419984], [17550194, 161282, 2876601, -659890], [115258150, 3196393, 1522520, 1347615], [-21495500, -5711275, -3544962, 2696981], [52930954, -4200831, 9340222, -64127], [-167692430, 1993913, 7786317, 3518750], [104529074, -4272509, 5079066, -4368884], [-12159893, 2591926, 186252, 10369192], [59451626, -647850, -3402369, 8495598], [-51232854, -6540677, 4414821, -1103150], [-7244641, -974648, -677520, 4015642], [112747186, -429805, 2181399, 4224692], [181449516, -1427351, -5034594, -3853352], [-116959246, -4767108, 1611191, -8334520], [77334996, 402314, -1289032, -1755932], [45198680, -1787108, -2235126, 11420158], [162669231, 2473926, -2566584, -242067], [41419490, -8750806, 4280596, 8027058], [24280508, 6099853, -5620644, -6398093], [-193293876, 3553073, -5948880, -8878090], [-145811488, -5837664, 6325218, -6067476], [-275736340, -441153, 6640844, -1223935], [-97642230, 9084, 958734, 7397820], [3324932, 1821999, 10438866, 9658704], [9826116, 3163702, -14304764, -12627964], [-156987698, -3377304, 5759629, -10858670], [-136372038, 7706166, 806382, 4009974], [-50548361, 2078934, -1441544, -9013082], [37848470, 8164501, 2886072, -5517836], [-178686684, 4464517, 6671148, 5690323], [-93565882, -2115396, -11879104, -16481428], [221903338, 4887791, -12414348, -3332032], [30350501, -11374126, 4634776, 4845069], [26536290, 3215437, -1560000, -2223731], [187470292, 3027007, -12735444, -4793282], [-37741132, -7204094, 4985130, -11329646], [-33779952, 6471450, -593838, 2029662], [-128251944, 2267749, -3271350, -10091372], [-291847384, -4814516, 8970858, -2986820], [-48988313, 2390792, -2959728, -4440547], [180006774, -7262225, 5608309, 7328753], [-227986674, 160207, -7306589, -9856180], [-74078048, 2061525, -714996, 8905965], [-147010048, -1125087, -6344280, 1906047], [223833551, -197521, 7544644, 8974095], [-49374284, -212706, -1028756, -13364084], [222437246, -3168135, 7111584, 4436655], [20186969, -4195658, 10291812, -102914], [-262724720, -3671938, -5315676, 7273520], [103906760, 4459534, -7845150, -14057954], [-19168886, -171959, 2027072, 2423355], [-251751782, -5603045, 10782627, -4846727], [-254147982, 2440533, -5789532, 13991211], [82396469, 10347736, 2549868, 1247179], [292763134, -1197762, -57512, 10633558], [212649214, 2547358, -1256601, -854366], [251434122, 3344536, -14586078, 524680], [127854332, 2239797, 8317962, 3791775], [-89209496, -8409347, 5343380, 8301774], [81061120, 5678236, -14359602, -8615498], [-145896790, 3139158, -5836783, 6804956], [-88145042, 11543786, 430956, 19065206], [-233539846, -1900851, 10851372, -2467611], [-58042648, 5907820, -4708164, 4246270], [66696480, -13170328, -2313258, 2483294], [-40751102, 8868625, -10631460, 3110674], [-137521482, -871993, 15665558, 7418500], [30645192, 2400455, 3758232, -13493134], [26076052, -10108120, 9247764, -13054462], [109539836, 8164461, -6809274, 21998292], [-51020142, -11211839, 7365880, 12669503], [440441488, -1008340, 3417978, -688], [29074436, 637934, -15010124, -2322774], [-21706428, 2313603, 2406318, -8926296], [-70720198, -1061191, -8733363, -4309903], [-340300782, -8951651, 3438636, -6426779], [375922168, 1526977, -11441584, 2022186], [-359739469, 3934686, -14772816, -8900451], [-300010986, -1147223, -10894694, 6066005], [209438062, -951489, 5621238, 9344394], [-87069800, -7407955, -10955706, -2820403], [34786681, -4746293, 7875836, -19629069], [-253792774, -5489023, 1642260, -15829327], [-196682015, 9911895, 10504332, 16531803], [108405462, 11431482, -8596746, -10407360], [-225143486, -6582316, -3402924, 6505442], [38472866, 4669169, 4675710, 15300650], [-58390057, 12385933, 7498476, 8646889], [-174504544, 8837838, 8121320, 1273790], [-133115932, 1565725, -6631302, -6708008], [274581682, 10666387, 5497521, 3892672], [-383748478, 13529201, 5485363, 23030565], [-413950077, -1444630, 3405860, -7274759], [-352970958, 1679602, 3299928, 9222238], [264865786, 546212, -4698543, 2267774], [469585165, -8162976, -8129372, -17197529], [147682927, 1585260, 4769716, 7578436], [-426010856, -9261075, 3874104, 2384697], [31184386, -4356417, -13406627, -2681735]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_304_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_304_6_a_k();".
// 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_304_6_a_k(:prec:=4)
    chi := MakeCharacter_304_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_304_6_a_k();".
// 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_304_6_a_k( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_304_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,6,sign)));
    Vf := Kernel([<3,R![123588, -5988, -875, 10, 1]>],Snew);
    return Vf;
end function;