Kitonum

21550 Reputation

26 Badges

17 years, 125 days

MaplePrimes Activity


These are answers submitted by Kitonum

local Prime:

Prime:= proc (a, b)

local i, p, r;

p := {};

r :={} ;

for i from a to b do

   if isprime(i) then p := p union {i} ;

     if type(sqrt(p[-1]-1), integer) then r := r union {p[-1]} end if; end if;

end do;

p, r;

end proc:

 

Your example:

Prime(1, 10);

                       {2, 3, 5, 7}, {2, 5}

 

Another example:

Prime(1, 100);

   {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97}, {2, 5, 17, 37}

I guess that you are interested only real solution:

RealDomain[solve](convert({0.001=x*exp(0.6/(n*0.026)), 0.01=x*exp(0.68/(n*0.026))}, fraction),{x,n});

evalf(%);

 

 

n[1] := 1.5:  n[2] := 1:

sin(theta[g]):='n[2]'/'n[1]' = cat(convert(n[2], symbol)/convert(n[1], symbol), `=`, `0`, n[2]/n[1]);

                                

 

 

Also, the initial value for  P  should be   instead of  1.

 

I think it is more natural to use a formula instead of loops, for example as in Wiki

restart;

f:=x->2^x:

M:={-2,-1,0,1,2}: n:=nops(M):

L:=(i,x)->normal(mul((x-j)/(M[i]-j), j=M minus {M[i]})):

P:=add(f(M[i])*L(i,x), i=1..n);

plot([f(x), P], x=-2..2, color=[red,blue]);

 

 

 

We see that the approximation is very good (the graphics are almost identical).

You can prevent the calculation of  ln(1.5)  just treating  1.5  as a symbol:

diff(`1.5`^x,x);

                   

y:=sin(x):  y1:=x*sin(x):

maximize(y, x=0..Pi);

evalf(maximize(y1, x=0..Pi));

Optimization[Maximize](y1, x=0..Pi);

                                             1

                                   1.819705741

        [1.81970574115965, [x = 2.02875783126017]]

eq1:=x^2-y^2=a*z^2:

eq2:=x-y=a*z:

factor(eq1/eq2);

              x + y = z

S:={seq(seq(i*j, i=7..9997,10), j=1..9991,10)}:  # The set of all the products in increasing order

S[1..10];  # The first 10 products

S[-10..-1];  # The last 10 products

                                                 {7, 17, 27, 37, 47, 57, 67, 77, 87, 97}

{99580117, 99580297, 99580377, 99580437, 99680087, 99680207, 99680247, 99780057, 99780117, 99880027}

 

B:=[A1,A10,A11,A12,A2,A3,A4,A5,A6,A7,A8,A9]:

sort(B,(x,y)->parse(convert(x,string)[2..-1])<parse(convert(y,string)[2..-1]));

                 [A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12]

restart;

w:=1+t/100:

sol:=dsolve({diff(x(t),t$2)+w^2*x(t)=0, y(t)=diff(x(t),t), E(t)=0.5*(y(t)^2+w^2*x(t)^2), J(t)=E(t)/w, x(0)=1, D(x)(0)=2}, {x(t),y(t),E(t),J(t)}, numeric):

 plots[odeplot](sol, [[t,E(t)], [t,J(t)]], t=0..10, color=[red,blue], thickness=2, legend=['E(t)','I(t)']);

                           

 

 

restart;

N:={F=1, K=1.2}:

Eq:= diff(C(x),x$2)-F*diff(C(x),x)-F*K*C(x)=0:

Bcs:=  F*D(C)(0)=C(0)-1, D(C)(1)=0:

Sol:= dsolve(eval({Eq, Bcs}, N), C(x));

assign(%);

plot(C(x), x=0..3, 0..3, color=red, thickness=2);

 

 

f:=x->1/4*x^3-x^2-x+4;

op(map(t->[t,f(t)], {solve(f(x))}));

                  

 

 

Rewrite your equation as follows

cos(x)=(sin(x)*sin(x/1000))/x

It is easy to show that  abs((sin(x)*sin(x/1000))/x)<=1/1000  and therefore the roots of your equation (except x=0) are very close to the roots of the equation  cos(x)=0 . You can easily find any number of roots of your equation, taking as the intervals ends (for each root of your equation) the successive roots of  the equation sin(x)=0

 

For example, here are the first 10 positive roots:

seq(fsolve(x*cos(x)-sin(x)*sin(x/1000), x=Pi*k .. Pi*(k+1)), k=0 .. 9);

seq(fsolve(cos(x), x=Pi*k .. Pi*(k+1)), k=0 .. 9);  # For comparison


1.569796328, 4.711388984, 7.852981645, 10.99457431, 14.13616697, 17.27775964, 20.41935232, 23.56094499, 26.70253767, 29.84413036

1.570796327, 4.712388980, 7.853981634, 10.99557429, 14.13716694, 17.27875959, 20.42035225, 23.56194490, 26.70353756, 29.84513021

 

a := 2: b := -3:

solve(subs({x^2 = t, y^2 = z}, a*x^2+b*y^2 = 0), z);

plot(%, t = 0 .. 3, color = red, thickness = 2, scaling = constrained, labels = [x^2, y^2]);

                           

 

Edited. For real  a ,  b , x , y  if  a>0  and  b>0  or  a<0  and  b<0  the equality  a*x^2+b*y^2 = 0  is impossible.

An example:

f:=0.5:

plots[spacecurve]([cos(2*Pi*f*t), sin(2*Pi*f*t), t], t=0..6, color=red, thickness=2, axes=normal, numpoints=1000, labels=[``,``, t]);

                                          

 

 

Edited.

 

 

First 202 203 204 205 206 207 208 Last Page 204 of 290