(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 11.1' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] NotebookDataLength[ 7138, 207] NotebookOptionsPosition[ 5403, 155] NotebookOutlinePosition[ 5756, 171] CellTagsIndexPosition[ 5713, 168] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Refactorable Number", "Title",ExpressionUUID->"1cbcbd04-2315-44c3-8544-8da65f5ca8da"], Cell[CellGroupData[{ Cell["Author", "Subsection",ExpressionUUID->"08d48af1-022d-4d58-b2d8-7ddb58eabf44"], Cell["\<\ Eric W. Weisstein December 16, 2005\ \>", "Text",ExpressionUUID->"d91d1bf8-4839-4c7b-b1bc-7f034d405a4c"], Cell[TextData[{ "This notebook downloaded from ", ButtonBox["http://mathworld.wolfram.com/notebooks/IntegerSequences/\ RefactorableNumber.nb", BaseStyle->"Hyperlink", ButtonData:>{ URL["http://mathworld.wolfram.com/notebooks/IntegerSequences/\ RefactorableNumber.nb"], None}], "." }], "Text",ExpressionUUID->"e16e5209-e42f-4898-86e9-d641d6c2545a"], Cell[TextData[{ "For more information, see Eric's ", StyleBox["MathWorld", FontSlant->"Italic"], " entry ", ButtonBox["http://mathworld.wolfram.com/RefactorableNumber.html", BaseStyle->"Hyperlink", ButtonData:>{ URL["http://mathworld.wolfram.com/RefactorableNumber.html"], None}], "." }], "Text",ExpressionUUID->"9e6c2a78-be52-4a57-a350-db2b6335fdd8"], Cell["\<\ \[Copyright]2005 Wolfram Research, Inc. except for portions noted otherwise\ \>", "Text",ExpressionUUID->"dc3a0176-353f-49c5-8692-3a1a2f19a7a7"] }, Open ]], Cell[CellGroupData[{ Cell["Code", "Subsection",ExpressionUUID->"f76d2f40-dad8-4bc2-844b-f9a81bfb1b25"], Cell[BoxData[{ RowBox[{ RowBox[{"RefactorableQ", "[", RowBox[{"n_Integer", "?", "Positive"}], "]"}], ":=", RowBox[{ RowBox[{"Mod", "[", RowBox[{"n", ",", RowBox[{"DivisorSigma", "[", RowBox[{"0", ",", "n"}], "]"}]}], "]"}], "===", "0"}]}], "\[IndentingNewLine]", RowBox[{"SetAttributes", "[", RowBox[{"RefactorableQ", ",", "Listable"}], "]"}]}], "Input", InitializationCell-> True,ExpressionUUID->"9c4dd4fe-7848-43cb-9010-33bc4bdf5853"] }, Open ]], Cell[CellGroupData[{ Cell["Enumeration", "Section",ExpressionUUID->"7b0942ac-4990-4d58-99c6-4a3811111028"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"Take", "[", RowBox[{ RowBox[{"ref", "=", RowBox[{"Select", "[", RowBox[{ RowBox[{"Range", "[", RowBox[{"10", "^", "7"}], "]"}], ",", "RefactorableQ"}], "]"}]}], ",", "100"}], "]"}], "//", "Timing"}]], "Input",ExpressionUUID->"d3ff5b9d-\ b047-403a-b952-7f846796b64a"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"163.57999999999996`", " ", "Second"}], ",", RowBox[{"{", RowBox[{ "1", ",", "2", ",", "8", ",", "9", ",", "12", ",", "18", ",", "24", ",", "36", ",", "40", ",", "56", ",", "60", ",", "72", ",", "80", ",", "84", ",", "88", ",", "96", ",", "104", ",", "108", ",", "128", ",", "132", ",", "136", ",", "152", ",", "156", ",", "180", ",", "184", ",", "204", ",", "225", ",", "228", ",", "232", ",", "240", ",", "248", ",", "252", ",", "276", ",", "288", ",", "296", ",", "328", ",", "344", ",", "348", ",", "360", ",", "372", ",", "376", ",", "384", ",", "396", ",", "424", ",", "441", ",", "444", ",", "448", ",", "450", ",", "468", ",", "472", ",", "480", ",", "488", ",", "492", ",", "504", ",", "516", ",", "536", ",", "560", ",", "564", ",", "568", ",", "584", ",", "600", ",", "612", ",", "625", ",", "632", ",", "636", ",", "640", ",", "664", ",", "672", ",", "684", ",", "708", ",", "712", ",", "720", ",", "732", ",", "776", ",", "792", ",", "804", ",", "808", ",", "824", ",", "828", ",", "852", ",", "856", ",", "864", ",", "872", ",", "876", ",", "880", ",", "882", ",", "896", ",", "904", ",", "936", ",", "948", ",", "972", ",", "996", ",", "1016", ",", "1040", ",", "1044", ",", "1048", ",", "1056", ",", "1068", ",", "1089", ",", "1096"}], "}"}]}], "}"}]], "Output",ExpressionU\ UID->"4cde455a-3ee7-4a8a-b8c1-fcc061326962"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"pairs", "=", RowBox[{"ref", "[", RowBox[{"[", RowBox[{ RowBox[{"Position", "[", RowBox[{ RowBox[{"-", RowBox[{"Subtract", "@@@", RowBox[{"Partition", "[", RowBox[{"ref", ",", "2", ",", "1"}], "]"}]}]}], ",", "1"}], "]"}], "//", "Flatten"}], "]"}], "]"}]}]], "Input",ExpressionUUID->"8e51b44d-c72b-\ 4ae9-a160-c85b4a48e303"], Cell[BoxData[ RowBox[{"{", RowBox[{ "1", ",", "8", ",", "1520", ",", "50624", ",", "62000", ",", "103040", ",", "199808", ",", "221840", ",", "269360", ",", "463760", ",", "690560", ",", "848240", ",", "986048", ",", "1252160", ",", "1418480", ",", "2169728", ",", "2692880", ",", "2792240", ",", "3448448", ",", "3721040", ",", "3932288", ",", "5574320", ",", "5716880", ",", "6066368", ",", "6890624", ",", "6922160", ",", "8485568"}], "}"}]], "Output",ExpressionUUID->\ "0fcef4ce-84db-4ef6-b9c4-d4cb24ed11b3"] }, Open ]] }, Open ]] }, Open ]] }, WindowSize->{774, 616}, WindowMargins->{{55, Automatic}, {Automatic, 16}}, FrontEndVersion->"11.1 for Mac OS X x86 (32-bit, 64-bit Kernel) (June 2, \ 2017)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[580, 22, 91, 0, 92, "Title", "ExpressionUUID" -> \ "1cbcbd04-2315-44c3-8544-8da65f5ca8da"], Cell[CellGroupData[{ Cell[696, 26, 83, 0, 44, "Subsection", "ExpressionUUID" -> \ "08d48af1-022d-4d58-b2d8-7ddb58eabf44"], Cell[782, 28, 114, 3, 49, "Text", "ExpressionUUID" -> \ "d91d1bf8-4839-4c7b-b1bc-7f034d405a4c"], Cell[899, 33, 358, 9, 49, "Text", "ExpressionUUID" -> \ "e16e5209-e42f-4898-86e9-d641d6c2545a"], Cell[1260, 44, 366, 10, 49, "Text", "ExpressionUUID" -> \ "9e6c2a78-be52-4a57-a350-db2b6335fdd8"], Cell[1629, 56, 154, 2, 30, "Text", "ExpressionUUID" -> \ "dc3a0176-353f-49c5-8692-3a1a2f19a7a7"] }, Open ]], Cell[CellGroupData[{ Cell[1820, 63, 81, 0, 44, "Subsection", "ExpressionUUID" -> \ "f76d2f40-dad8-4bc2-844b-f9a81bfb1b25"], Cell[1904, 65, 479, 13, 70, "Input", "ExpressionUUID" -> \ "9c4dd4fe-7848-43cb-9010-33bc4bdf5853", InitializationCell->True] }, Open ]], Cell[CellGroupData[{ Cell[2420, 83, 85, 0, 64, "Section", "ExpressionUUID" -> \ "7b0942ac-4990-4d58-99c6-4a3811111028"], Cell[CellGroupData[{ Cell[2530, 87, 343, 10, 32, "Input", "ExpressionUUID" -> \ "d3ff5b9d-b047-403a-b952-7f846796b64a"], Cell[2876, 99, 1495, 23, 138, "Output", "ExpressionUUID" -> \ "4cde455a-3ee7-4a8a-b8c1-fcc061326962"] }, Open ]], Cell[CellGroupData[{ Cell[4408, 127, 414, 12, 32, "Input", "ExpressionUUID" -> \ "8e51b44d-c72b-4ae9-a160-c85b4a48e303"], Cell[4825, 141, 538, 9, 75, "Output", "ExpressionUUID" -> \ "0fcef4ce-84db-4ef6-b9c4-d4cb24ed11b3"] }, Open ]] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)