Kitonum

21435 Reputation

26 Badges

17 years, 23 days

MaplePrimes Activity


These are replies submitted by Kitonum

If formally integrated in each interval, we get

int(abs(x-2), x)=-x^2/2+2*x+C1, x<=2

int(abs(x-2), x)=x^2/2-2*x+C2, x>=2

But the function  int(abs(x-2), x)   is continuous throughout the real axis and, in particular, at the point  x=2  because the function  abs(x-2)  is continuous. Therefore, at the point  x=2  we obtain  2+C1=-2+C2  or  C2=C1+4

@Carl Love 

Thanks for the explanation!

@Carl Love 

Thanks for the explanation!

It's interesting, why my simple version takes less time than your multithreaded version?

t:=time(): PP({i $ i=1..20}): time()-t;

t:=time(): PowerSet({i $ i=1..20}): time()-t;


                        10.640

                        14.766

It's interesting, why my simple version takes less time than your multithreaded version?

t:=time(): PP({i $ i=1..20}): time()-t;

t:=time(): PowerSet({i $ i=1..20}): time()-t;


                        10.640

                        14.766

@Carl Love

Regarding this example, you are right. But brute force method is more universal. Try to solve by  fsolve  the same question, for example,  for a series  

sum(ln(n)/n^2, n = 1 .. infinity);

@Carl Love

Regarding this example, you are right. But brute force method is more universal. Try to solve by  fsolve  the same question, for example,  for a series  

sum(ln(n)/n^2, n = 1 .. infinity);

If in the code of the procedure to replace the line  

L:=indets(A); m:=nops(L);  

by two lines

L0:=indets(A);
L:=remove(x->is(type(x,`^`)), L0);  m:=nops(L);

then operation of raising to a power is also supported. 

Note: the encoded numbers should not contain protected constants. For example, should be written  pi  rather than  PI or  Pi .

Attached file corrected.

 

Classic example (Knuth Volume 4 Fascicle 2):

Ksolve(pi * R ^ 2 = AREA);

          96*7^2 = 4704

 

Another example:

Ksolve(a^a=bcda);                                

             5^5  = 3125

 

 

Kryptarithms.mws

Acer, thank you very much!

Acer, thank you very much!

@Carl Love 

The following code finds the same solutions as your code, but it works 17 times faster. In fact, it does not matter, because in any of these solutions, excepted one solution,  the condition, that the distinct letters represent distinct digits, does not hold.

restart;

t:=time():

[seq(seq(seq([CNRP=9*10^3+N*10^2+R*10+P, CPP=9*10^2+P*10+P, KHMER=9*10^3+N*10^2+R*10+P+9*10^2+P*10+P], N=0..9), R=0..8, 2), P=0..9)]:

L:=select(n->is(convert(rhs(n[3]),base,10)[1]=convert(rhs(n[1]),base,10)[2] and nops(convert(rhs(n[3]),base,10))=5), %):

time()-t;

nops(L);

                                   0.031 

                                     94

@Carl Love 

The following code finds the same solutions as your code, but it works 17 times faster. In fact, it does not matter, because in any of these solutions, excepted one solution,  the condition, that the distinct letters represent distinct digits, does not hold.

restart;

t:=time():

[seq(seq(seq([CNRP=9*10^3+N*10^2+R*10+P, CPP=9*10^2+P*10+P, KHMER=9*10^3+N*10^2+R*10+P+9*10^2+P*10+P], N=0..9), R=0..8, 2), P=0..9)]:

L:=select(n->is(convert(rhs(n[3]),base,10)[1]=convert(rhs(n[1]),base,10)[2] and nops(convert(rhs(n[3]),base,10))=5), %):

time()-t;

nops(L);

                                   0.031 

                                     94

Different letters denote different figures.  DirectSearch  package ignores the condition  nops({C, E, H, K, M, N, P, R}) = 8

Different letters denote different figures.  DirectSearch  package ignores the condition  nops({C, E, H, K, M, N, P, R}) = 8

@Carl Love 

Of course, calculated solutions are the all solutions. I meant that the code itself can be different. 

First 115 116 117 118 119 120 121 Last Page 117 of 132