(*If[$VersionNumber>=2.,$Messages=OutputStream["",1],$Messages={}]*)

BeginPackage["Summatio`m`"]

Begin["`Private`"]

(*Belegen von Module durch Block f�r Versionen 1.?*)
If[$VersionNumber<2.,Module=Block]

(*!Achtung bei Erweiterungen: 
   Am Dateiende sind vielleicht Modifikationen vorzunehmen!"*)

SListe:={(Hyp`m`F[List1_List,List2_List,z_]:>
 Module[{HF,Ausgabe={}},
    Hyp`m`Private`FRun=True;
    Hyp`m`Private`IntegerTestIf=False;
    HF=(Hyp`m`F[List1,List2,z]/.Hyp`m`FOrdne);
    SFrage[Trans_,Perm1__,u,Perm2__,l]:=
      If[(HF/.Hyp`m`FPerm[Perm1,Global`u]/.Hyp`m`FPerm[Perm2,Global`l]/.Regel[Trans])=!=
             (HF/.Hyp`m`FPerm[Perm1,Global`u]/.Hyp`m`FPerm[Perm2,Global`l]),
        Ausgabe=Join[Ausgabe,{{"FPerm"[Perm1,"u"],"FPerm"[Perm2,"l"],StringJoin["S",ToString[Trans]]}}]];
    SFrage[Trans_,Perm1__,u]:=
      If[(HF/.Hyp`m`FPerm[Perm1,Global`u]/.Regel[Trans])=!=
             (HF/.Hyp`m`FPerm[Perm1,Global`u]),
        Ausgabe=Join[Ausgabe,{{"FPerm"[Perm1,"u"],StringJoin["S",ToString[Trans]]}}]];
    SFrage[Trans_,Perm1__,l]:=
      If[(HF/.Hyp`m`FPerm[Perm1,Global`l]/.Regel[Trans])=!=
             (HF/.Hyp`m`FPerm[Perm1,Global`l]),
        Ausgabe=Join[Ausgabe,{{"FPerm"[Perm1,"l"],StringJoin["S",ToString[Trans]]}}]];
    SFrage[Trans_,Perm1__,b]:=
      If[(HF/.Hyp`m`FPerm[Perm1,Global`b]/.Regel[Trans])=!=
             (HF/.Hyp`m`FPerm[Perm1,Global`b]),
        Ausgabe=Join[Ausgabe,{{"FPerm"[Perm1,"b"],StringJoin["S",ToString[Trans]]}}]];
    SFrage[Trans_]:=
               If[(HF/.Regel[Trans])=!=HF,
                Ausgabe=Join[Ausgabe,{{StringJoin["S",ToString[Trans]]}}]];
    SFrage[Global`rs01];
    SFrage[Global`rs03];
    If[MemberQ[{{1,0},{2,1},{3,2},{4,3},{5,4},{6,5},{7,6}},
                {Length[List1],Length[List2]}],
       Switch[{Length[HF[[1]]],Length[HF[[2]]]},
         {1,0},Ausgabe=Join[Ausgabe,{{"S1001"}}],

         {2,1},SFrage[2101];

               SFrage[2103];

               SFrage[2104];

               SFrage[2105];

               SFrage[2106];

               SFrage[2131];

               SFrage[2132],

         {3,2},SFrage[3201];

               SFrage[3202];

               SFrage[3204];
               SFrage[3204,1,3,2,u];
               SFrage[3204,2,3,1,u];
               SFrage[3204,2,1,3,u];
               SFrage[3204,3,1,2,u];
               SFrage[3204,3,2,1,u];
               SFrage[3204,2,1,l];
               SFrage[3204,1,3,2,u,2,1,l];
               SFrage[3204,2,3,1,u,2,1,l];
               SFrage[3204,2,1,3,u,2,1,l];
               SFrage[3204,3,1,2,u,2,1,l];
               SFrage[3204,3,2,1,u,2,1,l];

               SFrage[3261];

               SFrage[3231];

               SFrage[3232];

               SFrage[3233];

               SFrage[3234];

               SFrage[3235];

               SFrage[3291];
               SFrage[3291,1,3,2,u];
               SFrage[3291,2,1,3,u];
               SFrage[3291,2,1,l];
               SFrage[3291,1,3,2,u,2,1,l];
               SFrage[3291,2,1,3,u,2,1,l],

         {4,3},SFrage[4306];

               SFrage[4307];

               SFrage[4331];

               SFrage[4332],

         {5,4},SFrage[5431];

               SFrage[5432],

         {6,5},SFrage[6531];
               SFrage[6531,1,2,3,5,4,b];
               SFrage[6531,1,2,4,3,5,b];
               SFrage[6531,1,2,4,5,3,b];
               SFrage[6531,1,2,5,3,4,b];
               SFrage[6531,1,2,5,4,3,b];
               SFrage[6531,1,3,4,2,5,b];
               SFrage[6531,1,3,4,5,2,b];
               SFrage[6531,1,3,5,2,4,b];
               SFrage[6531,1,3,5,4,2,b];
               SFrage[6531,1,4,5,2,3,b];
               SFrage[6531,1,4,5,3,2,b];

               SFrage[6532];
               SFrage[6532,1,2,4,3,5,b];
               SFrage[6532,1,2,5,3,4,b],

         {7,6},SFrage[7631];
               SFrage[7631,1,2,3,4,6,5,b];
               SFrage[7631,1,2,3,6,5,4,b];
               SFrage[7631,1,2,6,4,5,3,b];
               SFrage[7631,1,6,3,4,5,2,b];

               If[Factor[z-1]===0&&
                  Factor[HF[[1,1]]-(HF[[1,2]])*2+2]===0&&
                Factor[Map[(1+HF[[1,1]]-#)&,Drop[HF[[1]],1]]-HF[[2]]]===Table[0,{Length[HF[[2]]]}],
                Print[""];
                Print["The series is very well-poised. In addition to the summations"];
                Print["in the following list the summation \"S7632\" might be "];
                Print["applicable. Please, check for yourself!"];
                ];

               SFrage[7691];

        ]
      ];
    Hyp`m`Private`FRun=False;
    If[Ausgabe=!={}&&Ausgabe=!=HF,
     Print[""];
     Print["Be sure to apply \"FOrdne\" before using the following information!"]];
     Hyp`m`Private`IntegerTestClear;
     Ausgabe
]),
(Hyp`m`H[List1_List,List2_List,z_]:>
 Module[{HH,Ausgabe={}},
    Hyp`m`Private`HRun=True;
    Hyp`m`Private`IntegerTestIf=False;
    HH=(Hyp`m`H[List1,List2,z]/.Hyp`m`HOrdne);
    SFrage[Trans_,Perm1__,u,Perm2__,l]:=
      If[(HH/.Hyp`m`HPerm[Perm1,Global`u]/.Hyp`m`HPerm[Perm2,Global`l]/.Regel[Trans])=!=
             (HH/.Hyp`m`HPerm[Perm1,Global`u]/.Hyp`m`HPerm[Perm2,Global`l]),
        Ausgabe=Join[Ausgabe,{{"HPerm"[Perm1,"u"],"HPerm"[Perm2,"l"],StringJoin["S",ToString[Trans]]}}]];
    SFrage[Trans_,Perm1__,u]:=
      If[(HH/.Hyp`m`HPerm[Perm1,Global`u]/.Regel[Trans])=!=
             (HH/.Hyp`m`HPerm[Perm1,Global`u]),
        Ausgabe=Join[Ausgabe,{{"HPerm"[Perm1,"u"],StringJoin["S",ToString[Trans]]}}]];
    SFrage[Trans_,Perm1__,l]:=
      If[(HH/.Hyp`m`HPerm[Perm1,Global`l]/.Regel[Trans])=!=
             (HH/.Hyp`m`HPerm[Perm1,Global`l]),
        Ausgabe=Join[Ausgabe,{{"HPerm"[Perm1,"l"],StringJoin["S",ToString[Trans]]}}]];
    SFrage[Trans_,Perm1__,b]:=
      If[(HH/.Hyp`m`HPerm[Perm1,Global`b]/.Regel[Trans])=!=
             (HH/.Hyp`m`HPerm[Perm1,Global`b]),
        Ausgabe=Join[Ausgabe,{{"HPerm"[Perm1,"b"],StringJoin["S",ToString[Trans]]}}]];
    SFrage[Trans_]:=
               If[(HH/.Regel[Trans])=!=HH,
                Ausgabe=Join[Ausgabe,{{StringJoin["S",ToString[Trans]]}}]];
    If[MemberQ[{{2,2},{3,3},{5,5}},
                {Length[List1],Length[List2]}],
       Switch[{Length[HH[[1]]],Length[HH[[2]]]},

         {2,2},SFrage[2210];

               SFrage[2240],

         {3,3},SFrage[3340],

         {5,5},SFrage[5540]
        ]
      ];
    Hyp`m`Private`HRun=False;
    If[Ausgabe=!={}&&Ausgabe=!=HH,
     Print[""];
     Print["Be sure to apply \"HOrdne\" before using the following information!"]];
     Hyp`m`Private`IntegerTestClear;
     Ausgabe
])};

simplify[x_]:=(Simplify[x]/.Hyp`m`Expandq);

Srs01:=(Hyp`m`F[List1_List,List2_List,1]:>
  Catch[
   Module[{GesList,ii,iii,Var1,Var2,MinEl,POSX,NewList1=List1,NewList2=List2,
                ProvList1,ProvList2,mList={},Ausgabe},
   Ausgabe=Hyp`m`F[List1,List2,1];
   GesList=Table[{Factor[List2[[iii]]-List1[[ii]]],ii,iii},{ii,Length[List1]},{iii,Length[List2]}];
   GesList=Apply[Join,GesList];
   If[!MemberQ[Map[#[[1]]&,GesList],1]||(List2==={})||!(Length[List1]-Length[List2]===1),
      Throw[Ausgabe],
      Var1=Position[GesList,{1,i_,j_}];
      Var1=GesList[[Hyp`m`Private`Argument[Var1[[1]]]]];
      Var1=Drop[Var1,1];
      NewList1={List1[[Var1[[1]]]]};NewList2={List2[[Var1[[2]]]]};
      ProvList1=Drop[List1,{Var1[[1]],Var1[[1]]}];ProvList2=Drop[List2,{Var1[[2]],Var1[[2]]}];
      GesList=ProvList2;
      For[ii=1,ii<=Length[GesList],ii++,
        Var2=ProvList1-GesList[[ii]];
        Var1=Map[(IntegerQ[#]&&#>=0)&,Var2];
        If[!MemberQ[Var1,True],
           Throw[Ausgabe],
           Var1=Var1/.True->1/.False->Indeterminate;
           Var2=Var2*Var1;
           Var2=Var2/.Indeterminate->Infinity;
           MinEl=Min[Var2];
           mList=Join[mList,{MinEl}];
           POSX=Hyp`m`Private`POS[Var2,MinEl];
           {ProvList1,ProvList2,NewList1,NewList2}=
              Hyp`m`Private`PoisEliminate[ProvList1,ProvList2,NewList1,NewList2,
                           ProvList1[[POSX]],GesList[[ii]]];
          ]
        ];
      Clear[ii];
      Ausgabe=
          1/Hyp`m`GAMMA[NewList2[[1]]-ProvList1[[1]]]*Hyp`m`GAMMA[1-ProvList1[[1]]]*
          Hyp`m`GAMMA[NewList2[[1]]]*
          Product[Hyp`m`p[NewList2[[ii+1]]-NewList1[[1]],mList[[ii]]],{ii,1,Length[NewList2]-1}]/
          Product[Hyp`m`p[NewList2[[ii+1]],mList[[ii]]],{ii,1,Length[NewList2]-1}];
      If[ProvList2=!={}||Re[ProvList1[[1]]+(Apply[Plus,mList]-1)]>=0,
         Throw[Hyp`m`F[List1,List2,1]],
         Throw[Ausgabe],
         Throw[Ausgabe]
        ];
   ]]]);
Srs03:=(Hyp`m`F[List1_List,List2_List,1]:>
  Catch[
   Module[{GesList,ii,iii,Var1,Var2,MinEl,POSX,NewList1={},NewList2={},
                ProvList1=List1,ProvList2=List2,mList={},Ausgabe},
   Ausgabe=Hyp`m`F[List1,List2,1];
   If[(List2==={})||!(Length[List1]-Length[List2]===1),
      Throw[Ausgabe],
      GesList=ProvList2;
      For[ii=1,ii<=Length[GesList],ii++,
        Var2=ProvList1-GesList[[ii]];
        Var1=Map[(IntegerQ[#]&&#>=0)&,Var2];
        If[!MemberQ[Var1,True],
           Throw[Ausgabe],
           Var1=Var1/.True->1/.False->Indeterminate;
           Var2=Var2*Var1;
           Var2=Var2/.Indeterminate->Infinity;
           MinEl=Min[Var2];
           mList=Join[mList,{MinEl}];
           POSX=Hyp`m`Private`POS[Var2,MinEl];
           {ProvList1,ProvList2,NewList1,NewList2}=
              Hyp`m`Private`PoisEliminate[ProvList1,ProvList2,NewList1,NewList2,
                           ProvList1[[POSX]],GesList[[ii]]];
          ]
        ];
      Clear[ii];
      Ausgabe=(-1)^Apply[Plus,mList]*Factorial[Apply[Plus,mList]]/
          Product[Hyp`m`p[NewList2[[ii]],mList[[ii]]],{ii,1,Length[NewList2]}];
      If[ProvList2=!={}||(Re[ProvList1[[1]]+(Apply[Plus,mList])]>0),
        Throw[Hyp`m`F[List1,List2,1]],
        If[Factor[ProvList1[[1]]+(Apply[Plus,mList])]===0,
           Throw[Ausgabe],Throw[0]
          ],
        Print[""];
        Print["If ",Factor[ProvList1[[1]]+(Apply[Plus,mList])]," is 0, the expression equals"];
        Print[""];Print[Ausgabe];Print[""];Print["Otherwise it is"];
        Throw[0]
        ];
   ]]]);
S1001:=
   (Hyp`m`F[{a_},{},z_]:>(1-z)^(-a));
S2101:=
  {(Hyp`m`F[{a_,b_},{c_},1]:>Hyp`m`p[c-a,-b]/
      Hyp`m`p[c,-b]/;
            Hyp`m`Private`IntegerTest[b]),
   (Hyp`m`F[{a_,b_},{c_},1]:>Hyp`m`p[c-b,-a]/
      Hyp`m`p[c,-a]/;
            Hyp`m`Private`IntegerTest[a])};
S2103:=
   (Hyp`m`F[{a_,b_},{c_},1]:>Hyp`m`GAMMA[{c,c-(a+b)},
                {c-a,c-b}]);
S2104:=
  {(Hyp`m`F[{a_,b_},{c_},-1]:>Hyp`m`GAMMA[{1+a/2,a+1-b},{a+1,a/2+1-b}]/;
           Factor[c-(a+1-b)]===0),
   (Hyp`m`F[{a_,b_},{c_},-1]:>Hyp`m`GAMMA[{1+b/2,b+1-a},{b+1,b/2+1-a}]/;
           Factor[c-(b+1-a)]===0)};
S2105:=
   {(Hyp`m`F[{a_,aa_},{b_},1]:>(2^(-2*a)*Hyp`m`p[b-1/2,-2*a])/Hyp`m`p[2*b-1,-2*a]/;
   Factor[a+1/2-aa]===0&&(Hyp`m`Private`IntegerTest[2*a])),
   (Hyp`m`F[{aa_,a_},{b_},1]:>(2^(-2*a)*Hyp`m`p[b-1/2,-2*a])/Hyp`m`p[2*b-1,-2*a]/;
   Factor[a+1/2-aa]===0&&(Hyp`m`Private`IntegerTest[2*a]))};
S2106:=
   {(Hyp`m`F[{aa_,a_},{aaaa_},z_]:>(1-z)^(-1-a)*(1+z)/;
   Factor[a/2+1-aa]===Factor[(a/2)-aaaa]===0),
   (Hyp`m`F[{a_,aa_},{aaaa_},z_]:>(1-z)^(-1-a)*(1+z)/;
   Factor[a/2+1-aa]===Factor[(a/2)-aaaa]===0)};
S2131:=
  (Hyp`m`F[{a_,c_},{b_},1/2]:>Hyp`m`GAMMA[{b/2,1/2+b/2},{a/2+b/2,b/2+1/2-a/2}]/;
            Factor[a-1+c]===0);
S2132:=
   (Hyp`m`F[{a_,b_},{c_},1/2]:>
             Hyp`m`GAMMA[{1/2,a/2+b/2+1/2},{a/2+1/2,b/2+1/2}]/;
            Factor[a+b+1-2*c]===0);
S3201:=
  {(Hyp`m`F[{a_,b_,d_},{c_,e_},1]:>
        Hyp`m`p[c-a,-d]*
        Hyp`m`p[c-b,-d]/
        (Hyp`m`p[c,-d]*
        Hyp`m`p[c-(a+b),-d])/;
          Factor[e-(a+b+d+1-c)]===0&&Hyp`m`Private`IntegerTest[d]),
   (Hyp`m`F[{a_,b_,d_},{c_,e_},1]:>
        Hyp`m`p[c-a,-b]*
        Hyp`m`p[c-d,-b]/
        (Hyp`m`p[c,-b]*
        Hyp`m`p[c-(a+d),-b])/;
          Factor[e-(a+b+d+1-c)]===0&&Hyp`m`Private`IntegerTest[b]),
   (Hyp`m`F[{a_,b_,d_},{c_,e_},1]:>
        Hyp`m`p[c-d,-a]*
        Hyp`m`p[c-b,-a]/
        (Hyp`m`p[c,-a]*
        Hyp`m`p[c-(d+b),-a])/;
          Factor[e-(a+b+d+1-c)]===0&&Hyp`m`Private`IntegerTest[a])};
S3202:=
  {(Hyp`m`F[{a_,b_,c_},{d_,e_},1]:>
        Hyp`m`p[b,-a/2]*Hyp`m`p[c,-a/2]*
        Hyp`m`p[1,-a]*Hyp`m`p[b+c,-a]/
        (Hyp`m`p[1,-a/2]*Hyp`m`p[b+c,-a/2]*
         Hyp`m`p[b,-a]*Hyp`m`p[c,-a])/;
               Factor[b+d-(1+a)]===Factor[c+e-(1+a)]===0&&
               Hyp`m`Private`IntegerTest[a/2])};
S3204:=
   (Hyp`m`F[{a_,la_,b_},{laa_,bb_},1]:>
  Hyp`m`GAMMA[{2*laa,1-a+2*laa,-a-2*b+2*laa,1-b+2*laa},
   {1+2*laa,-a+2*laa,-2*b+2*laa,1-a-b+2*laa}]/;
   Factor[la-1-laa]===Factor[b+bb-la-laa]===0);
S3231:=
  {(Hyp`m`F[{a_,b_,c_},{d_,e_},1]:>
        Hyp`m`GAMMA[{a+1-b,a+1-c,1+(a/2),1+(a/2)-(b+c)},
               {a+1,1+(a/2)-b,1+(a/2)-c,a+1-(b+c)}]/;
              Factor[b+d-(1+a)]===Factor[c+e-(1+a)]===0)};
S3232:=
   (Hyp`m`F[{a_,b_,c_},{d_,e_},1]:>
        Hyp`m`p[a+1,-c]*Hyp`m`p[1+(a/2)-b,-c]/
        (Hyp`m`p[a+1-b,-c]*Hyp`m`p[1+(a/2),-c])/;
              Factor[b+d-(1+a)]===Factor[c+e-(1+a)]===0&&
              Hyp`m`Private`IntegerTest[c]);
S3233:=
    {Hyp`m`F[{a_,b_,c_},
       {d_,e_},1]:>
      Hyp`m`GAMMA[{1/2,c+1/2,1/2+a/2+b/2,1/2-a/2-b/2+c},
                  {1/2+a/2,1/2+b/2,1/2-a/2+c,1/2-b/2+c}]/;
               Factor[a+b+1-2*d]===0&&Factor[2*c-e]===0,
     Hyp`m`F[{a_,b_,c_},
       {e_,d_},1]:>
      Hyp`m`GAMMA[{1/2,c+1/2,1/2+a/2+b/2,1/2-a/2-b/2+c},
                  {1/2+a/2,1/2+b/2,1/2-a/2+c,1/2-b/2+c}]/;
               Factor[a+b+1-2*d]===0&&Factor[2*c-e]===0,
     Hyp`m`F[{a_,c_,b_},
       {d_,e_},1]:>
      Hyp`m`GAMMA[{1/2,c+1/2,1/2+a/2+b/2,1/2-a/2-b/2+c},
                  {1/2+a/2,1/2+b/2,1/2-a/2+c,1/2-b/2+c}]/;
               Factor[a+b+1-2*d]===0&&Factor[2*c-e]===0,
     Hyp`m`F[{a_,c_,b_},
       {e_,d_},1]:>
      Hyp`m`GAMMA[{1/2,c+1/2,1/2+a/2+b/2,1/2-a/2-b/2+c},
                  {1/2+a/2,1/2+b/2,1/2-a/2+c,1/2-b/2+c}]/;
               Factor[a+b+1-2*d]===0&&Factor[2*c-e]===0,
     Hyp`m`F[{c_,a_,b_},
       {d_,e_},1]:>
      Hyp`m`GAMMA[{1/2,c+1/2,1/2+a/2+b/2,1/2-a/2-b/2+c},
                  {1/2+a/2,1/2+b/2,1/2-a/2+c,1/2-b/2+c}]/;
               Factor[a+b+1-2*d]===0&&Factor[2*c-e]===0,
     Hyp`m`F[{c_,a_,b_},
       {e_,d_},1]:>
      Hyp`m`GAMMA[{1/2,c+1/2,1/2+a/2+b/2,1/2-a/2-b/2+c},
                  {1/2+a/2,1/2+b/2,1/2-a/2+c,1/2-b/2+c}]/;
               Factor[a+b+1-2*d]===0&&Factor[2*c-e]===0};
S3234:=
   {Hyp`m`F[{a_,b_,c_},
       {d_,e_},1]:>
      Pi*2^(1-2*c)*Hyp`m`GAMMA[{d,e},{a/2+e/2,a/2+d/2,b/2+e/2,b/2+d/2}]/;
               Factor[b-1+a]===0&&
               Factor[d+e-1-2*c]===0,
    Hyp`m`F[{a_,b_,c_},
       {e_,d_},1]:>
      Pi*2^(1-2*c)*Hyp`m`GAMMA[{d,e},{a/2+e/2,a/2+d/2,b/2+e/2,b/2+d/2}]/;
               Factor[b-1+a]===0&&
               Factor[d+e-1-2*c]===0,
    Hyp`m`F[{a_,c_,b_},
       {d_,e_},1]:>
      Pi*2^(1-2*c)*Hyp`m`GAMMA[{d,e},{a/2+e/2,a/2+d/2,b/2+e/2,b/2+d/2}]/;
               Factor[b-1+a]===0&&
               Factor[d+e-1-2*c]===0,
    Hyp`m`F[{a_,c_,b_},
       {e_,d_},1]:>
      Pi*2^(1-2*c)*Hyp`m`GAMMA[{d,e},{a/2+e/2,a/2+d/2,b/2+e/2,b/2+d/2}]/;
               Factor[b-1+a]===0&&
               Factor[d+e-1-2*c]===0,
    Hyp`m`F[{c_,a_,b_},
       {d_,e_},1]:>
      Pi*2^(1-2*c)*Hyp`m`GAMMA[{d,e},{a/2+e/2,a/2+d/2,b/2+e/2,b/2+d/2}]/;
               Factor[b-1+a]===0&&
               Factor[d+e-1-2*c]===0,
    Hyp`m`F[{c_,a_,b_},
       {e_,d_},1]:>
      Pi*2^(1-2*c)*Hyp`m`GAMMA[{d,e},{a/2+e/2,a/2+d/2,b/2+e/2,b/2+d/2}]/;
               Factor[b-1+a]===0&&
               Factor[d+e-1-2*c]===0};
S3235:=
   (Hyp`m`F[{a_,b_,n_},{bb_,cc_},1]:>
   (Hyp`m`p[a-2*b,-n]*Hyp`m`p[1+a/2-b,-n]*Hyp`m`p[-b,-n])/
   (Hyp`m`p[a/2-b,-n]*Hyp`m`p[1+a-b,-n]*Hyp`m`p[-2*b,-n])/;
    Factor[1+a-b-bb]===Factor[cc-1-2*b-n]===0&&
    Hyp`m`Private`IntegerTest[n]);
S4306:=
   (Hyp`m`F[{a_,aa_,b_,n_},{aaaa_,bb_,nn_},1]:>
  Hyp`m`p[{a-2*b,-b},{1+a-b,-2*b},-n]/;
    Factor[a/2+1-aa]===Factor[(a/2)-aaaa]===Factor[b+bb-(1+a)]===
    Factor[1+2*b+n-nn]===0&&
  Hyp`m`Private`IntegerTest[n]);
S4307:=
   (Hyp`m`F[{a_,aa_,b_,c_},{aaaa_,bb_,cc_},-1]:>
  (Hyp`m`GAMMA[1+a-b]*Hyp`m`GAMMA[1+a-c])/(Hyp`m`GAMMA[1+a]*Hyp`m`GAMMA[1+a-b-c])/;
                 Factor[a/2+1-aa]===Factor[(a/2)-aaaa]===
               Factor[b+bb-(1+a)]===Factor[c+cc-(1+a)]===0);
S4331:=
   (Hyp`m`F[{a_,aa_,b_,c_},{aaaa_,bb_,cc_},1]:>
  Hyp`m`GAMMA[{1+a-b,1+a-c,1/2+a/2,1/2+a/2-b-c},
   {1+a,1+a-b-c,1/2+a/2-b,1/2+a/2-c}]/;
                 Factor[a/2+1-aa]===Factor[(a/2)-aaaa]===
               Factor[b+bb-(1+a)]===Factor[c+cc-(1+a)]===0);
S4332:=
   (Hyp`m`F[{a_,aa_,b_,n_},{aaaa_,bb_,cc_},1]:>
   (Hyp`m`p[-1+a-2*b,-n]*Hyp`m`p[-1-b,-n]*Hyp`m`p[1/2+a/2-b,-n])/
    (Hyp`m`p[-1-2*b,-n]*Hyp`m`p[-1/2+a/2-b,-n]*Hyp`m`p[1+a-b,-n])/;
    Factor[a/2+1-aa]===Factor[(a/2)-aaaa]===Factor[1+a-b-bb]===
    Factor[cc-2-2*b-n]===0&&
    Hyp`m`Private`IntegerTest[n]);
S5431:=
   (Hyp`m`F[{a_,aa_,b_,c_,d_},{aaaa_,bb_,cc_,dd_},1]:>
      Hyp`m`GAMMA[{bb,cc,dd,a+1-(b+c+d)},
             {a+1,a+1-(b+c),a+1-(b+d),a+1-(c+d)}]/;
               Factor[a/2+1-aa]===Factor[(a/2)-aaaa]===0&&
               Factor[b+bb-(1+a)]===Factor[c+cc-(1+a)]===Factor[d+dd-(1+a)]===0);
S5432:=
   (Hyp`m`F[{a_,aa_,b_,c_,d_},{aaaa_,bb_,cc_,dd_},1]:>
      Hyp`m`p[a+1,-d]*
      Hyp`m`p[a+1-(b+c),-d]/
        (Hyp`m`p[bb,-d]*Hyp`m`p[cc,-d])/;
               Factor[a/2+1-aa]===Factor[(a/2)-aaaa]===0&&
               Factor[b+bb-(1+a)]===Factor[c+cc-(1+a)]===Factor[d+dd-(1+a)]===0&&
               Hyp`m`Private`IntegerTest[d]);
S6531:=
   (Hyp`m`F[{la_,laa_,a_,b_,c_,d_},{laaaa_,aa_,bb_,cc_,dd_},-1]:>
  Hyp`m`GAMMA[{1/2,1/2+a/2+b/2,1/2+c,1/2+a/2-b/2+c,
    1/2-a/2+b/2+c},{1/2+a/2,1/2+b/2,1/2-a/2+c,
    1/2-b/2+c,1/2+a/2+b/2+c}]/;
     Factor[la/2+1-laa]===Factor[(la/2)-laaaa]===0&&
     Factor[b+bb-(1+la)]===Factor[c+cc-(1+la)]===Factor[d+dd-(1+la)]===
     Factor[a+aa-(1+la)]===Factor[la-(-1/2+a/2+b/2+c)]===
     Factor[d-(1/2+a/2+b/2-c)]===0);
S6532:=
   (Hyp`m`F[{a_,aa_,b_,c_,d_,e_},{aaaa_,bb_,cc_,dd_,ee_},-1]:>
  2^(2*b)*Hyp`m`GAMMA[{1+a-b,a+b,1+a-d,1+a/2+b/2-d/2,
     1/2+a/2+b/2+d/2,a+d},
    {a,1+a,1+a+b-d,1+a/2-b/2-d/2,1/2+a/2-b/2+d/2,
     a+b+d}]/;
     Factor[a/2+1-aa]===Factor[(a/2)-aaaa]===0&&
     Factor[b+bb-(1+a)]===Factor[c+cc-(1+a)]===Factor[d+dd-(1+a)]===
     Factor[e+ee-(1+a)]===Factor[b+c-1]===Factor[d+e-1]===0);
S7631:=
    (Hyp`m`F[{a_,aa_,b_,c_,d_,e_,f_},{aaaa_,bb_,cc_,dd_,ee_,ff_},
                1]:>
      Hyp`m`p[a+1,-f]*
      Hyp`m`p[a+1-(b+c),-f]*
      Hyp`m`p[a+1-(b+d),-f]*
      Hyp`m`p[a+1-(c+d),-f]/
      (Hyp`m`p[bb,-f]*Hyp`m`p[cc,-f]*
       Hyp`m`p[dd,-f]*
       Hyp`m`p[a+1-(b+c+d),-f])/;
               Factor[a/2+1-aa]===Factor[(a/2)-aaaa]===0&&
               Factor[b+bb-(1+a)]===Factor[c+cc-(1+a)]===Factor[d+dd-(1+a)]===
                        Factor[e+ee-(1+a)]===Factor[f+ff-(1+a)]===0&&
               Factor[2*a+1-(b+c+d+e+f)]===0&&
               Hyp`m`Private`IntegerTest[f]);
S7632:=
    (Hyp`m`F[{a_,aa_,b_,c_,d_,e_,f_},{aaaa_,bb_,cc_,dd_,ee_,ff_},
                1]:>
  Hyp`m`p[{1+a,1+2*a-4*b},{1+a-2*b,1+2*a-2*b},n]/;
               Factor[a/2+1-aa]===Factor[(a/2)-aaaa]===0&&
               Factor[b+bb-(1+a)]===Factor[c+cc-(1+a)]===Factor[d+dd-(1+a)]===
                        Factor[e+ee-(1+a)]===Factor[f+ff-(1+a)]===0&&
               Factor[b+1/2-c]===Factor[d-(a-2*b)]===Factor[e-(1+2*a-2*b-f)]===0&&
               Hyp`m`Private`IntegerTest[f]);
S3261:=
    (Hyp`m`F[{a_,b_,c_},{e_,f_},1]:>
    (-Hyp`m`GAMMA[{e-1,a+1-e,b+1-e,c+1-e,f},{1-e,a,b,c,1+f-e}]*
      Hyp`m`F[{a+1-e,b+1-e,c+1-e},{2*1-e,1+f-e},1]+
     Hyp`m`GAMMA[{a+1-e,b+1-e,c+1-e,f},{1-e,f-a,f-b,f-c}])/;
          Factor[e+f-(a+b+c+1)]===0);
S3291:=
   (Hyp`m`F[{a_,b_,c_},{d_,e_},1]:> 
  Hyp`m`GAMMA[{1/2,1/2+a/2-b,1/2+a/2+c/2,1/2-b+c/2},
   {1/2+a/2,1/2-b,1/2+c/2,1/2+a/2-b+c/2}]-
   Hyp`m`F[{1-b,1+a-2*b,1-2*b+c},{3/2+a/2-2*b+c/2,2-2*b},1]*
    Hyp`m`GAMMA[{1/2+a/2-b,1+a/2-b,-1/2+b,1/2+a/2+c/2,
      1/2-b+c/2,1-b+c/2},
     {1/2+a/2,a/2,1/2-b,c/2,1/2+c/2,3/2+a/2-2*b+c/2}]/;
   Factor[d-(1/2+a/2+c/2)]===Factor[e-2*b]===0);
S7691:=
   (Hyp`m`F[{a_,aa_,b_,c_,d_,e_,f_},
       {aaaa_,bb_,cc_,dd_,ee_,ff_},1]:>
    -Hyp`m`GAMMA[{bb-1,cc,dd,ee,ff,b+c-a,b+d-a,b+e-a,b+f-a,2*b+1-a},
          {a+1,c,d,e,f,b-a,b+1-c,b+1-d,b+1-e,b+1-f}]*
      Hyp`m`F[{2*b-a,1+b+(-a/2),b,b+c-a,b+d-a,b+e-a,b+f-a},
         {b+(-a/2),b+1-a,b+1-c,b+1-d,b+1-e,b+1-f},
                1]+
    Hyp`m`GAMMA[{cc,dd,ee,ff,b+c-a,b+d-a,b+e-a,b+f-a},
           {a+1,b-a,a+1-(c+d),a+1-(c+e),
        a+1-(c+f),a+1-(d+e),a+1-(d+f),a+1-(e+f)}]/;
               Factor[a/2+1-aa]===Factor[(a/2)-aaaa]===0&&
               Factor[b+bb-(1+a)]===Factor[c+cc-(1+a)]===Factor[d+dd-(1+a)]===
                        Factor[e+ee-(1+a)]===Factor[f+ff-(1+a)]===0&&
               Factor[2*a+1-(b+c+d+e+f)]===0);


S2210:=
{Hyp`m`H[{b_, c_}, {bb_, cc_}, -1]:> 
  Hyp`m`GAMMA[{3/2-b/2-bb/2, 1/2+b/2+bb/2, 1-b, bb, 1-c, b+bb-c}, 
   {2-b-bb, b+bb, 1/2-b/2+bb/2, 1/2+b/2+bb/2-c, bb-c}]/;
    Factor[bb+b-cc-c]===0};

S2240:=
{Hyp`m`H[{a_, b_}, {c_, d_}, 1]:> 
  Hyp`m`GAMMA[{c,d,1-a,1-b,c+d-a-b-1},{c-a,d-a,c-b,d-b}]};

S3340:=
{Hyp`m`H[{b_, c_, d_}, {bb_, cc_, dd_}, 1]:>
  Hyp`m`GAMMA[{3/2 - b/2 - bb/2, 1/2 + b/2 + bb/2, 1 - b, bb, 1 - c, b + bb - c, 
    1 - d, b + bb - d, -1/2 + b/2 + (3*bb)/2 - c - d}, 
   {1, 2 - b - bb, b + bb, 1/2 - b/2 + bb/2, 1/2 + b/2 + bb/2 - c, bb - c, 
    1/2 + b/2 + bb/2 - d, bb - d, b + bb - c - d}]/;
    Factor[b+bb-c-cc]===Factor[c+cc-d-dd]===0};

S5540:=
{Hyp`m`H[{a_, b_, c_, d_, e_}, {aa_, bb_, cc_, dd_, ee_}, 
   1]:>  Hyp`m`GAMMA[{1 - b, 1 + 2*aa - b, 1 - c, 1 + 2*aa - c, 1 - d, 1 + 2*aa - d, 1 - e, 
    1 + 2*aa - e, 1 + 2*2*aa - b - c - d - e}, 
   {1, 1 - 2*aa, 1 + 2*aa, 1 + 2*aa - b - c, 1 + 2*aa - b - d, 1 + 2*aa - c - d, 
    1 + 2*aa - b - e, 1 + 2*aa - c - e, 1 + 2*aa - d - e}]/;
    Factor[a-aa-1]===Factor[a+aa-b-bb]===Factor[b+bb-c-cc]===
    Factor[c+cc-d-dd]===Factor[d+dd-e-ee]===0};

Regel[Global`rs01]=Summatio`m`Srs01;
Regel[Global`rs03]=Summatio`m`Srs03;
Regel[1001]=Summatio`m`S1001;
Regel[2101]=Summatio`m`S2101;
Regel[2103]=Summatio`m`S2103;
Regel[2104]=Summatio`m`S2104;
Regel[2105]=Summatio`m`S2105;
Regel[2106]=Summatio`m`S2106;
Regel[2131]=Summatio`m`S2131;
Regel[2132]=Summatio`m`S2132;
Regel[3201]=Summatio`m`S3201;
Regel[3202]=Summatio`m`S3202;
Regel[3204]=Summatio`m`S3204;
Regel[3231]=Summatio`m`S3231;
Regel[3232]=Summatio`m`S3232;
Regel[3233]=Summatio`m`S3233;
Regel[3234]=Summatio`m`S3234;
Regel[3235]=Summatio`m`S3235;
Regel[3261]=Summatio`m`S3261;
Regel[3291]=Summatio`m`S3291;
Regel[4306]=Summatio`m`S4306;
Regel[4307]=Summatio`m`S4307;
Regel[4331]=Summatio`m`S4331;
Regel[4332]=Summatio`m`S4332;
Regel[5431]=Summatio`m`S5431;
Regel[5432]=Summatio`m`S5432;
Regel[6531]=Summatio`m`S6531;
Regel[6532]=Summatio`m`S6532;
Regel[7631]=Summatio`m`S7631;
Regel[7632]=Summatio`m`S7632;
Regel[7691]=Summatio`m`S7691;
Regel[2210]=Summatio`m`S2210;
Regel[2240]=Summatio`m`S2240;
Regel[3340]=Summatio`m`S3340;
Regel[5540]=Summatio`m`S5540;


End[]

Protect[
Srs01,
Srs03,
S1001,
S2101,
S2103,
S2104,
S2105,
S2106,
S2131,
S2132,
S3201,
S3202,
S3204,
S3231,
S3232,
S3233,
S3234,
S3234,
S3261,
S3291,
S4306,
S4307,
S4331,
S4332,
S5431,
S5432,
S6531,
S6532,
S7631,
S7632,
S7691,
S2210,
S2240,
S3340,
S5540,
SListe,
SumListe
]

EndPackage[]

If[$VersionNumber>=2.,$Messages=OutputStream["stdout",1],$Messages={"stdout"}];
If[$VersionNumber>=5.,$Messages={OutputStream["stdout",1]},Null];


