reserve a,b,d,n,k,i,j,x,s for Nat;

theorem Th16:
  value(<%1%>^(n-->3),10) = (10|^(n+1)-7)/3
proof
  defpred P[Nat] means 3*value(<%1%>^($1-->3),10) = (10|^($1+1)-7);
  value(<%1%>^(0-->3),10)= 1 by NUMBER11:2;
  then
A1: P[0];
A2: for n holds P[n] implies P[n+1]
  proof
    let n be Nat;
    set n1=n+1,N=<%1%>^(n-->3);
    assume
A3:   P[n];
    (Segm n1)-->3 = ((Segm n)-->3) ^ <%3%> by AFINSQ_1:87;
    then <%1%>^(n1-->3) = <%1%>^(n-->3)^ <%3%> by AFINSQ_1:27;
    then
A4:   value(<%1%>^(n1-->3),10) = value(N,10) +value(<%3%>,10)*10|^(len N)
    by Th1;
    len (n-->3) = n & len <%1%> = 1 by AFINSQ_1:34;
    then
A5:   len N = n+1 by AFINSQ_1:17;
    value(<%3%>,10) = 3 by NUMBER11:2;
    then 3*value(<%1%>^(n1-->3),10) = 3*value(N,10) + 3*(3*10|^n1) by A5,A4;
    then 3*value(<%1%>^(n1-->3),10) = (1+9)*10|^n1-7 by A3
    .= 10|^(n1+1)-7 by NEWTON:6;
    hence thesis;
  end;
A6:for n holds P[n] from NAT_1:sch 2(A1,A2);
  3*value(<%1%>^(n-->3),10) = (10|^(n+1)-7) by A6;
  hence thesis;
end;
