
// Make newform 539.4.a.n in Magma, downloaded from the LMFDB on 24 January 2026.
// To make the character of type GrpDrchElt, type "MakeCharacter_539_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_539_4_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_539_4_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 := [-25480, 25312, 47798, -4705, -14053, 194, 1529, -1, -67, 0, 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], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [-13, 0, 1, 0, 0, 0, 0, 0, 0, 0], [-6430424, 136144, 2901326, -346283, -346283, 40109, 16768, -1184, -283, 6], [-655592, -840872, 1123790, 329875, -250505, -32701, 15700, 1276, -289, -18], [4446232, -7538904, -5270186, 1899797, 907461, -180947, -49312, 7200, 829, -98], [-6845664, 1368176, 1949228, -1715258, -172699, 319823, 6247, -18142, -64, 313], [-612920, -1748960, -223804, 890965, 100624, -137164, -6629, 7156, 113, -117], [956088, -2887984, -1308199, 1400587, 264863, -190576, -15032, 9275, 248, -146], [-14304416, 12437688, 13591252, -5397916, -2336127, 780115, 123317, -40110, -1970, 655]];
    Rf_basisdens := [1, 1, 1, 191184, 191184, 191184, 191184, 47796, 47796, 191184];
    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_539_a();"
function MakeCharacter_539_a()
    N := 539;
    order := 1;
    char_gens := [199, 442];
    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_539_a_Hecke( : Kf := Kf)
    return MakeCharacter_539_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 := 4;
    raw_aps := [[0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-11, 0, 0, 0, 0, 0, 0, 0, 0, 0], [16, 4, 1, 1, -1, -1, -1, 1, 1, 0], [20, 1, 0, 0, -4, 2, 2, 2, 1, 0], [27, 0, 2, 1, 5, 1, -2, -2, 3, 2], [16, -5, 1, 6, 5, 5, 0, -2, 2, 1], [20, -18, -7, -1, 10, 2, 3, -1, 5, 0], [44, -2, 6, -9, -6, -9, 0, 4, -5, -4], [-89, -27, -8, -5, 5, -7, 8, 6, 0, 0], [20, -3, -5, -1, 11, -2, 0, -2, 7, -5], [8, 11, -4, -11, 12, -7, 14, -6, -12, -4], [36, 39, -4, 14, -12, 12, 8, -16, -7, 0], [-57, 5, 8, 2, -28, 29, 0, -2, 7, 8], [-29, 5, -33, 21, -3, 8, -2, -6, -5, 1], [337, 24, -6, -15, 1, -14, 1, 19, -4, -9], [-11, 0, 21, -14, -27, -33, 20, 8, -13, -21], [58, 8, -43, -10, 12, 16, 6, -8, 11, 5], [162, -56, -9, -13, -4, 9, 20, -24, 4, 9], [56, -21, 10, 9, 56, 0, -39, 15, 15, 7], [74, -43, -16, 22, 6, 32, -18, 12, 15, 20], [333, -56, -11, -4, 3, -36, 4, -20, 17, 3], [147, -39, 14, -13, 28, -11, 30, 20, -26, 8], [24, -12, 7, 0, -111, -30, -5, 11, -28, -8], [78, -9, -39, -38, -29, -53, 30, 32, -36, 7], [-117, -60, 12, 30, 94, 47, -6, -10, 2, 14], [251, 3, 21, -14, -16, 35, 18, -14, -6, -3], [613, 14, 24, -32, -15, 15, 4, 8, 28, -20], [-304, 58, 0, 55, 46, -56, -5, -41, 6, 37], [217, -67, -24, -48, 51, 16, -14, 42, 7, 18], [384, -168, 11, -26, 140, 15, -8, 28, 23, 33], [610, -109, 48, 42, 115, -27, -8, 28, -5, 28], [107, -145, 7, -49, 56, 8, -56, 26, 21, -25], [-27, -15, -3, -34, 196, -96, -15, 5, 23, 2], [240, 33, 30, 18, -99, -23, -28, 26, 3, 34], [123, 81, -73, 14, 2, -144, -36, 44, -28, -49], [-126, 7, -98, 21, 212, -44, -25, -55, 5, 17], [407, 96, 152, 14, 68, -68, 77, -33, 29, -13], [222, 205, -116, 96, -110, 27, 40, -72, -33, -6], [924, 77, 26, 43, 18, 37, -90, -28, 110, 32], [-466, -425, 4, 66, 33, -69, -20, 60, -49, -26], [974, 167, 97, 29, -71, -88, -52, -38, -7, 37], [-1203, 252, 8, 11, -306, 39, 53, -31, 32, -35], [44, -47, 33, -31, -112, 53, 58, 24, -45, -81], [-1115, -355, 46, 15, -131, 101, -116, 22, 6, -10], [1310, 500, 169, 22, -349, -63, 38, -8, -71, -109], [-508, 53, -48, -3, -55, -34, 40, 74, 36, -64], [50, -161, 180, -48, 65, -95, 24, 102, -27, -80], [-194, -416, 205, -16, -177, 109, 112, -112, -19, 13], [-41, 593, 145, -20, -59, -31, 159, 29, -49, -42], [1116, -754, 49, 85, 306, 39, -42, -18, -36, 17], [-588, -113, 98, -40, -288, -80, 78, -62, 91, -16], [-1240, 245, -39, -58, -178, -23, -50, -72, 12, 93], [1691, 175, -261, -43, -370, -107, 29, 47, 18, -68], [-800, 824, 168, -107, -286, -79, 90, -106, -27, -14], [767, -144, 195, 75, -276, 11, 141, -63, 19, -54], [1831, 593, 12, 234, -41, 165, -29, -45, 22, 115], [-668, 344, 131, -49, -303, -68, -20, 114, -168, -139], [419, 29, 206, -83, 10, -120, 200, 28, -192, -12], [1571, -449, 277, -221, 372, 100, -92, 22, 55, 13], [3477, -360, -70, 26, -314, 69, -134, -10, -96, 92], [-790, 614, 75, 127, 395, 50, -90, -28, 274, 75], [-889, 392, -156, -148, 225, -35, 88, 4, -74, 16], [196, 331, -36, 27, -524, 53, 18, 64, -30, 78], [-681, 927, 91, 18, -746, -134, 72, 56, -42, -101], [-1696, 222, 11, 92, -650, 118, -134, 112, -69, -59], [2971, -983, 56, 224, 29, 74, -284, 80, -91, 4], [979, -519, -73, 447, 198, 478, -168, -2, -25, 67], [52, 1352, -164, -211, -291, 148, 88, -36, 69, -4], [-2004, -157, 138, 130, 327, 162, -317, -11, 90, 251], [-1212, -1019, -565, -57, -76, -105, 312, -74, -303, -149], [-1536, 117, -133, 2, -491, 0, -31, -67, -245, -36], [238, -371, 8, -69, 162, -146, 0, 316, -134, -8], [-400, 75, 487, 349, -589, 62, -190, 40, -7, 95], [1313, -749, 172, -2, 413, 86, 174, -268, 37, -142], [2554, 70, -592, -20, 544, -112, -230, 174, -24, 94], [-373, 1528, -90, -53, -511, -324, -156, 232, 81, -78], [4010, -739, -123, 7, -936, 391, 140, -92, 41, 89], [2110, 349, -142, 200, 239, 17, -300, 56, 89, 192], [166, -36, -304, 114, -501, -95, -8, 152, -64, 72], [1917, -402, 111, -361, -152, -563, -147, 61, -135, 262], [1933, -82, -187, -281, 39, -247, -212, 288, -56, 255], [5913, 225, -359, 3, 6, -191, 101, 123, -236, -190], [-2607, 1219, -171, 72, 250, 149, -74, -310, 150, -79], [3199, -103, 91, 93, -438, 362, -6, -276, 23, 91], [3576, 1225, 388, 166, 382, 234, -112, 132, 213, -50], [4719, -685, -490, 207, -139, -176, 581, -101, -181, -231], [294, -1370, 200, -237, -268, 189, 220, 72, -207, -14], [1309, 676, -69, -375, -458, 224, 104, -12, 184, -17], [380, 1611, 380, 53, 156, -258, 95, 97, -153, -97], [928, -359, 266, -95, 212, -165, -44, 88, 128, 92], [2414, 941, -96, 304, -807, -473, -322, 86, 93, -86], [524, -1848, 44, 45, 920, -93, 100, -152, -119, -194], [-2987, 137, 1063, 70, -54, -124, -197, 99, -57, -258], [982, 644, -138, -568, -269, -599, 640, 96, -68, -194], [5759, 10, 255, -125, 1020, -62, -496, 308, 40, 157], [855, 110, -286, 239, -1345, -161, -24, -424, 117, -72], [-25, 1464, -180, 370, -475, -755, 11, -273, 19, -15], [1887, 180, -246, 147, 986, 308, -374, -200, -175, 176], [3449, -463, 511, -56, -122, -575, -318, 370, 72, -129], [-589, 1360, 348, -218, 70, 325, 184, 264, 224, 320], [2804, -338, -60, 48, -435, 625, -78, 296, -256, 210], [3073, 1844, -238, -315, -1083, -143, 170, -202, -69, 250], [6400, 3492, -259, 87, -686, 378, -84, 252, -112, -309], [1133, -99, 359, 225, 261, 294, -2, -506, -181, 13], [-848, 1269, -473, 223, -162, -461, 0, -20, 75, 387], [-1842, -887, -484, -357, 1944, -605, -100, 340, 76, 54], [2610, 2971, -638, 149, 5, -198, 162, -166, -336, 80], [1793, -1332, 227, -240, -372, -817, 262, -390, -85, -87], [-8822, 132, 956, -686, 312, -742, 210, 278, -116, -222], [-2022, -2085, 311, 717, -882, 950, -78, -624, 177, 51], [162, 304, 26, 476, 480, -134, -920, -164, -2, 406], [132, -64, 89, 123, 1638, 47, 284, -214, 118, -299], [-2188, -905, -395, -248, 128, 571, 514, -8, -204, 389], [-9100, 2144, 160, -575, -740, -786, 22, 318, -79, -130], [-10322, -923, -291, 70, -480, 608, -86, 424, -60, -215], [2139, 1225, -282, 216, 180, -55, 86, -432, 425, 408], [1636, 766, 756, -156, 925, 1107, -266, -132, 888, 576], [9172, 451, -312, -239, -375, -784, 200, -294, 324, -124], [-3762, -1955, 631, 156, 290, 486, -414, 264, 468, 303], [5039, -903, -161, 483, -1205, 651, -986, 50, 409, 37], [6107, -2414, 321, 607, -562, 417, 450, -438, 250, 33], [-2588, -1640, 916, -241, 350, -116, -478, 406, 339, -42], [-3193, -215, -658, -513, 1427, -772, 515, -147, -357, -745], [2039, -2411, -860, -792, 1481, -1392, 210, 80, -515, 146], [-12526, -3775, 282, -33, 601, -62, 444, -120, -264, 318], [568, 46, -898, 743, -252, -137, 456, -192, -217, -356], [-1396, 1109, 629, -408, -262, 81, -611, 407, 95, 2], [-3866, -989, -1038, -187, -1800, -163, 78, 202, -442, 110], [-2463, 452, -305, -212, 2063, 156, -174, 912, -133, 339], [-2322, 1713, 610, -247, -81, -16, 564, 152, -18, 370], [-1490, -1251, 618, -317, -675, -984, -406, 608, 220, 384], [4688, -2972, 318, -30, 995, 1059, 316, 322, 220, 106], [11684, -1431, -100, -516, 1235, -595, -508, 34, -145, 358], [-7006, -239, 470, -128, -2618, -728, -430, 320, -103, 156], [-4245, -1805, -896, -588, 1264, -715, 670, 156, 137, -352], [1170, -2496, 1226, 352, 391, -731, -378, 446, 186, -116], [-1482, 987, -564, -82, -2253, 247, 134, 4, 81, 284], [-3656, 1289, 676, 529, -1149, 966, -698, 624, -110, -162], [8607, -639, -4, -1396, -2176, -928, 753, 507, -366, -595], [-13006, 970, 688, 491, 362, 743, -80, -380, 169, -246], [-5377, 307, -48, 404, -1980, 865, -296, -162, -249, 138], [17907, -2774, 572, 1328, 873, 1470, -364, -392, 460, 356], [-11658, -5795, 430, 469, 1391, 926, -190, -514, 480, 104], [6706, -1064, -564, 508, 2062, 1090, -614, -634, 806, 918], [3612, 114, 260, -484, 1479, -405, 294, -168, -108, -342], [1265, -788, -473, 377, 730, 461, 494, -878, 136, -41], [9326, -584, -169, 767, 1821, 258, -676, -862, 1386, 377], [15166, 351, -259, 545, -562, 394, -335, -747, 168, 184], [4501, -4161, -1598, 261, -592, 315, -458, 140, 82, -144], [7704, 3006, 178, -914, -1669, -976, 380, 56, -722, 94], [-803, 798, -401, 667, 1849, -142, -1069, 689, 827, 446], [-1479, 1349, 1063, 557, -1518, 548, -398, -94, 935, 373], [6626, -2379, -6, 847, -539, 754, 136, -744, -832, -46], [-5082, -4735, -90, 374, 155, 1465, -302, -538, -83, 760], [-2362, -3272, -19, 48, -743, 22, -712, 676, 637, -457], [8852, 601, -1031, 477, -1268, -1485, 582, -610, -587, -585], [8558, -1165, 879, 47, 3292, 212, 79, -25, -454, 224], [-8178, 657, 548, 313, -1121, 696, -1064, 40, 64, -588], [5244, 3647, -263, 262, -473, 1843, -826, 362, 354, 505], [7564, -2191, 680, 251, 2030, 1289, -548, -432, 102, 278], [-12225, -1890, -1005, -1108, -2564, -1586, 498, 394, -727, -775], [-15501, -1128, 1779, 131, -372, 2054, -928, 20, 870, 653], [116, 385, 826, 89, -1026, 687, -906, -490, 110, -634], [13634, 4960, -285, 122, -132, -720, -318, 1036, -107, 79], [19607, 196, 127, -326, -758, 585, 480, -500, 353, 463], [1086, -2042, -1414, 579, -1012, 2269, 354, 468, 283, -90], [6484, -3872, 836, -1032, 1667, 839, -126, 90, -872, 138], [7124, -2384, 42, -125, -2707, 440, -124, -332, 1261, -312], [-2321, 2329, 866, -1263, -2334, -1802, 650, 456, 584, -416], [-2575, 2894, -763, 88, -1102, -1648, -517, 289, -146, -470], [-3574, -1455, 830, -232, 898, -126, -142, 318, -901, -242], [-5220, -2343, -1489, -484, 461, 115, -648, 210, -956, -269], [-3633, -3584, -818, -559, 975, -634, -72, -312, 255, -482], [9875, 2627, 2740, -1411, -676, -1840, 888, -572, -736, -1174], [-8048, -343, 1054, 1013, 576, -499, -254, -1064, 632, 348], [-728, 5120, 1268, -381, 499, -1420, 1078, -150, -223, -1200], [9006, -2483, -1570, 524, 645, 1425, 62, -732, -161, 242], [-14486, 526, 305, -630, -1261, -209, 980, -54, -1791, 433], [1766, 2225, -2494, 171, 333, -362, -602, 612, 14, 872], [11342, -628, -176, 541, 749, -400, -672, 240, -819, 240], [-5038, -1901, 1152, 953, -3807, 1224, -42, -562, -298, 1058], [-8436, 820, 729, 920, 787, -85, 536, -970, 101, -955], [5443, -5199, 294, -305, -299, 153, -114, 856, -552, 892], [-2092, 5435, -1213, -265, -359, -1647, -49, 1265, -558, 188], [4038, -3448, 800, -200, -879, 94, -368, 412, -412, -168], [15932, -2947, -439, 1831, -1996, 2209, -24, -628, -7, -131], [-9728, 5960, -1732, -686, -4144, -2213, -105, 1305, -473, 9], [-10725, -4408, 869, -1041, 1371, -1769, -128, 56, 942, 135], [2143, -3162, -1274, 466, -2105, -2746, 130, 240, -654, 66], [-5855, -4945, 527, -356, -2587, -1027, 514, 1182, -352, -373], [4469, -7637, -790, 535, -1209, 347, 42, -736, 206, -320], [20726, -5702, -548, 605, -2093, -228, 40, -856, -521, -14], [5357, 401, 976, 664, -569, 711, 970, 1080, -1123, -26], [11652, -4952, -852, 167, 3290, -195, -356, 1326, 1181, -1078], [12123, -3805, -584, -1509, 2062, -992, -262, 924, 338, 66], [7110, -645, -1815, -2089, 1466, -481, 610, 374, -3, 879], [-15433, -4327, -2841, 272, 803, -169, -341, -891, -487, 284], [-23686, -3263, -2019, -751, -602, -270, -819, 1149, -98, 88], [4748, 4969, -1194, 746, 465, -1618, -723, -957, 434, -499], [12863, 3434, 26, 61, -855, 437, -1490, 78, -197, -184], [7350, -8170, -993, -540, 2133, -933, -6, 674, -1341, -1247], [-12215, -8232, -1195, -298, 1987, -709, 204, 1188, -457, 363], [-5594, -4781, -3746, 488, 1046, 720, -1100, -322, 109, 1294], [5890, 1154, 390, 801, 4711, 1048, -1736, 960, -753, 974], [-15813, 1888, -780, -104, -2541, -986, -166, -1784, -1012, 176], [-20226, -950, -1733, -2457, 2481, -1540, 812, 450, -542, 229], [2535, 7219, -1559, -1024, -909, 709, 258, 1222, 438, -247], [-9824, 4014, 627, -1712, 1512, -2280, -648, 942, -83, -541], [-2956, 52, -1444, -303, 4333, -16, -1058, -250, -157, 1406], [9874, 3662, -2794, 2403, 883, 1122, -146, -794, 487, -724], [-16, -7039, 1234, 2441, -433, 366, -100, -924, -458, 54], [-106, 2274, 1080, 934, 646, 1911, -1185, 289, 1373, -451], [11517, -981, -342, 1961, -4397, -840, -42, -528, 1300, 956], [-7535, -5636, -2815, -810, -1094, 98, -637, 1485, -978, -850], [22634, 2255, 1475, -1802, 1482, -212, 96, 498, 162, -439], [-12094, 2738, -1908, 209, -3836, -1435, -620, 736, 799, 206], [9042, -4313, -1256, -486, 3672, 1390, 1312, -1150, -199, -296], [-8328, -1035, -2323, 2551, 5048, 732, -615, 329, 648, 100], [2782, -4573, 1838, -969, 2507, -2211, 421, -819, -1547, -131], [-4935, -1461, -2326, 224, -2594, 1016, 186, -2304, -1145, 580], [-4520, 4575, -1529, -227, 2056, 2441, -758, -712, 3023, 2237], [11846, -3263, 2292, 1240, 1343, -1243, -798, 1186, 1353, -418], [-5271, -2991, 636, 377, 2276, -3653, -133, 519, 223, 841], [-9748, 2614, 2101, 771, -1757, 1661, -396, -1016, 160, 395], [14710, 3668, 47, -1298, 3250, -1958, 1166, 1744, -3, 519], [17346, -4046, 1050, -517, 4647, 1301, -193, 905, 724, -31], [-26530, 9832, -222, -700, -3652, -1608, 2002, 394, 404, -616], [-3020, 7876, -2768, 215, -1100, 2317, -862, 566, 3111, 926], [18384, 8596, 2630, 1947, -7271, 2176, -694, -286, -205, -1378], [21075, -1257, -737, -601, 4319, 414, -1651, 3573, 1188, 362], [-316, -8745, -1464, 176, 4725, 775, 2242, -672, -1313, 104], [-40557, 5775, -889, 681, -1490, 1901, 1220, -604, -199, -227], [-9120, -3581, 398, 164, -1998, -769, 1349, -2663, -430, -661], [12695, -3539, -491, 1765, 275, 737, -1458, -516, -69, -1951], [20498, 5284, 1011, -1094, 3861, -2906, 371, 2443, -1418, -272], [4772, -2399, 1266, 625, -5824, -1606, 624, -920, -310, -50], [10896, 3838, -2651, -1503, 709, -152, 1682, 1176, 438, -523], [-11308, -9688, -294, 1275, 2059, 2060, -338, -1894, 1277, 2768], [5230, -2186, -1358, -660, -2237, -1581, -930, 1984, 942, 1022], [-27510, 1232, -540, 1272, -713, -7, -2432, 2180, 1478, 286], [8165, 4383, 738, -4397, 2167, -1471, 866, 1572, -350, -1504], [8614, -1745, 3877, 1654, -4382, 2266, 724, -582, 1428, -173], [-3247, -2628, -113, -2170, 164, -1259, 1946, 514, 249, -2071], [6616, 14152, -913, -346, -4128, 1616, -194, -180, 341, 695], [-10980, 279, 1096, -120, 1540, -5101, 620, 1396, -851, -1950], [9887, -5499, -2824, -1396, 590, 2619, 2030, -192, -9, -1120], [-4831, 2768, -3453, -1771, 1831, 1852, -799, 531, -919, 256], [3511, -9586, 3064, 1852, 3061, 493, 529, -2395, -815, -73], [-9408, 4793, -202, -256, 2044, 4624, -1932, -1392, 213, 244], [11016, 144, 2869, 29, 241, -242, -692, -2162, -754, 835], [-2023, -4809, -13, -2642, -3512, 1073, 2598, 1612, -2052, -333], [20639, 13148, -958, 51, -2592, -2431, -477, -305, -584, 133], [5432, 184, 1710, -1111, 441, -2466, 2356, -424, -2717, -1844], [-1966, -6693, -1112, -116, 5108, 4084, -566, -2268, 581, 1338], [-34418, 4583, 2060, -1810, 4297, 395, 124, 1680, -789, 880], [18847, 4220, 256, -512, 4814, -1873, -1170, -1366, -1802, 446], [8178, 13329, -123, -1509, 2393, -4704, 1190, -968, -1125, -501], [-10474, -2708, 2166, -2030, 2746, 3050, -188, -440, 1200, 2126], [-25454, 2806, -2154, 3006, -2045, 3589, 784, -1378, -566, 232], [20335, 8419, -2555, 1596, -1251, 2158, 228, -1494, -762, -621], [-7892, 11676, 687, 1816, -690, 347, -1327, -1961, 2722, 98], [-4108, -4464, -347, 2136, 7272, 675, -2484, -112, 3111, -49], [4685, 4881, -1655, -1131, 2132, 3195, -1716, 1640, 2485, 3107], [-8242, -4780, 34, 242, -1570, 898, -1910, 954, 2954, 4], [33904, -5111, -3245, -5, 3957, 275, 1358, -56, -533, -2229], [-13967, -7694, -1890, -2367, -2475, -333, 1124, 212, -305, -2136], [-36327, -1363, 67, -4203, -4471, -1491, 5334, 6, -2445, -2019], [31138, -1297, -1418, 1744, -847, 2611, -1250, -1200, 1517, 1920], [12928, 13846, -5030, -502, -6695, -1929, 478, -278, -218, -174], [1943, -12314, 414, -2344, -652, -1510, 628, -168, -852, -514], [-21694, 3236, 152, 1038, -5086, -842, 504, -2220, -934, -1116], [-11510, -1433, 249, -3674, -3591, -4377, 236, 2748, -2404, 475], [-11330, 198, -283, -1334, 5895, -3321, 2622, -1640, -2061, -2661], [-27616, -4036, -582, 632, -2927, -990, 1268, -20, -1534, -1006], [-26671, 1708, -1222, 862, 2466, 152, 273, -2741, 1223, 645], [-2972, 6048, 2863, 1291, 5916, -517, -464, -632, -1124, 1825], [6883, 12406, -1956, -539, -12515, 977, 2018, -930, -1849, -892], [8962, -4291, 630, -3071, 4341, 1111, 827, -53, 531, 2559], [-138, 5386, -3044, 1042, 2277, 2467, -3788, 2592, 210, 3438], [-6345, -4172, -741, 2961, -8580, 1873, -207, -567, -211, -886], [32635, -15671, 612, -499, -3586, 5775, 787, 1779, -905, 1257], [26440, -9503, -2798, 1390, -2438, 2142, 1302, -3836, -1299, -914], [-34798, -8899, -2032, -2413, -2478, -753, 190, -50, 222, -2412], [12745, -8784, -632, 477, -6254, -3893, 2304, -212, -1861, -972], [25822, 14664, 980, -1052, 1923, -2793, 2100, -1294, 604, 1184], [-5246, -8608, 2987, 2445, -1207, -2572, -1160, -1322, -1000, 1317], [50068, -5611, -2070, 3395, 4572, 1083, -1624, -3230, 2834, 2146], [20308, -3677, -3444, -2845, 1047, 1712, 900, 1270, -362, 1268], [10232, -1462, -2398, 583, 3365, -291, -3780, 1452, 835, 1348], [24324, -2949, 999, -416, 2500, -3990, 1328, -1022, -760, -783], [28900, -292, 3686, 643, 2954, 99, -492, -1250, 1417, 1682], [4322, -566, -571, 1697, 556, 2956, 167, -2653, 783, -1724], [47927, 958, 1768, -438, -9169, -3919, 45, 929, -1053, -973], [18126, -3353, -2595, -2423, 3592, -821, 2578, -796, -999, 1635], [16604, -19888, 936, 961, 4194, 4885, 350, -2882, 2193, 1270], [5680, 9022, 722, -867, -1406, -4831, -1284, -1078, -1175, 1078], [10895, -11522, 1708, -793, 17, -5425, 1710, 346, -2791, -3308], [24794, -19310, 4757, 4053, 6302, 3615, -1712, 472, -274, -749], [29939, -4678, 1680, 1415, -2576, -697, 1141, -1119, 882, 365], [15221, -1607, 1303, 4739, -2633, -296, 405, -2671, -914, 666], [9952, 8045, 2210, -180, 1566, 2045, -380, -1068, 321, 1100], [-40080, -10539, 5232, 304, 5183, -4054, -2214, 386, 1779, 462], [-732, -6150, -2991, 2701, -1002, 2608, -4640, 652, 2932, 4359], [42823, 2843, 151, 1569, -8230, -4771, -1732, 636, 1033, -623], [26472, 17344, 644, -1360, -3772, -4256, 2624, 1376, -3524, -2600], [29746, 5278, -2782, 68, -3260, 344, 1290, 2114, 1086, 852], [1533, -6343, -2333, -1357, 8273, -345, 3078, -3530, 341, -1627], [-16172, 2850, -2964, -1698, 9377, -2788, 1337, 1621, 2047, 185], [5835, -14867, -678, 4312, 2640, 4841, -1602, -420, 669, 1132], [10640, -4303, 834, 2113, 626, 3763, -3328, 2198, -592, 2466], [-57730, 9425, 1688, -240, 2270, -2412, -2066, 786, -1505, -2238], [-40861, 4662, -3541, -3189, 3582, -6475, -1431, 637, -587, 2570], [-34356, -377, -457, -701, -428, -167, 2050, -566, 547, 5], [64487, -9911, -1209, 63, 35, 3474, 3078, -3794, -743, -2179], [-2670, -18099, 2454, 78, 4135, 3633, 2514, -2318, -35, -104], [-28403, 6854, 7253, 2978, -8961, 1870, 2100, -2580, -967, -1025], [-54954, -408, 2793, -3957, -7477, -2998, -346, -1708, -1568, 389], [29753, -21632, -374, 4153, 5896, 1694, -1588, -2642, 513, -334], [-28712, 9435, 4407, -790, 704, -4597, -566, -1520, 1912, -501], [48405, 1361, -2652, 160, -1859, -1523, -2759, 501, -1618, -99], [16840, -5969, -1841, 2775, 4745, -2286, 3456, 1178, -1815, -2279], [2628, 15188, -1577, -2946, 530, -4458, -1480, 3834, -2939, -1429], [36340, 19604, 1539, 3, 40, -4248, 288, 132, 846, -531], [12220, 1992, 6228, 1378, -4161, 7065, 1114, -162, 50, -16], [9486, -12514, 2688, -3524, -7874, -4556, 36, 1356, 538, -408], [12974, 4615, -722, 1285, -1778, 492, 2033, 795, -3569, -801], [-14632, -5835, -4797, 2591, 11040, 706, 1339, -1609, -152, -372], [-90111, -15147, -979, -247, -4589, -3153, 1050, 918, -2775, 75], [11375, 21463, 3950, 266, -10116, -2513, -1206, -48, 1433, 1796], [-2005, -6389, -273, 1867, -1089, 2514, -5883, 625, 5172, 2042], [2875, -11051, 86, 2766, 9361, 3634, 3166, 210, 15, -1296], [-4569, -5416, -894, 1919, -2842, 1070, -1690, -1140, 2197, 596], [-23279, 9, -4067, 2381, -9688, 8237, 1152, -1320, 969, 1615], [39145, -10319, -5668, -383, -690, -550, -5794, 2708, 1330, 3434], [-16894, 12152, 1934, -790, -1561, 691, 3524, -922, -2140, -4494], [33084, -4125, 2123, 1663, 3510, 436, -3002, 24, 847, 1827], [1214, -6451, 2136, 3891, -4892, 6589, -1296, -2568, 3598, -926], [17657, 1035, 2272, 1946, 5758, 1863, 1574, -2900, 3883, 982], [691, -1599, 5933, 548, 3973, 2256, 410, -1540, 212, -3307], [-40350, -1934, 6443, -247, 6695, -5507, 1127, 1981, -2255, -1418], [-31390, -1276, -2129, 2568, 2037, 2233, -1692, -242, -3469, 1631], [-6923, 11561, -3192, 1051, -1118, 554, -204, -1646, -210, 3220], [-58955, -4436, 496, 3406, -10604, -151, 5646, -634, -1570, -3290], [-4753, 788, 1530, 957, -2135, -595, -1766, -2590, 1377, 452], [1948, -16224, -3312, -546, 2749, 3106, -3600, 1556, -1170, 1492], [88126, -1864, -4426, -1030, -856, -324, -3152, 2424, -1600, 1278], [-5141, 8173, -5244, -1045, -6192, 1512, -1272, 798, -62, -2588], [-6208, 11221, -396, 4747, -5355, 814, 1160, 182, -3826, -424], [6181, 8816, 7563, -3821, -10236, -5600, 804, 1788, -262, -1223], [14281, 8277, 3436, 688, 254, 161, -1348, 2646, 769, 1884], [-5049, -7037, 223, -1071, 13210, -927, -151, 1523, -3622, 756], [1505, 11260, -4593, -1146, 1868, -5095, 2432, -3308, 457, -1485], [-60654, 4780, 4155, -4196, 5238, 664, 836, -478, -1617, -2461], [-73838, 3242, -16, 805, -328, -7, -3216, 1524, 3671, 2834], [12126, 14924, -2942, -1250, 7766, 112, 1770, -710, -4414, 512], [11420, -3607, 789, 362, -10424, -854, 1048, 1506, -58, 27], [16448, 7571, 2562, 707, 10456, -67, 148, 2716, 1568, 900], [29843, 6202, 298, -1974, -9755, -1923, -2485, 1531, -4077, 543], [-41936, -5188, -1299, -39, 437, 9986, 562, 2256, 2598, 529], [-16098, -2349, -1594, -2888, 1664, -5690, 2072, 608, -2511, -2374], [21874, -207, 5992, -1332, -9132, -2370, 1394, 2052, 317, 2364], [-51490, -7880, 5354, -2132, 4365, -7358, 1640, -1092, 3106, -1970], [-69808, -23935, -5527, 3057, 14556, 4394, -1942, 572, 997, 1077], [-26759, 10771, -2467, -2074, -10480, -3751, 2426, -2478, -218, -3847], [-53248, -6767, -42, -2877, 1541, 618, -352, 6758, -284, 2006], [-50686, -3380, 2404, -2168, 2324, -3536, -934, -1406, 762, -1750], [61868, -1416, -2024, 1099, 5301, 115, -1876, 4368, 327, -1614], [53698, 2709, 4390, 2893, -1266, 6115, 874, 98, -118, 854], [88405, 2171, -4911, -2398, 3954, 2284, 215, -45, 579, 1372], [10265, 904, 3945, -2860, -12067, 5108, 1478, 12, 235, -1801], [-50114, -9896, 3240, -3781, -5843, -2081, 3095, 4685, -4008, -4573], [-10462, 10598, 4684, 2223, -8663, 4402, -3284, 2400, 1749, -460], [65484, 22148, 352, 4471, -206, 3664, -4502, 510, 6479, -642], [-19450, 17404, 3804, -624, -1699, 473, -880, 3690, 1352, 1238], [-1332, -16100, 1330, -228, -3738, 8320, 122, -1814, 1480, 632], [-59340, -10066, 2342, 1193, 12282, 3381, 4108, -3486, 1819, -1424], [-96424, -8546, 5316, 4318, 7154, -200, -2836, -3096, 108, 764], [3597, 15110, 480, 3372, -4029, 8362, -3682, 4962, 2434, 2002], [-90520, 20112, -1484, 4503, -6537, -1812, 404, 1944, -1929, 440], [12873, 8562, -1559, 3675, 7761, 3402, -4417, -2239, 1633, -680], [84946, 2677, 310, 3406, -3448, -3114, -2826, -186, -623, 1802], [25648, 4210, -2946, 1475, -10024, -1165, 3956, -534, -2317, -2210], [-24276, -16083, 3430, -1090, 6603, 1839, 364, -3400, -341, -1732], [43370, 2321, 1559, 3219, 5978, 6459, -2906, -8408, 2179, -43], [23861, -19492, 4130, -74, 3102, 8283, 194, -4402, -930, 3060], [-6414, -4314, -9226, 3846, 5408, 8644, -2702, -1162, -480, 3608], [-86408, 9996, -1318, 1743, 2106, -2891, 1556, -2308, -2555, -2428], [-28577, 9820, 1450, 4157, -10482, 967, -844, 2972, 697, 134], [37453, -13871, -4822, 4476, 4951, 4558, -3668, -1122, 3689, 3282], [-48867, -468, -6965, -2769, 14456, -1981, -3010, 794, -862, 3095], [-38458, 9831, 5532, -1726, -2117, -7522, -1494, 870, -6369, -4594], [15702, 12272, 5387, 5637, 4910, 839, -5258, 1448, 5340, 1257], [9574, 5773, 4740, 2320, 9066, -4204, -3914, 5046, -447, 1232], [30603, 12660, 4325, 4210, -3528, 2556, -2195, -533, 3676, 3656], [-51115, -9213, -2920, -9056, 12948, -6260, 2242, 1092, -599, -4026], [9554, 3366, 3150, 3992, 1668, -4847, 4858, -7030, 1636, -1242], [-103860, -3835, 3763, 3767, 13851, -319, -1407, -2833, -222, -994], [-4829, 3686, 5950, -1641, 3232, 1549, 5463, -2041, -1182, -159], [-34958, -11390, 5881, 205, 8713, -2539, -1028, -2420, 2450, -365], [-358, 15661, 3904, 2365, -4950, -1776, -4471, -557, 2755, -299], [-119109, -6457, -5038, 2006, 3916, 5668, 194, -1196, -359, 3384], [12422, 7409, 8961, -965, -20659, -1779, 949, 1811, 4912, 548], [48508, 4830, -556, -2229, 84, 2059, 2386, 1344, 1087, 658], [35367, -15743, 5726, -462, 9325, -526, -186, 3156, -3423, 3300], [-27828, 6463, 8162, -4285, -2300, -3625, -4760, 7182, 872, 1906], [25585, 154, -189, 859, 504, -2348, 5940, -532, -2956, -6017], [-19822, 798, -1472, 4441, 160, -2582, 8686, -3770, -1665, -102], [-2892, -11027, 343, 4182, 1654, 11450, -4466, -744, 4586, 2079], [-1195, -3083, 2249, -5958, 13679, -5004, -240, 2462, 458, 387], [13772, 5684, 930, 1089, 10166, -490, -5598, 1094, -1217, 1060], [55024, 5083, 938, -666, -7291, 6475, 5404, 1472, -3531, -1982], [-33116, -4692, -7133, -2060, -11836, -4726, 7150, 2204, -371, -3887], [17222, -8464, 4304, -6607, -2278, -43, -2450, 4770, -311, 3202], [-12834, 9597, -9596, 1718, 574, -3081, 3989, -9243, -2672, -499], [-22052, -1853, -5478, 4133, -23710, -483, 2012, -2764, -3438, -2200], [-7505, 11634, 470, 512, -2322, -3048, -4164, 8316, -2884, 334], [-216, -6368, 9654, 4725, -6723, -3319, -2831, -841, -2266, -3821], [49337, -13101, 1122, -788, 12349, 1478, -1402, -3152, 1277, -1080], [-15925, -15812, -7366, 410, 16002, 2902, -1035, -2081, 383, 1945], [-31044, -15931, 3440, -5597, 24621, 2460, 1050, 910, -2816, -462], [37469, 29616, 6808, -2324, 2545, 3904, 270, -3608, 3956, 928], [15106, 10780, -5401, -1865, 10698, -732, -5156, 1092, 3790, -1627], [-42684, 5901, -4550, -4819, -13375, 2502, 2674, -140, -3642, -1164], [30138, -16235, -3360, 918, -3389, -426, 5318, 482, -3215, -2514], [-12702, -7818, -2676, -5863, -3172, -13387, -284, 1586, -2427, 2198], [37879, 29152, 589, -4033, 9463, -4864, 6680, -1084, 1076, -4075], [81677, -2565, -4107, -9084, -1139, 2701, 3789, 6015, -2305, -5988]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_539_a_Hecke( : Kf := Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_539_4_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_539_4_a_n(:prec:=10)
    chi := MakeCharacter_539_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 4));
    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_539_4_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_539_4_a_n( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_539_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<2,R![-25480, 25312, 47798, -4705, -14053, 194, 1529, -1, -67, 0, 1]>,<3,R![315541, -1077492, 1021396, -67936, -200132, 4754, 9751, -58, -173, 0, 1]>],Snew);
    return Vf;
end function;