Sponsored links: Algebra eBooks
 

Related

substring

substring("2015-10-ВЕ...

substring(%,4,6);

Calculate

substring

substring("abbab",1);

Calculate

substring

substring("substring"...

substring(%,4,6);

substring("CCB2MDM2JM...

Calculate

substring

substring("0010218719...

substring(%,4,6);

Calculate

substring

substring("28/09/1995...

substring(%,4,6);

Calculate

substring

substring("cat",1);

substring(%,4,6);

Calculate

substring

substring("ABC.DAT",1...

Calculate

substring

substring("2015-10-01...

substring(%,4,6);

Calculate

substring

substring("28/09/1995...

substring(%,4,6);

Calculate

substring

substring("BABC",1);

substring(%,4,6);

Calculate

substring

Run Example
(%i1)substring("substring",4);
(%o1)                               string
(%i2) babc;
(%o2)                                babc
(%i3) 
Run Example
substring("substring",4);
(%o1)                               string
(%i2) 
Run Example
SEMICOL:ascii(59);
(%o1)                                  ;
(%i2) MAXEX:800;
(%o2)                                 800
(%i3) set_random_state(make_random_state(true));
(%o3)                                done
(%i4) get_number_from_list(P):=(s:1,for i in P do s:s*first(i)^second(i),s);
(%o4) get_number_from_list(P) := (s : 1, 
                                                                  second(i)
                                      for i in P do s : s first(i)         , s)
(%i5) write_number_from_list(P):=(s:"1",for i in P do s:concat(s,"*",first(i),"^",second(i)),s);
(%o5) write_number_from_list(P) := (s : "1", 
                 for i in P do s : concat(s, "*", first(i), "^", second(i)), s)
(%i6) create_number_from_list(P,name):=(s:concat(name,":[]",SEMICOL," "),for i in P do s:concat(s,name,":append(",name,",[[",first(i),",",second(i),"]])",SEMICOL," "),s);
(%o6) create_number_from_list(P, name) := 
(s : concat(name, ":[]", SEMICOL, " "), 
for i in P do s : concat(s, name, ":append(", name, ",[[", first(i), ",", 
second(i), "]])", SEMICOL, " "), s)
(%i7) create_number_from_list2(P,name):=(s:concat(name,":["),for i in P do s:concat(s,"[",first(i),",",second(i),"],"),s:substring(s,1,slength(s)),s:concat(s,"]",SEMICOL),s);
(%o7) create_number_from_list2(P, name) := 
(s : concat(name, ":["), for i in P do s : 
concat(s, "[", first(i), ",", second(i), "],"), 
s : substring(s, 1, slength(s)), s : concat(s, "]", SEMICOL), s)
(%i8) is_deffic(P):=block(n:get_number_from_list(P), if (divsum(n) <
 2*n) then return (1) else return (0));
(%o8) is_deffic(P) := block(n : get_number_from_list(P), 
                              if divsum(n) < 2 n then return(1) else return(0))
(%i9) deffic(P):=block(n:get_number_from_list(P), divsum(n)/(2*n));
                                                          divsum(n)
(%o9)     deffic(P) := block(n : get_number_from_list(P), ---------)
                                                             2 n
(%i10) nastav_povol(P):=(P2:[], j:1, for i in P do (P2:append(P2,[j]),j:j+1),P2);
(%o10) nastav_povol(P) := (P2 : [], j : 1, 
                           for i in P do (P2 : append(P2, [j]), j : j + 1), P2)
(%i11) najdi_index(Pov):=(random(length(Pov))+1);
(%o11)            najdi_index(Pov) := random(length(Pov)) + 1
(%i12) zvets(P,k):=(P[k][2]:MAXEX);
(%o12)                   zvets(P, k) := (P )  : MAXEX
                                          k
                                            2
(%i13) zvets_o1(P,k):=(P[k][2]:P[k][2]+1);
(%o13)                zvets_o1(P, k) := (P )  : (P )  + 1
                                          k       k
                                            2       2
(%i14) zmen_povol(P,k):=(P:delete(k,P));
(%o14)               zmen_povol(P, k) := P : delete(k, P)
(%i15) zmen_povol_o1(P,k):=(P:delete(k,P));
(%o15)              zmen_povol_o1(P, k) := P : delete(k, P)
(%i16) set_exp_1(P):=(j:1, for i in P do (P[j][2]:1,j:j+1));
(%o16)   set_exp_1(P) := (j : 1, for i in P do ((P )  : 1, j : j + 1))
                                                  j
                                                    2
(%i17)  smaz_jedno(P):=(i:random(length(P))+1,P:delete(P[i],P));
(%o17)  smaz_jedno(P) := (i : random(length(P)) + 1, P : delete(P , P))
                                                                 i
(%i18) pridej_jedno(P):=(P:append(P,[[next_prime(P[length(P)][1]),1]]));
(%o18) pridej_jedno(P) := P : append(P, [[next_prime((P         ) ), 1]])
                                                       length(P)
                                                                 1
(%i19) L:[[2,2],[5,1]];
(%o19)                         [[2, 2], [5, 1]]
(%i20) Povol:nastav_povol(L);
(%o20)                              [1, 2]
(%i21) number_found:0;
(%o21)                                 0
(%i22) no_povol:0;
(%o22)                                 0
(%i23) d:deffic(L);
                                      21
(%o23)                                --
                                      20
(%i24) if (d=1) then (  number_found:1,  write_number_from_list(L))elseif (length(Povol)=0) then (  no_povol:1)elseif (d<
1) then (  je_totalne_deffic:0,  L2:copylist(L),  Povol2:copylist(Povol),  dalsi:1,  for i: 1 while dalsi = 1 do (    if length(Povol2)=0 then (      dalsi:0,      je_totalne_deffic:1    )    else (      k:najdi_index(L2),      zvets(L2,k),      Povol2:zmen_povol(Povol2,k),      d2:deffic(L2),      if (d2=1) then (        dalsi:0,        write_number_from_list(L2)      )      elseif (d2<
1) then          dalsi:1      else        dalsi:0    )  ),  if (je_totalne_deffic=0) then (    L2:copylist(L),    zvets_o1(L,k),    d2:deffic(L),    if (d2=1) then (      L:copylist(L2),      Povol:zmen_povol_o1(Povol,k),      write_number_from_list(L)    )    elseif (d2>
1) then (      L:copylist(L2),      Povol:zmen_povol_o1(Povol,k)    )  ));
(%o24)                               false
(%i25) if (d>
1 or no_povol=1) then (  set_exp_1(L),  L:smaz_jedno(L));
(%o25)                             [[2, 1]]
(%i26) L;
(%o26)                             [[2, 1]]
(%i27) 

Related Help

Help for Substring