JAMET

270 Reputation

3 Badges

4 years, 163 days

MaplePrimes Activity


These are replies submitted by JAMET

Thank you very much for your code.
I am a 80 years old fan  of math. and I am trying to solve old problems of 1945 French syllabus using Maple with difficulties.

I am sorry I make a mistake, I meant triangle (MPQ) in stead of (MNP).
How animate correctly this geometrical figure ?

with(plots):with(geometry): unprotect(O):unprotect(D):unprotect(I) R:= 5: alpha:= (1/9)*Pi: beta:= (1/3)*Pi: n:= 100: dt:= 2*Pi/n: C1:= plot([R*cos(t), R*sin(t), t = 0 .. 2*Pi], color = blue): O:= [0, 0]: M:= [R*cos(beta), R*sin(beta)]: A:= [R*cos(alpha), R*sin(alpha)]: B:= [R*cos(alpha+Pi), R*sin(alpha+Pi)]: AB:= plot([A, B]): OM:= plot([O, M]): P:= [R*cos(t0*dt), R*sin(t0*dt)]: Q:= [R*cos(dt*t0+Pi), R*sin(dt*t0+Pi)]: point(M,M[1],M[2]):point(P,P[1],P[2]):point(Q,Q[1],Q[2]): triangle(T,[M,N,P]):bisector(bM, M, T):ExternalBisector(exbM,M,T): line(lMP, [M,P]):line(lMQ, [M,Q]):line(lPQ,[P,Q]):line(lAB,[A,B]): intersection(D,bM,lPQ):intersection(E,bM,lAB): intersection(Dp,exbM,lPQ):intersection(Ep,exbM,lAB): circle(Cir,[D,M,Dp]):center(I,Cir): diamob:= seq ( display ( [ plot( [P, Q], color = green), plot([M, P]), plot([M, Q]) ] ), t0 = 0 .. n ): tp:= textplot( [ [A[1]+.3, A[2], "A"], [B[1]-.3, B[2], "B"], [M[1]+.3, M[2]+.3, "M"] ] ): display( [ AB, C1, tp, display ( diamob,Cir,I, insequence = true ) ], scaling = constrained ); Error, missing operator or `;` interface(rtablesize=10): Too many errors. Thank you

Procedure Tunnell don't give a good answer for 24 and 41 (numbers <100)
Thank you

restart; with(NumberTheory);

Tunnell := proc (n) local a, b, A, B, C, Dd, k; if not IsSquareFree(n) then return false end if; if `mod`(n, 8) = 5 or `mod`(n, 8) = 6 or `mod`(n, 8) = 7 then if `mod`(n, 2) = 1 then A := 0; B := 0; for a from ceil(-sqrt((1/2)*n)-1) to ceil(sqrt((1/2)*n)+1) do for b from ceil(-sqrt(n)-1) to ceil(sqrt(n)+1) do k := n-2*a^2-b^2; if is(sqrt((1/32)*k), integer) then A := A+1 else if is(sqrt((1/8)*k), integer) then B := B+1 end if end if end do end do; if 2*A = B then return true else return false end if elif `mod`(n, 2) = 0 then C := 0; Dd := 0; for a from ceil(-sqrt((1/8)*n)-1) to ceil(sqrt((1/8)*n)+1) do for b from ceil(-sqrt((1/2)*n)-1) to ceil(sqrt((1/2)*n)+1) do k := (1/2)*n-4*a^2-b^2; if is(sqrt((1/32)*k), integer) then C := C+1 else if is(sqrt((1/8)*k), integer) then Dd := Dd+1 end if end if end do end do; if 2*C = Dd then return true else return false end if end if else return false end if end proc;
Tunnell(5);
Tunnell(34);
Tunnell(55);
Tunnell(61);
Tunnell(41);

Tunnell(79);
select(Tunnell, [seq(k, k = 1 .. 100)]);
Unperfect procedure (found on internet) which is not too bad. How to improve it ?

Thank you for tomleslie's explanations.
Some remarks : OEIS fondation in A042963, A003273 give Mathematica code for decomposition of congruent numbers ;
                           magma or SageMath give answers very quickly for such problem using elliptic curves. And Maple ?

From a given number u who is congruent how to find the rational sides of rectangle triangle of which u is the area.
Example from 34 I would like 24,17/6 et 154/6 for 24*17/6*1/2=34 ;
               fom 111 I would like 444/35, 35/2 et 1513/70 for 444/35*35/2*1/2=111.
Thanks you.

There is a problem this procedure FC does not work

I don't see what is u ? Thank you.

rang:=proc(M,a)
local i:
for i from 1 to nops(M)-1 do
if M[i]=a then return(i) fi od
end:

1 2 3 4 5 Page 5 of 5