
// Make newform 4017.2.a.k in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_4017_a();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_4017_2_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".
// To make the character of type GrpDrchElt, type "MakeCharacter_4017_a();"
function MakeCharacter_4017_a()
    N := 4017;
    order := 1;
    char_gens := [1340, 1237, 1756];
    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_4017_a_Hecke(Kf)
    return MakeCharacter_4017_a();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_4017_2_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_4017_2_a_k( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_4017_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![-192, -5088, 51088, 193216, -1843500, 292889, 12775341, -7518530, -39018131, 28443027, 66491833, -54002694, -70247916, 62488441, 48450806, -47776686, -22223971, 25162587, 6668345, -9324468, -1193329, 2447553, 73539, -451925, 19111, 57320, -5568, -4748, 663, 231, -40, -5, 1]>,<23,R![10368761333732352, 93549017947923456, 87954810458634752, -303876142208911872, -550983433347257792, -56451749096498176, 401088486147549120, 166574291974166944, -136376835122856192, -81246343837890732, 28179462120110040, 21096129854145486, -4088717342228029, -3502476620934778, 468762289845850, 397906354422339, -45689352519263, -31703035581634, 3733086841771, 1767963428333, -238008230668, -67059019847, 11021461209, 1602648418, -348870190, -18865162, 7019224, -59303, -78221, 4413, 308, -37, 1]>],Snew);
    return Vf;
end function;