reserve a,b,k,m,n,s for Nat;
reserve c,c1,c2,c3 for Complex;
reserve i,j,z for Integer;
reserve p for Prime;
reserve x for object;

theorem Th37:
  card {k where k is Nat: k divides 5|^n} = n+1
  proof
    deffunc F(Nat) = 5|^$1;
A1: F(0) = 1 by NEWTON:4;
    deffunc A(Nat) = { m where m is Nat: m divides F($1) };
    defpred P[Nat] means card A($1) = $1+1;
A2: P[0]
    proof
      A(0) = {1}
      proof
        thus A(0) c= {1}
        proof
          let x be object;
          assume x in A(0);
          then consider m such that
A3:       x = m and
A4:       m divides F(0);
A5:       m mod 4 = 1 by A4,Th34;
          0 mod 4 = 0;
          then m = 1 by A1,A5,A4,NAT_D:7,NAT_1:25;
          hence thesis by A3,TARSKI:def 1;
        end;
        let x be object;
        assume x in {1};
        then x = 1 by TARSKI:def 1;
        hence thesis by A1;
      end;
      hence thesis by CARD_1:30;
    end;
A6: P[a] implies P[a+1]
    proof
      assume
A7:   P[a];
      set b = a+1;
      set K = F(b);
      reconsider An = A(a) as finite set by Lm9;
A8:   now
        assume K in An;
        then
A9:     ex m st K = m & m divides F(a);
        a < a+1 by NAT_1:16;
        hence contradiction by A9,NAT_D:7,PEPIN:66;
      end;
      A(b) = A(a) \/ {K}
      proof
        thus A(b) c= A(a) \/ {K}
        proof
          let x be object;
          assume x in A(b);
          then consider m being Nat such that
A10:      x = m and
A11:      m divides F(b);
          consider t being Element of NAT such that
A12:      m = F(t) and
A13:      t <= b by A11,PEPIN:34,59;
          per cases by A13,NAT_1:8;
          suppose t <= a;
            then F(t) divides F(a) by NEWTON:89;
            then x in A(a) by A10,A12;
            hence thesis by XBOOLE_0:def 3;
          end;
          suppose t = b;
            then x in {K} by A10,A12,TARSKI:def 1;
            hence thesis by XBOOLE_0:def 3;
          end;
        end;
        let x be object;
        assume x in A(a) \/ {K};
        then per cases by XBOOLE_0:def 3;
        suppose x in A(a);
          then consider m such that
A14:      x = m & m divides F(a);
          a <= a+1 by NAT_1:16;
          then F(a) divides F(a+1) by NEWTON:89;
          then ex m st x = m & m divides F(b) by A14,INT_2:9;
          hence thesis;
        end;
        suppose x in {K};
          then x = K by TARSKI:def 1;
          hence thesis;
        end;
      end;
      hence thesis by A7,A8,CARD_2:41;
    end;
    P[a] from NAT_1:sch 2(A2,A6);
    hence thesis;
  end;
