(************** Content-type: application/mathematica **************
CreatedBy='Mathematica 5.1'
Mathematica-Compatible Notebook
This notebook can be used with any Mathematica-compatible
application, such as Mathematica, MathReader or Publicon. The data
for the notebook starts with the line containing stars above.
To get the notebook into a Mathematica-compatible application, do
one of the following:
* Save the data starting with the line of stars above into a file
with a name ending in .nb, then open the file inside the
application;
* Copy the data starting with the line of stars above to the
clipboard, then use the Paste menu command inside the application.
Data for notebooks contains only printable 7-bit ASCII and can be
sent directly in email or through ftp in text mode. Newlines can be
CR, LF or CRLF (Unix, Macintosh or MS-DOS style).
NOTE: If you modify the data for this notebook not in a Mathematica-
compatible application, you must delete the line below containing
the word CacheID, otherwise Mathematica-compatible applications may
try to use invalid cache data.
For more information on notebooks and Mathematica-compatible
applications, contact Wolfram Research:
web: http://www.wolfram.com
email: info@wolfram.com
phone: +1-217-398-0700 (U.S.)
Notebook reader applications are available free of charge from
Wolfram Research.
*******************************************************************)
(*CacheID: 232*)
(*NotebookFileLineBreakTest
NotebookFileLineBreakTest*)
(*NotebookOptionsPosition[ 42665, 1365]*)
(*NotebookOutlinePosition[ 43829, 1402]*)
(* CellTagsIndexPosition[ 43697, 1395]*)
(*WindowFrame->Normal*)
Notebook[{
Cell[CellGroupData[{
Cell["Finding a/N with partial quotients all 1 or 2", "Title"],
Cell["\<\
An algorithm to determine whether such an a exists, given N, and to find it \
if it does.\
\>", "Subtitle"],
Cell[TextData[{
"The Zaremba conjecture says that the partial quotients need never be \
greater than 5. But perhaps for N sufficiently large, even 2 suffices. One \
check to speculation has been that it is hard to tell of an arbitrary given \
N, whether or not there exists an integer a, 1"Italic"],
" notebook uses a method significantly better than naive checking, to \
accelerate the search. The method is far from polynomial time in the digital \
length of N, but its reach significantly exceeds that of direct search. \n"
}], "Subsubtitle"],
Cell["\<\
The basic idea is that there are intervals of values of a that are doomed \
from the outset to failure. Thus, for instance, any a sufficiently near N/2 \
will either give an expansion of a/N of the form 1/(1+1/(l+1/large)), or \
1/(2+1/large)). The algorithm finds all fractions p/q that have all partial \
quotients of 1 or 2 and that have denominators comparable to Sqrt[N]. The \
search may safely be limited to short intervals on either side of these p/q. \
The aggregate length of these intervals is comparable to N^(0.5312805), as is \
the number of p/q which must be considered, so we gain a factor of nearly \
N^(1/2) in speed, compared to the basic strategy of checking all values a, \
1", "Text"],
Cell[BoxData[
\(\(\(backtrackstep[vthing_] :=
Module[{qm, q, v, a}, {qm, q, v} = vthing; \[IndentingNewLine]If[
Length[v] \[Equal] 1, Return[{0, 1, {}}]]; \[IndentingNewLine]a =
v[\([\(-1\)]\)]; {q - a\ qm, qm,
Drop[v, \(-1\)]}]\)\(\[IndentingNewLine]\)
\)\)], "Input"],
Cell["\<\
The next bit of code, nextv, finds the next leaf on the tree, given that \
we're starting at a leaf. The input has two entries, the leaf we're on, and \
the parameter x which gives the upper limit for q. Leaves themselves have \
three entries: the previous q, called qm, for our string of 1s and 2s less \
its last entry, the current q, the denominator of the expansion of v as a \
continued fraction, and the list v itself of 1s and 2s. \
\>", "Text"],
Cell[BoxData[
\(\(\(nextv[vthing_, x_] :=
Module[{vv, a, qm, q, v, r,
t}, \[IndentingNewLine]Print["\",
vthing, "\<,\>", x]; vv = vthing; {qm, q, v} = vv;
a = v[\([\(-1\)]\)];
r = Length[v]; \[IndentingNewLine]If[
a \[Equal] 1 && q + qm \[LessEqual] x,
Return[{qm, q + qm,
Join[Drop[v, \(-1\)], {2}]}]]; \[IndentingNewLine]If[
r \[Equal] 1, Return[False]]; \[IndentingNewLine]v =
Drop[v, \(-1\)]; t = q - a\ qm; q = qm;
qm = t; \[IndentingNewLine]If[Union[v] \[Equal] {2},
Return[False]]; \[IndentingNewLine]a = v[\([\(-1\)]\)];
Print["\<{qm,q,v}=\>", {qm, q, v}]; \[IndentingNewLine]While[
a \[Equal] 2, \[IndentingNewLine]t = q - a\ qm; q = qm; qm = t;
v = Drop[v, \(-1\)]; \[IndentingNewLine]Print["\<{qm,q,v}=\>", {qm,
q, v}]; a = v[\([\(-1\)]\)]]; \[IndentingNewLine]q += qm;
v = Join[Drop[v, \(-1\)], {2}];
Print["\<{qm,q,v}=\>", {qm, q, v}]; \[IndentingNewLine]t =
q + qm; \[IndentingNewLine]While[q + qm \[LessEqual] x, t = q + qm;
qm = q; q = t;
AppendTo[v,
1]; \[IndentingNewLine]Print["\<{qm,q,v}=\>", {qm, q,
v}]]; \[IndentingNewLine]{qm, q, v}]\)\(\[IndentingNewLine]\)
\)\)], "Input"],
Cell[CellGroupData[{
Cell[BoxData[
\(nextv[{19, 27, {2, 1, 2, 2, 1}}, 40]\)], "Input"],
Cell[BoxData[
InterpretationBox[\("{qm,q,v}="\[InvisibleSpace]{8, 19, {2, 1, 2, 2}}\),
SequenceForm[ "{qm,q,v}=", {8, 19, {2, 1, 2, 2}}],
Editable->False]], "Print"],
Cell[BoxData[
InterpretationBox[\("{qm,q,v}="\[InvisibleSpace]{3, 8, {2, 1, 2}}\),
SequenceForm[ "{qm,q,v}=", {3, 8, {2, 1, 2}}],
Editable->False]], "Print"],
Cell[BoxData[
InterpretationBox[\("{qm,q,v}="\[InvisibleSpace]{2, 3, {2, 1}}\),
SequenceForm[ "{qm,q,v}=", {2, 3, {2, 1}}],
Editable->False]], "Print"],
Cell[BoxData[
InterpretationBox[\("{qm,q,v}="\[InvisibleSpace]{2, 5, {2, 2}}\),
SequenceForm[ "{qm,q,v}=", {2, 5, {2, 2}}],
Editable->False]], "Print"],
Cell[BoxData[
InterpretationBox[\("{qm,q,v}="\[InvisibleSpace]{5, 7, {2, 2, 1}}\),
SequenceForm[ "{qm,q,v}=", {5, 7, {2, 2, 1}}],
Editable->False]], "Print"],
Cell[BoxData[
InterpretationBox[\("{qm,q,v}="\[InvisibleSpace]{7, 12, {2, 2, 1, 1}}\),
SequenceForm[ "{qm,q,v}=", {7, 12, {2, 2, 1, 1}}],
Editable->False]], "Print"],
Cell[BoxData[
InterpretationBox[\("{qm,q,v}="\[InvisibleSpace]{12,
19, {2, 2, 1, 1, 1}}\),
SequenceForm[ "{qm,q,v}=", {12, 19, {2, 2, 1, 1, 1}}],
Editable->False]], "Print"],
Cell[BoxData[
InterpretationBox[\("{qm,q,v}="\[InvisibleSpace]{19,
31, {2, 2, 1, 1, 1, 1}}\),
SequenceForm[ "{qm,q,v}=", {19, 31, {2, 2, 1, 1, 1, 1}}],
Editable->False]], "Print"],
Cell[BoxData[
\({19, 31, {2, 2, 1, 1, 1, 1}}\)], "Output"]
}, Open ]],
Cell["\<\
Here is the same code, but with the print commands rendered inoperative.
\
\>", "Text"],
Cell[BoxData[
\(\(\(nextv[vthing_, x_] :=
Module[{vv, a, qm, q, v, r,
t}, \[IndentingNewLine] (*\(Print["\", vthing, "\<,\>", x];\)*) vv = vthing; {qm, q, v} = vv;
a = v[\([\(-1\)]\)];
r = Length[v]; \[IndentingNewLine]If[
a \[Equal] 1 && q + qm \[LessEqual] x,
Return[{qm, q + qm,
Join[Drop[v, \(-1\)], {2}]}]]; \[IndentingNewLine]If[
r \[Equal] 1, Return[False]]; \[IndentingNewLine]v =
Drop[v, \(-1\)]; t = q - a\ qm; q = qm;
qm = t; \[IndentingNewLine]If[Union[v] \[Equal] {2},
Return[False]]; \[IndentingNewLine]a =
v[\([\(-1\)]\)]; (*\(Print["\<{qm,q,v}=\>", {qm, q,
v}];\)*) \[IndentingNewLine]While[
a \[Equal] 2, \[IndentingNewLine]t = q - a\ qm; q = qm; qm = t;
v = Drop[
v, \(-1\)]; \[IndentingNewLine] (*\(Print["\<{qm,q,v}=\>", {qm,
q, v}];\)*) a = v[\([\(-1\)]\)]]; \[IndentingNewLine]q +=
qm; v = Join[
Drop[v, \(-1\)], {2}]; (*\(Print["\<{qm,q,v}=\>", {qm, q,
v}];\)*) \[IndentingNewLine]t =
q + qm; \[IndentingNewLine]While[q + qm \[LessEqual] x, t = q + qm;
qm = q; q = t;
AppendTo[v,
1]\[IndentingNewLine] (*Print["\<{qm,q,v}=\>", {qm, q,
v}]*) ]; \[IndentingNewLine]{qm, q,
v}]\)\(\[IndentingNewLine]\)
\)\)], "Input"],
Cell[BoxData[""], "Input"],
Cell["\<\
The procedure firstvee takes as input x, and returns a string of 1s just long \
enough that the resulting q is less than or equal to x, but appending another \
1 would put q over the line.
\
\>", "Text"],
Cell[BoxData[
\(firstvee[x_] :=
Module[{u, v, w, qm, q}, v = {}; qm = 0; q = 1;
While[q + qm \[LessEqual] x, {qm, q} = {q, q + qm};
AppendTo[v, 1]]; {qm, q, v}]\)], "Input"],
Cell["\<\
vmatrix finds the fractions p/q for v and for the predecessor of v.
\
\>", "Text"],
Cell[BoxData[
\(vmatrix[v_] :=
Module[{m, n, k}, p = 0; q = 1; n = Length[v]; k = 1;
m = {{1, 0}, {0, 1}};
While[k \[LessEqual] n,
m = m . {{0, 1}, {1,
v[\([\(-k\)]\)]}}; \(k++\)]; \[IndentingNewLine]m]\)], \
"Input"],
Cell[CellGroupData[{
Cell[BoxData[
\(alpha = 1/3\)], "Input"],
Cell[BoxData[
\(1\/3\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(beta = 1/\((1 + alpha)\)\)], "Input"],
Cell[BoxData[
\(3\/4\)], "Output"]
}, Open ]],
Cell["\<\
vinterval finds the interval on either side of p/q such that multiplying that \
interval by N and checking the a's in it captures all feasible candidates for \
which the expansion of a/N would kick off with v.
\
\>", "Text"],
Cell[BoxData[
\(vinterval[v_] :=
Module[{r, qm, p, q}, {{r, qm}, {p, q}} =
vmatrix[v]; \[IndentingNewLine]If[
EvenQ[Length[
v]], {\((p + r\ alpha)\)/\((q + qm\ alpha)\), \((p +
r\ beta)\)/\((q + qm\ beta)\)}, {\((p + r\ beta)\)/\((q +
qm\ beta)\), \((p + r\ alpha)\)/\((q +
qm\ alpha)\)}]]\)], "Input"],
Cell["\<\
\"good\" checks whether a candidate \"a\" for a/N really works.
\
\>", "Text"],
Cell[BoxData[
\(good[a_, b_] :=
Module[{p, q, k}, p = a; q = b;
While[p \[NotEqual] 0, k = Floor[q/p];
If[k > 2,
Return[False]]; \[IndentingNewLine]{p, q} = {q - k\ p, p}];
q \[Equal] 1]\)], "Input"],
Cell[BoxData[
\(\(\(zarembacheck[n_] :=
Module[{v, vv, a, b, c, r, s, t}, x = Floor[Sqrt[n]];
vv = firstvee[
x]; (*\(Print["\", vv];\)*) \[IndentingNewLine]While[
ListQ[vv], \[IndentingNewLine]{a, b} =
n\ vinterval[
vv[\([\(-1\)]\)]]; (*\(Print["\<{a,b}=\>", {a, b}];\)*) a =
Ceiling[a];
b = Floor[
b]; (*\(Print["\<{a,b}=\>", {a,
b}];\)*) \[IndentingNewLine]c = a;
While[c \[LessEqual] b,
If[good[c, n],
Return[{c, n, True}]]; \(c++\)]; \[IndentingNewLine]vv =
nextv[vv, x]]; False]\)\(\[IndentingNewLine]\)
\)\)], "Input"],
Cell["\<\
For comparison, we include code that implements the naive approach of trying \
everything. It is, as one might expect, slow when given large inputs. Thus, \
for instance, in the tests executed below, it took longer with the basic \
version to get an answer for N=10^7+1, than it took with the main algorithm \
to get an answer for N=10^12+1.
\
\>", "Text"],
Cell[BoxData[
\(basiczarembacheck[n_] :=
Module[{a = 1},
While[a < n, If[good[a, n], Return[{a, n, True}]]; \(a++\)];
False]\)], "Input"],
Cell[CellGroupData[{
Cell[BoxData[
\(firstvee[10]\)], "Input"],
Cell[BoxData[
\({5, 8, {1, 1, 1, 1, 1}}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(nextv[%, 10]\)], "Input"],
Cell[BoxData[
\({3, 8, {1, 1, 1, 2}}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(nextv[%, 10]\)], "Input"],
Cell[BoxData[
\({5, 7, {1, 1, 2, 1}}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(nextv[%, 10]\)], "Input"],
Cell[BoxData[
\({4, 7, {1, 2, 1, 1}}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(nextv[%, 10]\)], "Input"],
Cell[BoxData[
\({7, 10, {1, 2, 2, 1}}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(nextv[%, 10]\)], "Input"],
Cell[BoxData[
\({5, 8, {2, 1, 1, 1}}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(nextv[%, 10]\)], "Input"],
Cell[BoxData[
\({3, 8, {2, 1, 2}}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(nextv[%, 10]\)], "Input"],
Cell[BoxData[
\({5, 7, {2, 2, 1}}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(nextv[%, 10]\)], "Input"],
Cell[BoxData[
\(False\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(zarembacheck[104]\)], "Input"],
Cell[BoxData[
InterpretationBox[\("vv="\[InvisibleSpace]{5, 8, {1, 1, 1, 1, 1}}\),
SequenceForm[ "vv=", {5, 8, {1, 1, 1, 1, 1}}],
Editable->False]], "Print"],
Cell[BoxData[
InterpretationBox[\("{a,b}="\[InvisibleSpace]{3016\/47, 1872\/29}\),
SequenceForm[ "{a,b}=", {
Rational[ 3016, 47],
Rational[ 1872, 29]}],
Editable->False]], "Print"],
Cell[BoxData[
InterpretationBox[\("{a,b}="\[InvisibleSpace]{65, 64}\),
SequenceForm[ "{a,b}=", {65, 64}],
Editable->False]], "Print"],
Cell[BoxData[
InterpretationBox[\("{a,b}="\[InvisibleSpace]{1768\/27, 2704\/41}\),
SequenceForm[ "{a,b}=", {
Rational[ 1768, 27],
Rational[ 2704, 41]}],
Editable->False]], "Print"],
Cell[BoxData[
InterpretationBox[\("{a,b}="\[InvisibleSpace]{66, 65}\),
SequenceForm[ "{a,b}=", {66, 65}],
Editable->False]], "Print"],
Cell[BoxData[
InterpretationBox[\("{a,b}="\[InvisibleSpace]{60, 2600\/43}\),
SequenceForm[ "{a,b}=", {60,
Rational[ 2600, 43]}],
Editable->False]], "Print"],
Cell[BoxData[
InterpretationBox[\("{a,b}="\[InvisibleSpace]{60, 60}\),
SequenceForm[ "{a,b}=", {60, 60}],
Editable->False]], "Print"],
Cell[BoxData[
InterpretationBox[\("{a,b}="\[InvisibleSpace]{1872\/25, 377\/5}\),
SequenceForm[ "{a,b}=", {
Rational[ 1872, 25],
Rational[ 377, 5]}],
Editable->False]], "Print"],
Cell[BoxData[
InterpretationBox[\("{a,b}="\[InvisibleSpace]{75, 75}\),
SequenceForm[ "{a,b}=", {75, 75}],
Editable->False]], "Print"],
Cell[BoxData[
\({75, 104, True}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(nextv[%, 40]\)], "Input"],
Cell[BoxData[
InterpretationBox[\("{qm,q,v}="\[InvisibleSpace]{13,
21, {1, 1, 1, 1, 1, 1, 1, 1}}\),
SequenceForm[ "{qm,q,v}=", {13, 21, {1, 1, 1, 1, 1, 1, 1, 1}}],
Editable->False]], "Print"],
Cell[BoxData[
InterpretationBox[\("{qm,q,v}="\[InvisibleSpace]{13,
34, {1, 1, 1, 1, 1, 1, 1, 2}}\),
SequenceForm[ "{qm,q,v}=", {13, 34, {1, 1, 1, 1, 1, 1, 1, 2}}],
Editable->False]], "Print"],
Cell[BoxData[
\({13, 34, {1, 1, 1, 1, 1, 1, 1, 2}}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(nextv[%, 40]\)], "Input"],
Cell[BoxData[
InterpretationBox[\("{qm,q,v}="\[InvisibleSpace]{8,
13, {1, 1, 1, 1, 1, 1, 1}}\),
SequenceForm[ "{qm,q,v}=", {8, 13, {1, 1, 1, 1, 1, 1, 1}}],
Editable->False]], "Print"],
Cell[BoxData[
InterpretationBox[\("{qm,q,v}="\[InvisibleSpace]{8,
21, {1, 1, 1, 1, 1, 1, 2}}\),
SequenceForm[ "{qm,q,v}=", {8, 21, {1, 1, 1, 1, 1, 1, 2}}],
Editable->False]], "Print"],
Cell[BoxData[
InterpretationBox[\("{qm,q,v}="\[InvisibleSpace]{21,
29, {1, 1, 1, 1, 1, 1, 2, 1}}\),
SequenceForm[ "{qm,q,v}=", {21, 29, {1, 1, 1, 1, 1, 1, 2, 1}}],
Editable->False]], "Print"],
Cell[BoxData[
\({21, 29, {1, 1, 1, 1, 1, 1, 2, 1}}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(nextv[%, 40]\)], "Input"],
Cell[BoxData[
InterpretationBox[\("{qm,q,v}="\[InvisibleSpace]{8,
21, {1, 1, 1, 1, 1, 1, 2}}\),
SequenceForm[ "{qm,q,v}=", {8, 21, {1, 1, 1, 1, 1, 1, 2}}],
Editable->False]], "Print"],
Cell[BoxData[
InterpretationBox[\("{qm,q,v}="\[InvisibleSpace]{5,
8, {1, 1, 1, 1, 1, 1}}\),
SequenceForm[ "{qm,q,v}=", {5, 8, {1, 1, 1, 1, 1, 1}}],
Editable->False]], "Print"],
Cell[BoxData[
InterpretationBox[\("{qm,q,v}="\[InvisibleSpace]{5,
13, {1, 1, 1, 1, 1, 2}}\),
SequenceForm[ "{qm,q,v}=", {5, 13, {1, 1, 1, 1, 1, 2}}],
Editable->False]], "Print"],
Cell[BoxData[
InterpretationBox[\("{qm,q,v}="\[InvisibleSpace]{13,
18, {1, 1, 1, 1, 1, 2, 1}}\),
SequenceForm[ "{qm,q,v}=", {13, 18, {1, 1, 1, 1, 1, 2, 1}}],
Editable->False]], "Print"],
Cell[BoxData[
InterpretationBox[\("{qm,q,v}="\[InvisibleSpace]{18,
31, {1, 1, 1, 1, 1, 2, 1, 1}}\),
SequenceForm[ "{qm,q,v}=", {18, 31, {1, 1, 1, 1, 1, 2, 1, 1}}],
Editable->False]], "Print"],
Cell[BoxData[
\({18, 31, {1, 1, 1, 1, 1, 2, 1, 1}}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(alpha = 1/\((2 + 1/\((1 + 1/\((2 + 1/\((1 + 1/3)\))\))\))\)\)], "Input"],
Cell[BoxData[
\(15\/41\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(zarembacheck[104]\)], "Input"],
Cell[BoxData[
\(False\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(vmatrix[{1, 2, 3}]\)], "Input"],
Cell[BoxData[
\({{2, 3}, {7, 10}}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(1/\((1 + 1/\((2 + 1/3)\))\)\)], "Input"],
Cell[BoxData[
\(7\/10\)], "Output"]
}, Open ]],
Cell[BoxData[
\(vnorm\)], "Input"],
Cell[CellGroupData[{
Cell[BoxData[
\(vinterval[{2}]\)], "Input"],
Cell[BoxData[
\({56\/153, 41\/97}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(N[%]\)], "Input"],
Cell[BoxData[
\({0.3660130718954248`, 0.422680412371134`}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(vinterval[{1, 2}]\)], "Input"],
Cell[BoxData[
\({97\/138, 153\/209}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(N[%]\)], "Input"],
Cell[BoxData[
\({0.7028985507246377`, 0.7320574162679426`}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(firstvee[10]\)], "Input"],
Cell[BoxData[
\({5, 8, {1, 1, 1, 1, 1, 1}}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(firstvee[10]\)], "Input"],
Cell[BoxData[
\({5, 8, {1, 1, 1, 1, 1, 1}}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(nextv[%, 10]\)], "Input"],
Cell[BoxData[
InterpretationBox[\("nextv has been called on inputs"\[InvisibleSpace]{5,
8, {1, 1, 1, 1, 1, 1}}\[InvisibleSpace]","\[InvisibleSpace]10\),
SequenceForm[
"nextv has been called on inputs", {5, 8, {1, 1, 1, 1, 1, 1}}, ",", 10],
Editable->False]], "Print"],
Cell[BoxData[
InterpretationBox[\("{qm,q,v}="\[InvisibleSpace]{3, 5, {1, 1, 1, 1, 1}}\),
SequenceForm[ "{qm,q,v}=", {3, 5, {1, 1, 1, 1, 1}}],
Editable->False]], "Print"],
Cell[BoxData[
InterpretationBox[\("{qm,q,v}="\[InvisibleSpace]{3, 8, {1, 1, 1, 1, 2}}\),
SequenceForm[ "{qm,q,v}=", {3, 8, {1, 1, 1, 1, 2}}],
Editable->False]], "Print"],
Cell[BoxData[
\({3, 8, {1, 1, 1, 1, 2}}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(good[73, 100]\)], "Input"],
Cell[BoxData[
\(True\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(ContinuedFraction[73/100]\)], "Input"],
Cell[BoxData[
\({0, 1, 2, 1, 2, 2, 1, 2}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(good[7, 11]\)], "Input"],
Cell[BoxData[
\(False\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(good[8, 13]\)], "Input"],
Cell[BoxData[
\(True\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(zarembacheck[104]\)], "Input"],
Cell[BoxData[
\({75, 104, True}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(basiczarembacheck[200]\)], "Input"],
Cell[BoxData[
\(False\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(basiczarembacheck[350]\)], "Input"],
Cell[BoxData[
\(False\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(basiczarembacheck[481]\)], "Input"],
Cell[BoxData[
\(False\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(Table[basiczarembacheck[n], {n, 100, 200}]\)], "Input"],
Cell[BoxData[
\({{73, 100, True}, {71, 101, True}, False,
False, {75, 104, True}, {74, 105, True}, {75, 106, True},
False, {79, 108, True}, {45, 109, True},
False, {41, 111, True}, {41, 112, True}, False,
False, {81, 115, True}, {45, 116, True}, {43, 117, True},
False, {44, 119, True}, False, {46, 121, True}, False, {89, 123, True},
False, False, False, False, {47, 128, True}, {49, 129, True},
False, {50, 131, True}, False, False, False, False, False, False,
False, False, False, False, False, False, {55, 144, True}, False,
False, False, False, False, False,
False, {111, 152, True}, {112, 153, True}, {109, 154, True}, {109, 155,
True}, False, {111, 157, True}, False,
False, {117, 160, True}, {116, 161, True}, False, {119, 163, True},
False, {116, 165, True}, {117, 166, True}, {121, 167, True}, {71, 168,
True}, {70, 169, True},
False, {121, 171, True}, {63, 172, True}, {64, 173, True},
False, {128, 175, True}, {65, 176, True}, {128, 177, True}, {129, 178,
True}, {74, 179, True}, False, {70, 181, True},
False, {67, 183, True},
False, {68, 185, True}, {131, 186, True}, {71, 187, True}, {69, 188,
True}, False,
False, {74, 191, True}, {71, 192, True}, {81, 193, True}, {75, 194,
True}, False, {75, 196, True}, False, False, {144, 199, True},
False}\)], "Output"]
}, Open ]],
Cell[BoxData[
\(\(aa = %;\)\)], "Input"],
Cell[CellGroupData[{
Cell[BoxData[
\(bb = Table[zarembacheck[n], {n, 100, 200}]\)], "Input"],
Cell[BoxData[
\({False, {71, 101, True}, False,
False, {75, 104, True}, {74, 105, True}, False, False,
False, {63, 109, True}, False, {70, 111, True}, {71, 112, True}, False,
False, {81, 115, True}, {67, 116, True}, {74, 117, True},
False, {75, 119, True}, False, {75, 121, True}, False, {89, 123, True},
False, False, False, False, {79, 128, True}, {80, 129, True},
False, {81, 131, True}, False, False, False, False, False, False,
False, False, False, False, False, False, {89, 144, True}, False,
False, False, False, False, False,
False, {111, 152, True}, {112, 153, True}, False, {109, 155, True},
False, False, False, False, {117, 160, True}, False,
False, {119, 163, True},
False, {116, 165, True}, {117, 166, True}, {121, 167, True},
False, {99, 169, True}, False, False, {109, 172, True}, False,
False, {128, 175, True},
False, {128, 177, True}, {129, 178, True}, {104, 179, True},
False, {111, 181, True}, False, {112, 183, True},
False, {117, 185, True}, {131, 186, True}, False, {119, 188, True},
False, False, {117, 191, True},
False, {112, 193, True}, {119, 194, True}, False, {121, 196, True},
False, False, {144, 199, True}, False}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(aa \[Equal] bb\)], "Input"],
Cell[BoxData[
\(False\)], "Output"]
}, Open ]],
Cell[BoxData[
\(k = 1; s = {};
While[k \[LessEqual] 101,
If[aa[\([k]\)] \[NotEqual] bb[\([k]\)],
AppendTo[s, k]]; \(k++\)]\)], "Input"],
Cell[CellGroupData[{
Cell[BoxData[
\(s\)], "Input"],
Cell[BoxData[
\({10, 12, 13, 17, 18, 20, 22, 29, 30, 32, 45, 70, 73, 80, 82, 84, 86,
89, 92, 94, 95, 97}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(aa[\([10]\)]\)], "Input"],
Cell[BoxData[
\({45, 109, True}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(bb[\([10]\)]\)], "Input"],
Cell[BoxData[
\({63, 109, True}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(Map[{aa[\([#]\)], bb[\([#]\)]}, s]\)], "Input"],
Cell[BoxData[
RowBox[{\(Part::"pspec"\), \(\(:\)\(\ \)\), "\<\"Part specification \
\\!\\(#1\\) is neither an integer nor a list of integers. \\!\\(\\*ButtonBox[\
\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\\\", \
ButtonFrame->None, ButtonData:>\\\"General::pspec\\\"]\\)\"\>"}]], "Message"],
Cell[BoxData[
RowBox[{\(Part::"pspec"\), \(\(:\)\(\ \)\), "\<\"Part specification \
\\!\\(#1\\) is neither an integer nor a list of integers. \\!\\(\\*ButtonBox[\
\\\"More\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\\\", \
ButtonFrame->None, ButtonData:>\\\"General::pspec\\\"]\\)\"\>"}]], "Message"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(Length[aa]\)], "Input"],
Cell[BoxData[
\(101\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(Length[bb]\)], "Input"],
Cell[BoxData[
\(101\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(aa[\([5]\)]\)], "Input"],
Cell[BoxData[
\({75, 104, True}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(bb[\([5]\)]\)], "Input"],
Cell[BoxData[
\(False\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(ContinuedFraction[75/104]\)], "Input"],
Cell[BoxData[
\({0, 1, 2, 1, 1, 2, 2, 2}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(zarembacheck[104]\)], "Input"],
Cell[BoxData[
\(False\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(s\)], "Input"],
Cell[BoxData[
\({10, 12, 13, 17, 18, 20, 22, 29, 30, 32, 45, 70, 73, 80, 82, 84, 86,
89, 92, 94, 95, 97}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(Table[{aa[\([s[\([k]\)]]\)], bb[\([s[\([k]\)]]\)]}, {k, 1,
Length[s]}]\)], "Input"],
Cell[BoxData[
\({{{45, 109, True}, {63, 109, True}}, {{41, 111, True}, {70, 111,
True}}, {{41, 112, True}, {71, 112, True}}, {{45, 116, True}, {67,
116, True}}, {{43, 117, True}, {74, 117, True}}, {{44, 119,
True}, {75, 119, True}}, {{46, 121, True}, {75, 121, True}}, {{47,
128, True}, {79, 128, True}}, {{49, 129, True}, {80, 129,
True}}, {{50, 131, True}, {81, 131, True}}, {{55, 144, True}, {89,
144, True}}, {{70, 169, True}, {99, 169, True}}, {{63, 172,
True}, {109, 172, True}}, {{74, 179, True}, {104, 179,
True}}, {{70, 181, True}, {111, 181, True}}, {{67, 183,
True}, {112, 183, True}}, {{68, 185, True}, {117, 185,
True}}, {{69, 188, True}, {119, 188, True}}, {{74, 191,
True}, {117, 191, True}}, {{81, 193, True}, {112, 193,
True}}, {{75, 194, True}, {119, 194, True}}, {{75, 196,
True}, {121, 196, True}}}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(t1 = Table[zarembacheck[n], {n, 1000, 1100}]\)], "Input"],
Cell[BoxData[
\({{703, 1000, True}, {732, 1001, True}, {635, 1002, True},
False, {733, 1004, True}, False, False, False,
False, {727, 1009, True}, False, {637, 1011, True}, False, False,
False, {741, 1015, True}, False, {733, 1017, True},
False, {646, 1019, True}, False, {647, 1021, True}, False, False,
False, {722, 1025, True}, False, {750, 1027, True}, {745, 1028, True},
False, False, {747, 1031, True}, False, False, {601, 1034, True},
False, False, {599, 1037, True}, False, False,
False, {733, 1041, True}, {755, 1042, True}, {606, 1043, True},
False, {613, 1045, True}, False, False, {737, 1048, True},
False, {743, 1050, True}, False, {741, 1052, True}, {646, 1053, True},
False, {647, 1055, True}, False, {670, 1057, True}, {745, 1058, True},
False, False, False, {673, 1062, True}, {670, 1063, True},
False, {671, 1065, True},
False, {755, 1067, True}, {773, 1068, True}, {782, 1069, True}, False,
False, {777, 1072, True}, {658, 1073, True}, False,
False, {787, 1076, True}, {622, 1077, True}, False, {782, 1079, True},
False, False, False, False, {665, 1084, True}, False, False, False,
False, False, {687, 1090, True}, {798, 1091, True}, {787, 1092,
True}, {678, 1093, True}, False,
False, {793, 1096, True}, {795, 1097, True}, {695, 1098, True}, {792,
1099, True}, False}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(Sum[f[t1[\([k]\)]], {k, 1, Length[t1]}]\)], "Input"],
Cell[BoxData[
\(47\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(t2 = Table[zarembacheck[n], {n, 1000000, 1000100}]\)], "Input"],
Cell[BoxData[
\({{723771, 1000000, True}, {720696, 1000001, True}, {723547, 1000002,
True}, {612046, 1000003, True}, False, False,
False, {619871, 1000007, True},
False, {633008, 1000009, True}, {730057, 1000010, True}, {613417,
1000011, True}, False, False, False, False, {723199, 1000016, True},
False, {704299, 1000018, True},
False, {580213, 1000020, True}, {731253, 1000021, True}, {702939,
1000022, True}, {703256, 1000023, True}, {704327, 1000024, True},
False, False, False, {587199, 1000028, True}, {703069, 1000029, True},
False, {620140, 1000031, True}, {612115, 1000032, True}, {704136,
1000033, True}, {612065, 1000034, True}, {630694, 1000035, True},
False, {632887, 1000037, True}, False, False,
False, {587152, 1000041, True}, False, {617934, 1000043, True}, False,
False, False, False, {632453, 1000048, True}, False, False, False,
False, {580232, 1000053, True}, False,
False, {585659, 1000056, True}, {634005, 1000057, True},
False, {585656, 1000059, True},
False, {723590, 1000061, True}, {723827, 1000062, True}, False,
False, {581059, 1000065, True}, False, False,
False, {585691, 1000069, True}, {703063, 1000070, True}, {633047,
1000071, True}, False,
False, {613469, 1000074, True}, {634016, 1000075, True}, {586611,
1000076, True}, {618388, 1000077, True}, False, False,
False, {731514, 1000081, True}, {612433, 1000082, True},
False, {720715, 1000084, True}, False,
False, {632509, 1000087, True}, {634029, 1000088, True}, {619838,
1000089, True}, False, False, False, {620191, 1000093, True}, False,
False, {577581, 1000096, True}, {720756, 1000097, True}, False,
False, {730153, 1000100, True}}\)], "Output"]
}, Open ]],
Cell[BoxData[
\(t2 = Table[zarembacheck[n], {n, 1000000, 1000100}]\)], "Input"],
Cell[CellGroupData[{
Cell[BoxData[
\(Sum[f[t2[\([k]\)]], {k, 1, Length[t1]}]\)], "Input"],
Cell[BoxData[
\(50\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(t3 = Table[zarembacheck[n], {n, 10000000, 10000100}]\)], "Input"],
Cell[BoxData[
\({{6198683, 10000000, True}, {6198727, 10000001, True}, False,
False, {6324229, 10000004, True},
False, {6203079, 10000006, True}, {6124537, 10000007, True}, {7211971,
10000008, True}, {6172328, 10000009, True}, {7071049, 10000010,
True}, False, False, False, {7205167, 10000014, True}, False, False,
False, False, {7071057, 10000019, True}, False,
False, {7048411, 10000022, True}, False,
False, {7041632, 10000025, True}, False, False, False, False, False,
False, False, {7247110, 10000033, True},
False, {7312721, 10000035, True}, False, {6125540, 10000037, True},
False, False, False,
False, {7211989, 10000042, True}, {6132732, 10000043, True},
False, {7211119, 10000045, True}, False, False,
False, {6183042, 10000049, True}, False, {7070272, 10000051, True},
False, {6329965, 10000053, True}, False,
False, {5803279, 10000056, True}, {7075779, 10000057, True}, {7236363,
10000058, True},
False, {6198727, 10000060, True}, {7030477, 10000061, True}, {6179395,
10000062, True}, {6324454, 10000063, True},
False, {7047223, 10000065, True},
False, {7030055, 10000067, True}, {7207715, 10000068, True}, False,
False, False, False, {6134263, 10000073, True}, False,
False, {6324591, 10000076, True}, {7319122, 10000077, True},
False, {5856299, 10000079, True}, {7206661, 10000080, True},
False, {7047983, 10000082, True}, {6125791, 10000083, True}, {6327873,
10000084, True}, {7043216, 10000085, True}, {6328363, 10000086,
True}, False, {7032115, 10000088, True}, {7245775, 10000089,
True}, {6197837, 10000090, True}, {5811480, 10000091, True}, False,
False, {7245465, 10000094, True},
False, {6132517, 10000096, True}, {6172125, 10000097, True}, {6125807,
10000098, True}, False, {7302901, 10000100, True}}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(Sum[f[t3[\([k]\)]], {k, 1, Length[t1]}]\)], "Input"],
Cell[BoxData[
\(50\)], "Output"]
}, Open ]],
Cell[BoxData[
\(t4 = Table[zarembacheck[n], {n, 10000000, 10000100}]\)], "Input"],
Cell[CellGroupData[{
Cell[BoxData[
\(st = {};
Do[tt = Table[zarembacheck[n], {n, 10^r, 10^r + 100}];
AppendTo[st, Sum[f[tt[\([k]\)]], {k, 1, Length[tt]}]];
Print[st], {r, 4, 6}];\)], "Input"],
Cell[BoxData[
\({49}\)], "Print"],
Cell[BoxData[
\({49, 45}\)], "Print"],
Cell[BoxData[
\({49, 45, 50}\)], "Print"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(st = {};
Do[tt = Table[zarembacheck[n], {n, 10^r, 10^r + 100}];
AppendTo[st, Sum[f[tt[\([k]\)]], {k, 1, Length[tt]}]];
Print[st], {r, 4, 12}];\)], "Input"],
Cell[BoxData[
\({49}\)], "Print"],
Cell[BoxData[
\({49, 45}\)], "Print"],
Cell[BoxData[
\({49, 45, 50}\)], "Print"],
Cell[BoxData[
\({49, 45, 50, 50}\)], "Print"],
Cell[BoxData[
\({49, 45, 50, 50, 55}\)], "Print"],
Cell[BoxData[
\({49, 45, 50, 50, 55, 47}\)], "Print"],
Cell[BoxData[
\({49, 45, 50, 50, 55, 47, 65}\)], "Print"],
Cell[BoxData[
\({49, 45, 50, 50, 55, 47, 65, 70}\)], "Print"],
Cell[BoxData[
\({49, 45, 50, 50, 55, 47, 65, 70, 76}\)], "Print"]
}, Open ]],
Cell[BoxData[
\(st >> zarembacheckaugust23.m\)], "Input"],
Cell[CellGroupData[{
Cell[BoxData[
\(tt\)], "Input"],
Cell[BoxData[
\({False, {612586769680, 1000000000001, True}, {721194229337,
1000000000002, True}, {617914897273, 1000000000003, True},
False, {580979574538, 1000000000005, True}, {702923015785,
1000000000006, True}, {730282059258, 1000000000007,
True}, {704154578089, 1000000000008, True}, {618370548761,
1000000000009, True}, {632861320779, 1000000000010,
True}, {613423638844, 1000000000011, True}, {617907477167,
1000000000012, True}, {612093733819, 1000000000013, True},
False, {707104216379, 1000000000015, True}, {723145655487,
1000000000016, True}, {618340389419, 1000000000017,
True}, {731454962671, 1000000000018, True}, {617167054553,
1000000000019, True},
False, {724520199002, 1000000000021, True}, {732008000391,
1000000000022, True}, {632444800571, 1000000000023,
True}, {632514286785, 1000000000024, True}, {613236468947,
1000000000025, True}, {703000799917, 1000000000026,
True}, {720695591787, 1000000000027, True}, {731923379149,
1000000000028, True}, {612586352252, 1000000000029,
True}, {704309777743, 1000000000030, True}, {720683724304,
1000000000031, True}, {612421840103, 1000000000032,
True}, {730242761778, 1000000000033, True}, {704390977205,
1000000000034, True}, {620329561774, 1000000000035, True},
False, {612577896374, 1000000000037, True},
False, {612556724622, 1000000000039, True},
False, {723257643365, 1000000000041, True}, False,
False, {613236347669, 1000000000044, True}, {724745548559,
1000000000045, True}, {617217820533, 1000000000046,
True}, {612586328335, 1000000000047, True},
False, {630668103247, 1000000000049, True}, {724729622029,
1000000000050, True}, {620173162929, 1000000000051,
True}, {617934920461, 1000000000052, True}, {612031039678,
1000000000053, True}, False, False, False,
False, {731900874261, 1000000000058, True}, {632778517328,
1000000000059, True}, {703017975911, 1000000000060, True}, False,
False, {612381218272, 1000000000063, True},
False, {612383634263, 1000000000065, True}, {577628196117,
1000000000066, True}, {619781807624, 1000000000067, True},
False, {612011893887, 1000000000069, True}, {729952426583,
1000000000070, True}, {618073004098, 1000000000071, True},
False, {580332989648, 1000000000073, True}, False, False,
False, {612035025341, 1000000000077, True}, {731905687575,
1000000000078, True}, {617237831275, 1000000000079,
True}, {587199186509, 1000000000080, True}, {617931866241,
1000000000081, True}, {731455697547, 1000000000082,
True}, {618347177533, 1000000000083, True}, {633732225325,
1000000000084, True}, {703051082284, 1000000000085,
True}, {704112011591, 1000000000086, True}, {586719949247,
1000000000087, True},
False, {613410006104, 1000000000089, True}, {724819101127,
1000000000090, True}, {620333869501, 1000000000091,
True}, {723553328395, 1000000000092, True}, {632504832705,
1000000000093, True}, {633739897587, 1000000000094,
True}, {632968580737, 1000000000095, True}, {732007896667,
1000000000096, True}, {707768836528, 1000000000097, True},
False, {618031895412, 1000000000099, True}, False}\)], "Output"]
}, Open ]],
Cell[BoxData[
\(\(\(tt >> zarembacheckdetailsaug23.m\)\(\[IndentingNewLine]\)
\)\)], "Input"],
Cell[CellGroupData[{
Cell[BoxData[
\(\(?zarembacheck\)\)], "Input"],
Cell["Global`zarembacheck", "Print",
CellTags->"Info3333818754-8444689"],
Cell[BoxData[
InterpretationBox[GridBox[{
{GridBox[{
{\(zarembacheck[n_] :=
Module[{v, vv, a, b, c, r, s, t}, x = Floor[\@n];
vv = firstvee[x];
While[ListQ[vv], {a, b} =
n\ vinterval[
vv\[LeftDoubleBracket]\(-1\)\
\[RightDoubleBracket]]; a = Ceiling[a]; b = Floor[b]; c = a;
While[c \[LessEqual] b,
If[good[c, n], Return[{c, n, True}]]; \(c++\)];
vv = nextv[vv, x]]; False]\)}
},
GridBaseline->{Baseline, {1, 1}},
ColumnWidths->0.999,
ColumnAlignments->{Left}]}
},
GridBaseline->{Baseline, {1, 1}},
ColumnAlignments->{Left}],
Definition[ "zarembacheck"],
Editable->False]], "Print",
CellTags->"Info3333818754-8444689"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(zarembacheck[10^13]\)], "Input"],
Cell[BoxData[
\($Aborted\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(Timing[zarembacheck[10^12 + 1]]\)], "Input"],
Cell[BoxData[
\({92.375`\ Second, {612586769680, 1000000000001, True}}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(Timing[zarembacheck[10^13 + 1]]\)], "Input"],
Cell[BoxData[
\({190.59399999999732`\ Second, {6201249927660, 10000000000001,
True}}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(Timing[zarembacheck[10^14 + 1]]\)], "Input"],
Cell[BoxData[
\({1705.9530000000013`\ Second, {63286359507517, 100000000000001,
True}}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(Timing[zarembacheck[10^15 + 1]]\)], "Input"],
Cell[BoxData[
\({11386.311999999998`\ Second, {580301408000518, 1000000000000001,
True}}\)], "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(\(?basiczaremba\)\)], "Input"],
Cell[BoxData[
RowBox[{\(Information::"notfound"\), \(\(:\)\(\ \)\), "\<\"Symbol \
\\!\\(\\\"basiczaremba\\\"\\) not found. \\!\\(\\*ButtonBox[\\\"More\
\[Ellipsis]\\\", ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \
ButtonData:>\\\"General::notfound\\\"]\\)\"\>"}]], "Message"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(\(?basiczarembacheck\)\)], "Input"],
Cell["Global`basiczarembacheck", "Print",
CellTags->"Info3333862480-1151183"],
Cell[BoxData[
InterpretationBox[GridBox[{
{GridBox[{
{\(basiczarembacheck[n_] :=
Module[{a = 1},
While[a < n,
If[good[a, n], Return[{a, n, True}]]; \(a++\)];
False]\)}
},
GridBaseline->{Baseline, {1, 1}},
ColumnWidths->0.999,
ColumnAlignments->{Left}]}
},
GridBaseline->{Baseline, {1, 1}},
ColumnAlignments->{Left}],
Definition[ "basiczarembacheck"],
Editable->False]], "Print",
CellTags->"Info3333862480-1151183"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
\(Timing[basiczarembacheck[10^7 + 1]]\)], "Input"],
Cell[BoxData[
\({138.13999999999942`\ Second, {3801274, 10000001, True}}\)], "Output"]
}, Open ]]
}, Open ]]
},
FrontEndVersion->"5.1 for Microsoft Windows",
ScreenRectangle->{{0, 1024}, {0, 685}},
WindowSize->{495, 527},
WindowMargins->{{233, Automatic}, {61, Automatic}},
ShowSelection->True
]
(*******************************************************************
Cached data follows. If you edit this Notebook file directly, not
using Mathematica, you must remove the line containing CacheID at
the top of the file. The cache data will then be recreated when
you save this file from within Mathematica.
*******************************************************************)
(*CellTagsOutline
CellTagsIndex->{
"Info3333818754-8444689"->{
Cell[39243, 1239, 74, 1, 25, "Print",
CellTags->"Info3333818754-8444689"],
Cell[39320, 1242, 947, 22, 127, "Print",
CellTags->"Info3333818754-8444689"]},
"Info3333862480-1151183"->{
Cell[41723, 1332, 79, 1, 25, "Print",
CellTags->"Info3333862480-1151183"],
Cell[41805, 1335, 634, 17, 44, "Print",
CellTags->"Info3333862480-1151183"]}
}
*)
(*CellTagsIndex
CellTagsIndex->{
{"Info3333818754-8444689", 43295, 1381},
{"Info3333862480-1151183", 43499, 1386}
}
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[1776, 53, 62, 0, 150, "Title"],
Cell[1841, 55, 117, 3, 109, "Subtitle"],
Cell[1961, 60, 661, 11, 231, "Subsubtitle"],
Cell[2625, 73, 1078, 19, 337, "Text"],
Cell[3706, 94, 316, 6, 110, "Input"],
Cell[4025, 102, 463, 8, 147, "Text"],
Cell[4491, 112, 1388, 25, 450, "Input"],
Cell[CellGroupData[{
Cell[5904, 141, 69, 1, 30, "Input"],
Cell[5976, 144, 181, 3, 25, "Print"],
Cell[6160, 149, 173, 3, 25, "Print"],
Cell[6336, 154, 167, 3, 25, "Print"],
Cell[6506, 159, 167, 3, 25, "Print"],
Cell[6676, 164, 173, 3, 25, "Print"],
Cell[6852, 169, 181, 3, 25, "Print"],
Cell[7036, 174, 200, 4, 25, "Print"],
Cell[7239, 180, 206, 4, 25, "Print"],
Cell[7448, 186, 62, 1, 29, "Output"]
}, Open ]],
Cell[7525, 190, 98, 3, 52, "Text"],
Cell[7626, 195, 1493, 29, 450, "Input"],
Cell[9122, 226, 26, 0, 30, "Input"],
Cell[9151, 228, 214, 5, 90, "Text"],
Cell[9368, 235, 204, 4, 70, "Input"],
Cell[9575, 241, 93, 3, 52, "Text"],
Cell[9671, 246, 276, 7, 90, "Input"],
Cell[CellGroupData[{
Cell[9972, 257, 44, 1, 30, "Input"],
Cell[10019, 260, 38, 1, 42, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[10094, 266, 57, 1, 30, "Input"],
Cell[10154, 269, 38, 1, 42, "Output"]
}, Open ]],
Cell[10207, 273, 235, 5, 90, "Text"],
Cell[10445, 280, 405, 8, 150, "Input"],
Cell[10853, 290, 89, 3, 52, "Text"],
Cell[10945, 295, 252, 6, 70, "Input"],
Cell[11200, 303, 717, 16, 230, "Input"],
Cell[11920, 321, 367, 7, 128, "Text"],
Cell[12290, 330, 166, 4, 90, "Input"],
Cell[CellGroupData[{
Cell[12481, 338, 45, 1, 30, "Input"],
Cell[12529, 341, 57, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[12623, 347, 45, 1, 30, "Input"],
Cell[12671, 350, 54, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[12762, 356, 45, 1, 30, "Input"],
Cell[12810, 359, 54, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[12901, 365, 45, 1, 30, "Input"],
Cell[12949, 368, 54, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[13040, 374, 45, 1, 30, "Input"],
Cell[13088, 377, 55, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[13180, 383, 45, 1, 30, "Input"],
Cell[13228, 386, 54, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[13319, 392, 45, 1, 30, "Input"],
Cell[13367, 395, 51, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[13455, 401, 45, 1, 30, "Input"],
Cell[13503, 404, 51, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[13591, 410, 45, 1, 30, "Input"],
Cell[13639, 413, 39, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[13715, 419, 50, 1, 30, "Input"],
Cell[13768, 422, 173, 3, 25, "Print"],
Cell[13944, 427, 213, 5, 38, "Print"],
Cell[14160, 434, 149, 3, 25, "Print"],
Cell[14312, 439, 213, 5, 38, "Print"],
Cell[14528, 446, 149, 3, 25, "Print"],
Cell[14680, 451, 181, 4, 38, "Print"],
Cell[14864, 457, 149, 3, 25, "Print"],
Cell[15016, 462, 209, 5, 38, "Print"],
Cell[15228, 469, 149, 3, 25, "Print"],
Cell[15380, 474, 49, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[15466, 480, 45, 1, 30, "Input"],
Cell[15514, 483, 218, 4, 25, "Print"],
Cell[15735, 489, 218, 4, 25, "Print"],
Cell[15956, 495, 68, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[16061, 501, 45, 1, 30, "Input"],
Cell[16109, 504, 210, 4, 25, "Print"],
Cell[16322, 510, 210, 4, 25, "Print"],
Cell[16535, 516, 218, 4, 25, "Print"],
Cell[16756, 522, 68, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[16861, 528, 45, 1, 30, "Input"],
Cell[16909, 531, 210, 4, 25, "Print"],
Cell[17122, 537, 202, 4, 25, "Print"],
Cell[17327, 543, 204, 4, 25, "Print"],
Cell[17534, 549, 212, 4, 25, "Print"],
Cell[17749, 555, 218, 4, 25, "Print"],
Cell[17970, 561, 68, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[18075, 567, 92, 1, 30, "Input"],
Cell[18170, 570, 40, 1, 42, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[18247, 576, 50, 1, 30, "Input"],
Cell[18300, 579, 39, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[18376, 585, 51, 1, 30, "Input"],
Cell[18430, 588, 51, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[18518, 594, 60, 1, 30, "Input"],
Cell[18581, 597, 39, 1, 42, "Output"]
}, Open ]],
Cell[18635, 601, 38, 1, 30, "Input"],
Cell[CellGroupData[{
Cell[18698, 606, 47, 1, 30, "Input"],
Cell[18748, 609, 51, 1, 42, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[18836, 615, 37, 1, 30, "Input"],
Cell[18876, 618, 75, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[18988, 624, 50, 1, 30, "Input"],
Cell[19041, 627, 53, 1, 42, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[19131, 633, 37, 1, 30, "Input"],
Cell[19171, 636, 76, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[19284, 642, 45, 1, 30, "Input"],
Cell[19332, 645, 60, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[19429, 651, 45, 1, 30, "Input"],
Cell[19477, 654, 60, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[19574, 660, 45, 1, 30, "Input"],
Cell[19622, 663, 308, 6, 44, "Print"],
Cell[19933, 671, 192, 4, 25, "Print"],
Cell[20128, 677, 192, 4, 25, "Print"],
Cell[20323, 683, 57, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[20417, 689, 46, 1, 30, "Input"],
Cell[20466, 692, 38, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[20541, 698, 58, 1, 30, "Input"],
Cell[20602, 701, 58, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[20697, 707, 44, 1, 30, "Input"],
Cell[20744, 710, 39, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[20820, 716, 44, 1, 30, "Input"],
Cell[20867, 719, 38, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[20942, 725, 50, 1, 30, "Input"],
Cell[20995, 728, 49, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[21081, 734, 55, 1, 30, "Input"],
Cell[21139, 737, 39, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[21215, 743, 55, 1, 30, "Input"],
Cell[21273, 746, 39, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[21349, 752, 55, 1, 30, "Input"],
Cell[21407, 755, 39, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[21483, 761, 75, 1, 30, "Input"],
Cell[21561, 764, 1449, 24, 504, "Output"]
}, Open ]],
Cell[23025, 791, 44, 1, 30, "Input"],
Cell[CellGroupData[{
Cell[23094, 796, 75, 1, 30, "Input"],
Cell[23172, 799, 1304, 21, 428, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[24513, 825, 47, 1, 30, "Input"],
Cell[24563, 828, 39, 1, 29, "Output"]
}, Open ]],
Cell[24617, 832, 160, 4, 70, "Input"],
Cell[CellGroupData[{
Cell[24802, 840, 34, 1, 30, "Input"],
Cell[24839, 843, 129, 2, 48, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[25005, 850, 45, 1, 30, "Input"],
Cell[25053, 853, 49, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[25139, 859, 45, 1, 30, "Input"],
Cell[25187, 862, 49, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[25273, 868, 67, 1, 30, "Input"],
Cell[25343, 871, 310, 4, 37, "Message"],
Cell[25656, 877, 310, 4, 37, "Message"]
}, Open ]],
Cell[CellGroupData[{
Cell[26003, 886, 43, 1, 30, "Input"],
Cell[26049, 889, 37, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[26123, 895, 43, 1, 30, "Input"],
Cell[26169, 898, 37, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[26243, 904, 44, 1, 30, "Input"],
Cell[26290, 907, 49, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[26376, 913, 44, 1, 30, "Input"],
Cell[26423, 916, 39, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[26499, 922, 58, 1, 30, "Input"],
Cell[26560, 925, 58, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[26655, 931, 50, 1, 30, "Input"],
Cell[26708, 934, 39, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[26784, 940, 34, 1, 30, "Input"],
Cell[26821, 943, 129, 2, 48, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[26987, 950, 112, 2, 30, "Input"],
Cell[27102, 954, 979, 14, 428, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[28118, 973, 77, 1, 30, "Input"],
Cell[28198, 976, 1456, 22, 523, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[29691, 1003, 72, 1, 30, "Input"],
Cell[29766, 1006, 36, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[29839, 1012, 83, 1, 30, "Input"],
Cell[29925, 1015, 1851, 29, 675, "Output"]
}, Open ]],
Cell[31791, 1047, 83, 1, 30, "Input"],
Cell[CellGroupData[{
Cell[31899, 1052, 72, 1, 30, "Input"],
Cell[31974, 1055, 36, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[32047, 1061, 85, 1, 30, "Input"],
Cell[32135, 1064, 1967, 31, 713, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[34139, 1100, 72, 1, 30, "Input"],
Cell[34214, 1103, 36, 1, 29, "Output"]
}, Open ]],
Cell[34265, 1107, 85, 1, 30, "Input"],
Cell[CellGroupData[{
Cell[34375, 1112, 193, 4, 90, "Input"],
Cell[34571, 1118, 37, 1, 25, "Print"],
Cell[34611, 1121, 41, 1, 25, "Print"],
Cell[34655, 1124, 45, 1, 25, "Print"]
}, Open ]],
Cell[CellGroupData[{
Cell[34737, 1130, 194, 4, 90, "Input"],
Cell[34934, 1136, 37, 1, 25, "Print"],
Cell[34974, 1139, 41, 1, 25, "Print"],
Cell[35018, 1142, 45, 1, 25, "Print"],
Cell[35066, 1145, 49, 1, 25, "Print"],
Cell[35118, 1148, 53, 1, 25, "Print"],
Cell[35174, 1151, 57, 1, 25, "Print"],
Cell[35234, 1154, 61, 1, 25, "Print"],
Cell[35298, 1157, 65, 1, 25, "Print"],
Cell[35366, 1160, 69, 1, 25, "Print"]
}, Open ]],
Cell[35450, 1164, 61, 1, 30, "Input"],
Cell[CellGroupData[{
Cell[35536, 1169, 35, 1, 30, "Input"],
Cell[35574, 1172, 3475, 55, 1454, "Output"]
}, Open ]],
Cell[39064, 1230, 101, 2, 50, "Input"],
Cell[CellGroupData[{
Cell[39190, 1236, 50, 1, 30, "Input"],
Cell[39243, 1239, 74, 1, 25, "Print",
CellTags->"Info3333818754-8444689"],
Cell[39320, 1242, 947, 22, 127, "Print",
CellTags->"Info3333818754-8444689"]
}, Open ]],
Cell[CellGroupData[{
Cell[40304, 1269, 52, 1, 30, "Input"],
Cell[40359, 1272, 42, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[40438, 1278, 64, 1, 30, "Input"],
Cell[40505, 1281, 88, 1, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[40630, 1287, 64, 1, 30, "Input"],
Cell[40697, 1290, 111, 2, 29, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[40845, 1297, 64, 1, 30, "Input"],
Cell[40912, 1300, 113, 2, 48, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[41062, 1307, 64, 1, 30, "Input"],
Cell[41129, 1310, 115, 2, 48, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[41281, 1317, 50, 1, 30, "Input"],
Cell[41334, 1320, 294, 4, 22, "Message"]
}, Open ]],
Cell[CellGroupData[{
Cell[41665, 1329, 55, 1, 30, "Input"],
Cell[41723, 1332, 79, 1, 25, "Print",
CellTags->"Info3333862480-1151183"],
Cell[41805, 1335, 634, 17, 44, "Print",
CellTags->"Info3333862480-1151183"]
}, Open ]],
Cell[CellGroupData[{
Cell[42476, 1357, 68, 1, 30, "Input"],
Cell[42547, 1360, 90, 1, 29, "Output"]
}, Open ]]
}, Open ]]
}
]
*)
(*******************************************************************
End of Mathematica Notebook file.
*******************************************************************)