For a table of x,y,z data points:
{{0.9999, 0.9999, 1000}, {0.9999, 0.99991, 1000}, {0.9999, 0.99992,
1000},...., {1.0001, 1.00008, 50}, {1.0001, 1.00009, 50}, {1.0001, 1.0001,
1000}}
z=A006577(n) at x=y=1, has the same value for z in a rectangular pattern on x and y, where the rectangle is centered on x=y=1 (where n=startN=stopN). Is there a way to find the length and width for this rectangle? Or the number of x and y points that share the same z value for this rectangle? Here is the code that shows the central rectangle, with a length of 9 points and width of 5 points:
collatzStuffC =
Compile[{{c1, _Real}, {c2, _Real}, {nStart, _Integer}, {nStop, \
_Integer}, {maxStepsToCheck, _Integer}},
Module[{stepsForEachN = Table[-1, {i, nStop - nStart}],
stepsForEachNIndex = Table[-1, {i, nStop - nStart}], n = -1,
m = -1}, Table[n = x;
Table[
If[n < 2 && i > 1, {-1, -1, -1},
If[EvenQ[n], n = Round[(n/2)*c1], n = Round[(3*n + 1)*c2]];
m = i;
{x, m, n}], {i, maxStepsToCheck}], {x, nStart, nStop}]]];
Options[collatzData] = {"Coefficient1" -> 1, "Coefficient2" -> 1,
"Start" -> 1, "Stop" -> 10, "MaxIterations" -> 100};
collatzData[OptionsPattern[]] :=
collatzStuffC @@
OptionValue[{"Coefficient1", "Coefficient2", "Start", "Stop",
"MaxIterations"}];
collatzStuff[ops : OptionsPattern[]] :=
With[{cd =
collatzData[
ops]},(*this is just a bunch of vectorized junk to pull the last \
position before the {-1,-1,-1}*)
Extract[cd,
Developer`ToPackedArray@
Join[ArrayReshape[Range[Length@cd], {Length@cd, 1}],
Pick[ConstantArray[Range[Length@cd[[1]]], Length@cd],
UnitStep[cd[[All, All, 1]]], 1][[All, {-1}]], 2]]]
plots3Dlist = {};
startN = 2002;
stopN = 2002;
c1min = 0.9999;
c1max = 1.0001;
c2min = 0.9999;
c2max = 1.0001;
c1step = 0.00001;
c2step = 0.00001;
maxIterations = 1000;
For[abc = startN, abc <= stopN, abc++,
Print[StringForm["loop counter `` of ``", abc - startN,
stopN - startN]];
thisIsATable =
Table[{c1, c2,
collatzStuff["Coefficient1" -> c1, "Coefficient2" -> c2,
"Start" -> abc, "Stop" -> abc,
"MaxIterations" -> maxIterations][[1, 2]]}, {c1, c1min, c1max,
c1step}, {c2, c2min, c2max, c2step}] // Flatten[#, 1] &;
AppendTo[plots3Dlist,
ListPointPlot3D[thisIsATable, PlotRange -> All]]]
plots3Dlist
thisIsATable
This code is from the other question here:
solve for two variables for each n related to Collatz conjecture
I'd like to find the length and width of the rectangle for multiple graphs, and then compare the length and widths to see if there is a pattern.
Here is a picture of the rectangle from the above code with the outline marked.