## A geometric construction for the Summer Holiday

by: Maple

A geometric construction for the Summer Holiday

Does every plane simple closed curve contain all four vertices of some square?

This is an old classical conjecture. See:
https://en.wikipedia.org/wiki/Inscribed_square_problem

Maybe someone finds a counterexample (for non-analytic curves) using the next procedure and becomes famous!

 > SQ:=proc(X::procedure, Y::procedure, rng::range(realcons), r:=0.49) local t1:=lhs(rng), t2:=rhs(rng), a,b,c,d,s; s:=fsolve({ X(a)+X(c) = X(b)+X(d),             Y(a)+Y(c) = Y(b)+Y(d),             (X(a)-X(c))^2+(Y(a)-Y(c))^2 = (X(b)-X(d))^2+(Y(b)-Y(d))^2,             (X(a)-X(c))*(X(b)-X(d)) + (Y(a)-Y(c))*(Y(b)-Y(d)) = 0},           {a=t1..t1+r*(t2-t1),b=rng,c=rng,d=t2-r*(t2-t1)..t2});  #lprint(s); if type(s,set) then s:=rhs~(s)[];[s,s[1]] else WARNING("No solution found"); {} fi; end:

Example

 > X := t->(10-sin(7*t)*exp(-t))*cos(t); Y := t->(10+sin(6*t))*sin(t); rng := 0..2*Pi;
 (1)
 > s:=SQ(X, Y, rng): plots:-display(    plot([X,Y,rng], scaling=constrained),    plot([seq( eval([X(t),Y(t)],t=u),u=s)], color=blue, thickness=2));

## Calculating Collatz's Conjecture ...

Hi everyone, I'm trying to print out Collatz's Conjecture's steps for any given value with the following code but it takes forever and prints nothing. Any idea on how I can get it working ?

checkCollatzValue:=proc(val) local res, remaining;
while res <> 1 do
remaining = irem(val, 2); remaining;
if remaining = 0 then res = val / 2; else res = val * 3 + 1; fi;
res;
od;
end proc;

## MRB constant rational?A

 Page 1 of 1
﻿