Kitonum

13347 Reputation

24 Badges

11 years, 66 days

MaplePrimes Activity


These are answers submitted by Kitonum

Here are 2 customised legends with vertical alignment (text rotation is available only from Maple 2018):

restart;
with(plots):
Plots:=plot([t^2,t^3], t=-2..2, color=[blue,red], linestyle=[1,3], view=-2..2, labels=[t,"x,y"]):
Lines:=plot([[1.6,t,t=0.9..1.3],[1.9,t,t=0.9..1.3]], color=[blue,red], linestyle=[1,3]):
Labels:=textplot([[1.55,1.55,x=t^2,rotation=Pi/2],[1.85,1.55,y=t^3,rotation=Pi/2]]):
display(Plots, Lines, Labels);

           

 

Use  seq  command for this.

Example:

seq(sin(x), x=0..evalf(Pi/4), 0.1);

     0, 0.9983341665e-1, .1986693308, .2955202067, .3894183423, .4794255386, .5646424734, .6442176872

Check:=proc(n)
local L;
L:=ifactors(n);
if n>1 and type(n,odd) and (not isprime(n)) and `and`(map(t->is(t[2]=1),L[2])[]) and `or`(map(t->is(irem(n-1,t[1]-1)=0),L[2])[]) then true else false fi;
end proc: 

Example of use:
Check(561);
                           
 true


The previous answer skipped checking of square free.

restart: 
with(plots):
animate(plot, [[sqrt(x)-1, sqrt(x)], x = 0..t, filled = true, color=["Blue", "Red"], view = [0..20, 0..5]], t = 0..20);

    

Edit.

with(plots):
r:=<cos(t), sin(t), t>:
dr:=diff(r, t):
A:=spacecurve(r, t = -5 .. 5, color=black):
B:=seq(spacecurve(r+s*dr, s = -2 .. 2, color=black), t = -5 .. 5, 0.1):
display(A,B, view=[-1..1,-1..1,-5..5]);

    

Addition. We can also animate this:

with(plots):
r:=<cos(t), sin(t), t>:
dr:=diff(r, t):
A:=spacecurve(r, t = -5 .. 5, color=black):
B:=b->seq(spacecurve(r+s*dr, s = -2 .. 2, color=black, thickness=0), t = -5 .. b, 0.1):
animate(display,['B'(b)], b=-5..5, frames=100, background=A, view=[-1..1,-1..1,-5..5], orientation=[60,55]);

   

P:= proc(n::posint)
option remember;
   if n=1 then return 1 fi;
   if type(P(n-1)+1,prime) then return P(n-1)+1 else
   if type(P(n-1),even) then return (n-1)+2 else P(n-1)+3 fi; fi;
end proc:

seq(P(n), n=1..20);
    
1, 2, 3, 6, 7, 10, 11, 14, 10, 11, 14, 13, 16, 17, 20, 17, 20, 19, 22, 23

The code above exactly corresponds to the conditions set by you in the first post.

To get the sequence you suggest, you must write

P:= proc(n::posint)
option remember;
   if n=1 then return 1 fi;
   if type(P(n-1)+1,prime) then return P(n-1)+1 else
   if type(P(n-1),even) then return P(n-1)+2 else P(n-1)+3 fi; fi;
end proc:

seq(P(n), n=1..20);
       
 1, 2, 3, 6, 7, 10, 11, 14, 16, 17, 20, 22, 23, 26, 28, 29, 32, 34, 36, 37

Edit.

Eq:=diff(y(x),x)=cos(x):
ics:=y(0)=0:
Sol:=dsolve({Eq, ics}, numeric):
P:=proc(s)
plot(eval([[x,y(x)]], Sol(s)), style=point, symbol=solidcircle, symbolsize=15);
end proc:
plots:-animate(plots:-display,['P'(s)], s=0..Pi, scaling=constrained, size=[800,300]);

    

restart;
Expr:=(2*I*Zeta*omega*omega[0] - omega^2 + omega[0]^2)*fourier(omega[r](t), t, omega) = (omega*B[1]*I + B[0])*fourier(delta(t), t, omega);
Expr/op([2,2],Expr)/op([1,1],Expr);

        

The procedure  Check  tests this hypothesis for the four numbers starting with  .


 

Check:=proc(n::integer)
if n<=11 then error "n should be greater than 11" fi;
if `or`(seq(`or`(map(s->s[1]>11,ifactors(k)[2])[]), k=n..n+3)) then true else false fi;
end proc:


Examples of use

seq(Check(n), n=1000..1200);

true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true

(1)

# Checking from n=12 to n=1000000
C:=true:
for n from 12 to 10^6 do
if Check(n)=false then C:=false; break fi;
od:
C;
 

true

(2)

 


 

Download Conjecture.mw

restart;
with(plots):
Points:=plot([[1,1],[2,2]], style=point, symbol=solidcircle, symbolsize=15, color=red):
animate(plot,[[t,t, t=1..a], color=green, thickness=3, view=[0..2.5,0..2.5]],  a=1..2, frames=60, background=Points);

 

restart; 
simplify(A*sin(x)^2+A*cos(x)^2);

 

A simple procedure  Cone  returns parametric equations and plots a conical surface defined its vertix  S  and 3 points  A, B, С of the base lying on a plane  xOy . If  S  is a number then the procedure treats it as the height of a right circular cone. If   is a list, then it is the coordinates of the vertex of the cone.

 

restart;
Cone:=proc(A,B,C,S)
local a, b, c, cc, oo, R, CC, Eq;
uses geometry;
point(a,A); point(b,B); point(c,C);
circle(cc, [a, b, c], [x,y], 'centername'=oo);
R:=radius(cc); CC:=coordinates(oo);
if type(S,list) then
Eq:=[(CC[1]+R*cos(phi))*t+S[1]*(1-t),(CC[2]+R*sin(phi))*t+S[2]*(1-t),S[3]*(1-t)] else
Eq:=[(CC[1]+R*cos(phi))*t+CC[1]*(1-t),(CC[2]+R*sin(phi))*t+CC[2]*(1-t),S*(1-t)] fi;
print(simplify(Eq));
plot3d(Eq, phi=0..2*Pi, t=0..1, axes=normal, scaling=constrained);
end proc:

Cone([1,1],[3,4],[5,1],5);

[(13/6)*t*cos(phi)+3, (13/6)*t*sin(phi)+11/6, 5-5*t]

 

 

Cone([1,1],[3,4],[5,1],[6,3,5]);

[(13/6)*t*cos(phi)-3*t+6, (13/6)*t*sin(phi)-(7/6)*t+3, 5-5*t]

 

 

 


 

Download Cone.mw

Edit.

Changes in your graphs when changing the parameter   is convenient to observe with the help of animation. I took a range for the animation parameter  E = 0 .. 2  with the step  0.02 . See attached file.

captive_breeding_new.mw

 

The  isolve  command fails with this equation.

Rewrite the equation as  2^y - x^2 = 615 . It is easy to check by the last digit that  y  should be even that is  y=2*n . So we have  (2^n - x)*(2^n + x) = 615 . The number 615 can be factored into 2 integer factors in 3 ways for  x>0:  615 = 3*205 = 5*123 = 15*41 

Solving the corresponding 3 systems, we obtain the unique solution:

restart;
ifactor(615);
solve({2^n-x=5,2^n+x=123});
solve({2^n-x=3,2^n+x=205});
solve({2^n-x=15,2^n+x=41});

              

 

 

Use the double  seq  command for this. First, I used a set structure to remove duplicate elements and for automatic sorting, then converted it into a list:

convert({seq(seq(a^2+b^2, a=0..5), b=0..5)}, list);
select(type, %, odd);

 

5 6 7 8 9 10 11 Last Page 7 of 208