(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 13.1' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] NotebookDataLength[ 18145, 548] NotebookOptionsPosition[ 12552, 405] NotebookOutlinePosition[ 15915, 494] CellTagsIndexPosition[ 15838, 489] WindowTitle->PalindromicSubsequences | Example Notebook WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[{ "Basic Examples", "\[NonBreakingSpace]", Cell["(1)", "ExampleCount"], "\[NonBreakingSpace]" }], "Subsection", TaggingRules->{}, CellTags->"DefaultContent", CellID->619504543], Cell["Find palindromic subsequences:", "Text", TaggingRules->{}, CellChangeTimes->{{3.8685539459214773`*^9, 3.8685539526118517`*^9}}, CellTags->"DefaultContent", CellID->586099280], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ InterpretationBox[ TagBox[ FrameBox[ PaneBox[GridBox[{ { StyleBox[ StyleBox[ AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>", BoxBaselineShift->-0.25, BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon", FontColor->RGBColor[ 0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], ShowStringCharacters->False, FontFamily->"Source Sans Pro Black", FontSize->0.65 Inherited, FontWeight->"Heavy", PrivateFontOptions->{"OperatorSubstitution"->False}], StyleBox[ RowBox[{ StyleBox["\<\"PalindromicSubsequences\"\>", "ResourceFunctionLabel"], " "}], ShowAutoStyles->False, ShowStringCharacters->False, FontSize->0.9 Inherited, FontColor->GrayLevel[0.1]]} }, GridBoxSpacings->{"Columns" -> {{0.25}}}], Alignment->Left, BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False}, BaselinePosition->Baseline, FrameMargins->{{3, 0}, {0, 0}}], Background->RGBColor[0.968627, 0.976471, 0.984314], BaselinePosition->Baseline, DefaultBaseStyle->{}, FrameMargins->{{0, 0}, {1, 1}}, FrameStyle->RGBColor[0.831373, 0.847059, 0.85098], RoundingRadius->4], {"FunctionResourceBox", RGBColor[0.8745098039215686, 0.2784313725490196, 0.03137254901960784], "PalindromicSubsequences"}, TagBoxNote->"FunctionResourceBox"], ResourceFunction["PalindromicSubsequences"], BoxID -> "PalindromicSubsequences", Selectable->False], "[", RowBox[{"{", RowBox[{ "12", ",", "13", ",", "11", ",", "13", ",", "10", ",", "8", ",", "3", ",", "9", ",", "3", ",", "8", ",", "12", ",", "11", ",", "10", ",", "7", ",", "7", ",", "10", ",", "5", ",", "5", ",", "1", ",", "27"}], "}"}], "]"}]], "Input", TaggingRules->{}, CellChangeTimes->{{3.8685539204399433`*^9, 3.868553932373311*^9}}, CellTags->"DefaultContent", CellLabel->"In[70]:=", CellID->298664010], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"10", ",", "7", ",", "7", ",", "10"}], "}"}], ",", RowBox[{"{", RowBox[{"5", ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"13", ",", "11", ",", "13"}], "}"}], ",", RowBox[{"{", RowBox[{"8", ",", "3", ",", "9", ",", "3", ",", "8"}], "}"}]}], "}"}]], "Output", TaggingRules->{}, CellChangeTimes->{{3.868553926878605*^9, 3.868553932863494*^9}}, CellTags->"DefaultContent", CellLabel->"Out[70]=", CellID->946393722] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ "Scope", "\[NonBreakingSpace]", Cell["(3)", "ExampleCount"], "\[NonBreakingSpace]" }], "Subsection", TaggingRules->{}, CellTags->"DefaultContent", CellID->313242344], Cell["Include single-element palindromes:", "Text", TaggingRules->{}, CellChangeTimes->{{3.868554067887279*^9, 3.868554097303885*^9}}, CellTags->"DefaultContent", CellID->291939446], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ InterpretationBox[ TagBox[ FrameBox[ PaneBox[GridBox[{ { StyleBox[ StyleBox[ AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>", BoxBaselineShift->-0.25, BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon", FontColor->RGBColor[ 0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], ShowStringCharacters->False, FontFamily->"Source Sans Pro Black", FontSize->0.65 Inherited, FontWeight->"Heavy", PrivateFontOptions->{"OperatorSubstitution"->False}], StyleBox[ RowBox[{ StyleBox["\<\"PalindromicSubsequences\"\>", "ResourceFunctionLabel"], " "}], ShowAutoStyles->False, ShowStringCharacters->False, FontSize->0.9 Inherited, FontColor->GrayLevel[0.1]]} }, GridBoxSpacings->{"Columns" -> {{0.25}}}], Alignment->Left, BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False}, BaselinePosition->Baseline, FrameMargins->{{3, 0}, {0, 0}}], Background->RGBColor[0.968627, 0.976471, 0.984314], BaselinePosition->Baseline, DefaultBaseStyle->{}, FrameMargins->{{0, 0}, {1, 1}}, FrameStyle->RGBColor[0.831373, 0.847059, 0.85098], RoundingRadius->4], {"FunctionResourceBox", RGBColor[0.8745098039215686, 0.2784313725490196, 0.03137254901960784], "PalindromicSubsequences"}, TagBoxNote->"FunctionResourceBox"], ResourceFunction["PalindromicSubsequences"], BoxID -> "PalindromicSubsequences", Selectable->False], "[", RowBox[{ RowBox[{"{", RowBox[{ "12", ",", "11", ",", "13", ",", "10", ",", "8", ",", "3", ",", "9", ",", "3", ",", "8", ",", "13"}], "}"}], ",", "1"}], "]"}]], "Input", TaggingRules->{}, CellChangeTimes->{{3.868554047273389*^9, 3.868554079312756*^9}}, CellTags->"DefaultContent", CellLabel->"In[73]:=", CellID->448965068], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", "12", "}"}], ",", RowBox[{"{", "11", "}"}], ",", RowBox[{"{", "13", "}"}], ",", RowBox[{"{", "10", "}"}], ",", RowBox[{"{", "8", "}"}], ",", RowBox[{"{", "3", "}"}], ",", RowBox[{"{", RowBox[{"8", ",", "3", ",", "9", ",", "3", ",", "8"}], "}"}], ",", RowBox[{"{", "3", "}"}], ",", RowBox[{"{", "8", "}"}], ",", RowBox[{"{", "13", "}"}]}], "}"}]], "Output", TaggingRules->{}, CellChangeTimes->{{3.868554053316629*^9, 3.868554079613902*^9}}, CellTags->"DefaultContent", CellLabel->"Out[73]=", CellID->45165534] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ InterpretationBox[Cell["\t", "ExampleDelimiter"], $Line = 0; Null]], "ExampleDelimiter", TaggingRules->{}, CellID->392249707], Cell["The elements can be anything:", "Text", TaggingRules->{}, CellChangeTimes->{{3.868554067887279*^9, 3.868554097303885*^9}, { 3.868554148498489*^9, 3.8685541552306423`*^9}}, CellTags->"DefaultContent", CellID->1828280090], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ InterpretationBox[ TagBox[ FrameBox[ PaneBox[GridBox[{ { StyleBox[ StyleBox[ AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>", BoxBaselineShift->-0.25, BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon", FontColor->RGBColor[ 0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], ShowStringCharacters->False, FontFamily->"Source Sans Pro Black", FontSize->0.65 Inherited, FontWeight->"Heavy", PrivateFontOptions->{"OperatorSubstitution"->False}], StyleBox[ RowBox[{ StyleBox["\<\"PalindromicSubsequences\"\>", "ResourceFunctionLabel"], " "}], ShowAutoStyles->False, ShowStringCharacters->False, FontSize->0.9 Inherited, FontColor->GrayLevel[0.1]]} }, GridBoxSpacings->{"Columns" -> {{0.25}}}], Alignment->Left, BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False}, BaselinePosition->Baseline, FrameMargins->{{3, 0}, {0, 0}}], Background->RGBColor[0.968627, 0.976471, 0.984314], BaselinePosition->Baseline, DefaultBaseStyle->{}, FrameMargins->{{0, 0}, {1, 1}}, FrameStyle->RGBColor[0.831373, 0.847059, 0.85098], RoundingRadius->4], {"FunctionResourceBox", RGBColor[0.8745098039215686, 0.2784313725490196, 0.03137254901960784], "PalindromicSubsequences"}, TagBoxNote->"FunctionResourceBox"], ResourceFunction["PalindromicSubsequences"], BoxID -> "PalindromicSubsequences", Selectable->False], "[", RowBox[{"{", RowBox[{ TemplateBox[<|"color" -> RGBColor[1, 0, 0]|>, "RGBColorSwatchTemplate"], ",", "\"\\"", ",", "3", ",", "x", ",", "3", ",", "\"\\"", ",", "13", ",", "2"}], "}"}], "]"}]], "Input", TaggingRules->{}, CellChangeTimes->{{3.868554113405315*^9, 3.868554133644911*^9}, { 3.8685541888530188`*^9, 3.868554193233034*^9}}, CellLabel->"In[77]:=", CellID->1234188272], Cell[BoxData[ RowBox[{"{", RowBox[{"{", RowBox[{"\<\"a\"\>", ",", "3", ",", "x", ",", "3", ",", "\<\"a\"\>"}], "}"}], "}"}]], "Output", TaggingRules->{}, CellChangeTimes->{{3.868554119408463*^9, 3.868554134737894*^9}, 3.868554193980288*^9}, CellLabel->"Out[77]=", CellID->896685870] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ InterpretationBox[Cell["\t", "ExampleDelimiter"], $Line = 0; Null]], "ExampleDelimiter", TaggingRules->{}, CellID->73394216], Cell["\<\ Find palindromic subsequences in the largest 2-digit 19-smooth number:\ \>", "Text", TaggingRules->{}, CellChangeTimes->{{3.8689808743404665`*^9, 3.8689809211897*^9}}, CellID->414925187], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ InterpretationBox[ TagBox[ FrameBox[ PaneBox[GridBox[{ { StyleBox[ StyleBox[ AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>", BoxBaselineShift->-0.25, BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon", FontColor->RGBColor[ 0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], ShowStringCharacters->False, FontFamily->"Source Sans Pro Black", FontSize->0.65 Inherited, FontWeight->"Heavy", PrivateFontOptions->{"OperatorSubstitution"->False}], StyleBox[ RowBox[{ StyleBox["\<\"PalindromicSubsequences\"\>", "ResourceFunctionLabel"], " "}], ShowAutoStyles->False, ShowStringCharacters->False, FontSize->0.9 Inherited, FontColor->GrayLevel[0.1]]} }, GridBoxSpacings->{"Columns" -> {{0.25}}}], Alignment->Left, BaseStyle->{LineSpacing -> {0, 0}, LineBreakWithin -> False}, BaselinePosition->Baseline, FrameMargins->{{3, 0}, {0, 0}}], Background->RGBColor[0.968627, 0.976471, 0.984314], BaselinePosition->Baseline, DefaultBaseStyle->{}, FrameMargins->{{0, 0}, {1, 1}}, FrameStyle->RGBColor[0.831373, 0.847059, 0.85098], RoundingRadius->4], {"FunctionResourceBox", RGBColor[0.8745098039215686, 0.2784313725490196, 0.03137254901960784], "PalindromicSubsequences"}, TagBoxNote->"FunctionResourceBox"], ResourceFunction["PalindromicSubsequences"], BoxID -> "PalindromicSubsequences", Selectable->False], "[", RowBox[{"IntegerDigits", "[", RowBox[{"17", " ", RowBox[{"19", "^", "6"}]}], "]"}], "]"}]], "Input", TaggingRules->{}, CellChangeTimes->{{3.868980852582651*^9, 3.8689808587107754`*^9}}, CellLabel->"In[4]:=", CellID->801530022], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"7", ",", "9", ",", "9", ",", "7"}], "}"}], ",", RowBox[{"{", RowBox[{ "7", ",", "9", ",", "9", ",", "7", ",", "7", ",", "9", ",", "9", ",", "7"}], "}"}], ",", RowBox[{"{", RowBox[{"7", ",", "7", ",", "9", ",", "9", ",", "7", ",", "7"}], "}"}], ",", RowBox[{"{", RowBox[{"7", ",", "7"}], "}"}]}], "}"}]], "Output", TaggingRules->{}, CellContext->"Cell$$18531`", CellLabel->"Out[4]=", CellID->9794272] }, Open ]] }, Open ]] }, Closed]] }, WindowSize->Automatic, WindowMargins->Automatic, WindowTitle->"PalindromicSubsequences | Example Notebook", TaggingRules->{ "Metadata" -> { "ResourceType" -> "Function", "Name" -> "PalindromicSubsequences", "Property" -> "ExampleNotebook"}}, FrontEndVersion->"13.1 for Linux x86 (64-bit) (June 16, 2022)", StyleDefinitions->Notebook[{ Cell[ CellGroupData[{ Cell[ StyleData[ StyleDefinitions -> FrontEnd`FileName[{"Wolfram"}, "Reference.nb", CharacterEncoding -> "UTF-8"]]], Cell[ StyleData[All, "Working"], Editable -> True, DockedCells -> {}]}, Open]], Cell[ StyleData["Notebook"], Editable -> True, DockedCells -> {}, ScrollingOptions -> {"VerticalScrollRange" -> Automatic}], Cell[ StyleData[ "Section", StyleDefinitions -> StyleData["PrimaryExamplesSection"]], Editable -> True, ShowGroupOpener -> "Inline", WholeCellGroupOpener -> True], Cell[ StyleData["Subsection", StyleDefinitions -> StyleData["ExampleSection"]], Editable -> True, ShowGroupOpener -> "Inline", WholeCellGroupOpener -> True], Cell[ StyleData[ "Subsubsection", StyleDefinitions -> StyleData["ExampleSubsection"]], Editable -> True, ShowGroupOpener -> "Inline", WholeCellGroupOpener -> True], Cell[ StyleData[ "Subsubsubsection", StyleDefinitions -> StyleData["ExampleSubsubsection"]], Editable -> True, ShowGroupOpener -> "Inline", WholeCellGroupOpener -> True], Cell[ StyleData["Text", StyleDefinitions -> StyleData["ExampleText"]], Editable -> True]}, Visible -> False, FrontEndVersion -> "13.1 for Linux x86 (64-bit) (June 16, 2022)", StyleDefinitions -> "PrivateStylesheetFormatting.nb"], $CellContext`ClosingSaveDialog -> False ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{ "DefaultContent"->{ Cell[636, 23, 197, 8, 70, "Subsection",ExpressionUUID->"0c18e9eb-e7ed-43eb-9ea6-c4c9e402cd83", CellTags->"DefaultContent", CellID->619504543], Cell[836, 33, 184, 4, 70, "Text",ExpressionUUID->"2c9e1338-8fa6-4e49-bbb5-b7dc9b8ac532", CellTags->"DefaultContent", CellID->586099280], Cell[1045, 41, 2128, 58, 70, "Input",ExpressionUUID->"51d98fae-1a31-4e10-9086-0118953ee6c9", CellTags->"DefaultContent", CellID->298664010], Cell[3176, 101, 515, 16, 70, "Output",ExpressionUUID->"c570aaa8-0539-4828-a22d-85e4a9f46f80", CellTags->"DefaultContent", CellID->946393722], Cell[3740, 123, 188, 8, 70, "Subsection",ExpressionUUID->"06a5c8d0-8063-4dfe-beac-96eaceba79a5", CellTags->"DefaultContent", CellID->313242344], Cell[3931, 133, 185, 4, 70, "Text",ExpressionUUID->"8f25f74a-691b-424f-b5e9-e621166e5190", CellTags->"DefaultContent", CellID->291939446], Cell[4141, 141, 2040, 57, 70, "Input",ExpressionUUID->"c7b726cb-67b7-4671-9418-0a3a1d697000", CellTags->"DefaultContent", CellID->448965068], Cell[6184, 200, 610, 18, 70, "Output",ExpressionUUID->"01ba0258-bbd8-4539-82cd-b230e4e35caf", CellTags->"DefaultContent", CellID->45165534], Cell[6978, 229, 231, 5, 70, "Text",ExpressionUUID->"770ed61a-e511-4519-8c9c-2c87bbd4a831", CellTags->"DefaultContent", CellID->1828280090]} } *) (*CellTagsIndex CellTagsIndex->{ {"DefaultContent", 14472, 458} } *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[636, 23, 197, 8, 70, "Subsection",ExpressionUUID->"0c18e9eb-e7ed-43eb-9ea6-c4c9e402cd83", CellTags->"DefaultContent", CellID->619504543], Cell[836, 33, 184, 4, 70, "Text",ExpressionUUID->"2c9e1338-8fa6-4e49-bbb5-b7dc9b8ac532", CellTags->"DefaultContent", CellID->586099280], Cell[CellGroupData[{ Cell[1045, 41, 2128, 58, 70, "Input",ExpressionUUID->"51d98fae-1a31-4e10-9086-0118953ee6c9", CellTags->"DefaultContent", CellID->298664010], Cell[3176, 101, 515, 16, 70, "Output",ExpressionUUID->"c570aaa8-0539-4828-a22d-85e4a9f46f80", CellTags->"DefaultContent", CellID->946393722] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[3740, 123, 188, 8, 70, "Subsection",ExpressionUUID->"06a5c8d0-8063-4dfe-beac-96eaceba79a5", CellTags->"DefaultContent", CellID->313242344], Cell[3931, 133, 185, 4, 70, "Text",ExpressionUUID->"8f25f74a-691b-424f-b5e9-e621166e5190", CellTags->"DefaultContent", CellID->291939446], Cell[CellGroupData[{ Cell[4141, 141, 2040, 57, 70, "Input",ExpressionUUID->"c7b726cb-67b7-4671-9418-0a3a1d697000", CellTags->"DefaultContent", CellID->448965068], Cell[6184, 200, 610, 18, 70, "Output",ExpressionUUID->"01ba0258-bbd8-4539-82cd-b230e4e35caf", CellTags->"DefaultContent", CellID->45165534] }, Open ]], Cell[CellGroupData[{ Cell[6831, 223, 144, 4, 70, "ExampleDelimiter",ExpressionUUID->"0b4c3159-023d-45f9-a366-d253545c0b7c", CellID->392249707], Cell[6978, 229, 231, 5, 70, "Text",ExpressionUUID->"770ed61a-e511-4519-8c9c-2c87bbd4a831", CellTags->"DefaultContent", CellID->1828280090], Cell[CellGroupData[{ Cell[7234, 238, 2102, 57, 70, "Input",ExpressionUUID->"ba8d0fa4-857f-4211-af06-bef5ddd411b8", CellID->1234188272], Cell[9339, 297, 302, 9, 70, "Output",ExpressionUUID->"62840d25-4e81-4a53-ad86-f5c797308198", CellID->896685870] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[9690, 312, 143, 4, 70, "ExampleDelimiter",ExpressionUUID->"ea96faa9-f4df-440b-aac6-3271f0bb1ac8", CellID->73394216], Cell[9836, 318, 199, 5, 70, "Text",ExpressionUUID->"8a68be77-7cd1-4b4b-86b0-ffef7f5c5e49", CellID->414925187], Cell[CellGroupData[{ Cell[10060, 327, 1935, 54, 70, "Input",ExpressionUUID->"1a760304-645c-4925-9ad4-cee7735cd1b0", CellID->801530022], Cell[11998, 383, 514, 17, 70, "Output",ExpressionUUID->"5a59b791-c0f8-48bc-b2a3-3e60a92d3178", CellID->9794272] }, Open ]] }, Open ]] }, Closed]] } ] *) (* End of internal cache information *)