Sponsored links: Algebra eBooks
 

Related

ascii-concat-eval_string-printf-split-string

s: printf(false, eval...

split(s,eval_string(c...

Calculate

ascii-display

set_display(ascii);

5^(5^5);

Calculate

ascii-display-matrix

set_display('ascii);

A:matrix([11,-5,4,6],...

L1:matrix([1,0,0], [-...

Calculate

ascii-do

for n from 0 thru 100...

Calculate

ascii-atan-bfloat-display-fpprec

fpprec : 100;

set_display('ascii);

bfloat(4*atan(1));

Calculate

ascii-do

for n from 0 thru 255...

Calculate

ascii-expand-length-load-makelist-reverse

"*"/* Eine Polynomfun...

"*"/* Eingabe der Pun...

Punkt:[[-4,0],[-1,-3]...

Calculate

ascii-display

set.display('ascii);

110!;

Calculate

ascii-ev-expand-length-makelist-reverse

"*"/* Eine Polynomfun...

"*"/* Eingabe der Pun...

Punkt:[[-4,0],[-1,-3]...

Calculate

ascii-expand-length-load-makelist-reverse

"*"/* Eine Polynomfun...

"*"/* Eingabe der Pun...

Punkt:[[-4,0],[-1,-3]...

Calculate

ascii

Run Example
(%i1)fpprec:145;
(%o1)                                 145
(%i2) fpprintprec:0 /* wenn vorher anders gesetzt */;
(%o2)                                  0
(%i3) set_display(ascii) /* damit es unter wxMaxima auch angezeigt wird */;
(%o3)                         set_display(ascii)
(%i4) z:bfloat(%pi);
(%o4) 3.1415926535897932384626433832795028841971693993751058209749445923078164\
06286208998628034825342117067982148086513282306647093844609550582231725359b0
(%i5) z:charlist(string(z));
(%o5) [3, ., 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 8, 9, 7, 9, 3, 2, 3, 8, 4, 6, 2, 6, 
4, 3, 3, 8, 3, 2, 7, 9, 5, 0, 2, 8, 8, 4, 1, 9, 7, 1, 6, 9, 3, 9, 9, 3, 7, 5, 
1, 0, 5, 8, 2, 0, 9, 7, 4, 9, 4, 4, 5, 9, 2, 3, 0, 7, 8, 1, 6, 4, 0, 6, 2, 8, 
6, 2, 0, 8, 9, 9, 8, 6, 2, 8, 0, 3, 4, 8, 2, 5, 3, 4, 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8, 4, 4, 6, 0, 
9, 5, 5, 0, 5, 8, 2, 2, 3, 1, 7, 2, 5, 3, 5, 9]
(%i8) nachkommastellen:length(z);
(%o8)                                 144
(%i9) quersumme:sum(z[i],i,1,144);
(%o9)                                 666
(%i10) display(nachkommastellen,quersumme);
                            nachkommastellen = 144

                                quersumme = 666

(%o10)                               done
(%i11) 
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) 
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), --------- n)
                                                             2
(%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):=(P2:P,P2[k][2]:MAXEX,P2);
(%o12)            zvets(P, k) := (P2 : P, (P2 )  : MAXEX, P2)
                                             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):=(P2:P,P2:delete(k,P2),P2);
(%o14)       zmen_povol(P, k) := (P2 : P, P2 : delete(k, P2), P2)
(%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):=(ind:najdi_index(P),P:delete(P[ind],P));
(%o17)   smaz_jedno(P) := (ind : najdi_index(P), P : delete(P   , P))
                                                             ind
(%i18) pridej_jedno(P):=(P:append([next_prime(P[length(P)][1]),1]));
(%o18)   pridej_jedno(P) := P : append([next_prime((P         ) ), 1])
                                                     length(P)
                                                               1
(%i19) L:[[2,1],[3,5]];
(%o19)                         [[2, 1], [3, 5]]
(%i20) Povol:nastav_povol(L);
(%o20)                              [1, 2]
(%i21) zmen_povol_o1(Povol,2);
(%o21)                                [1]
(%i22) 
[alphacharp,ascii,block,delete,emptyp,if,length,makelist,map,not,string,subst] [alphacharp,ascii,block,delete,if,length,makelist,map,return,string,subst] [alphacharp,ascii,delete,if,length,makelist,map,string] [append,ascii,block,concat,copylist,delete,divsum,first,if,make_random_state,next_prime,second,set_random_state,slength,substring,true] [append,ascii,block,concat,delete,divsum,first,if,make_random_state,next_prime,second,set_random_state,slength,substring,true] [append,ascii,block,concat,delete,divsum,first,if,random,second,slength,substring] [append,ascii,block,concat,divsum,first,if,return,second,slength,substring] [append,ascii,block,concat,divsum,first,if,second,slength,substring] [append,ascii,block,copylist,delete,divsum,first,if,make_random_state,next_prime,print,sconcat,second,set_random_state,slength,substring,true] [append,ascii,block,copylist,delete,divsum,first,if,make_random_state,next_prime,print,sconcat,second,set_random_state,slength,substring] [append,ascii,block,delete,divsum,first,if,make_random_state,next_prime,sconcat,second,set_random_state,slength,substring,true] [append,ascii,block,delete,first,if,make_random_state,next_prime,sconcat,second,set_random_state,slength,substring,true] [append,ascii,concat,first,second,slength,substring] [append,ascii,concat,first,second] [ascii,bfloat,display,fpprec,sqrt] [ascii,bfloat,float,fpprec,sqrt] [ascii,block,concat,eval_string,fpprintprec,is,printf,return,split,sremove,string] [ascii,concat,eval_string,printf,split,string] [ascii,display] [ascii,do] [ascii,expand,length,load,makelist,reverse] [ascii,expand,length,makelist,matrix,reverse] [ascii,expand,length,makelist,reverse] [ascii,length,makelist,reverse] [ascii]

Related Help

Help for Ascii