-
Notifications
You must be signed in to change notification settings - Fork 0
/
pe1.nb
117 lines (106 loc) · 3.77 KB
/
pe1.nb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
(* Content-type: application/vnd.wolfram.mathematica *)
(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)
(* CreatedBy='Mathematica 12.3' *)
(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[ 158, 7]
NotebookDataLength[ 3701, 109]
NotebookOptionsPosition[ 2520, 79]
NotebookOutlinePosition[ 3404, 104]
CellTagsIndexPosition[ 3361, 101]
WindowFrame->Normal*)
(* Beginning of Notebook Content *)
Notebook[{
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"With", "[",
RowBox[{
RowBox[{"{",
RowBox[{"n", "=",
RowBox[{"1000", "-", "1"}]}], "}"}], ",",
RowBox[{
RowBox[{
RowBox[{
RowBox[{"Join", "[",
RowBox[{
RowBox[{"Range", "[",
RowBox[{"3", ",", "n", ",", "3"}], "]"}], ",",
RowBox[{"Range", "[",
RowBox[{"5", ",", "n", ",", "5"}], "]"}]}], "]"}], "//", "Flatten"}],
"//", "DeleteDuplicates"}], "//", "Total"}]}], "]"}]], "Input",
CellChangeTimes->{{3.8462188033269978`*^9, 3.846218891597493*^9}, {
3.8462189238774476`*^9, 3.8462189378821287`*^9}, 3.8462198841542435`*^9},
CellLabel->"In[2]:=",ExpressionUUID->"0697ccb1-a45b-45f8-8738-aa088ca202c5"],
Cell[BoxData["233168"], "Output",
CellChangeTimes->{3.84621960300858*^9, 3.8462198853150687`*^9},
CellLabel->"Out[2]=",ExpressionUUID->"e24cd49e-99e8-43fe-83c4-787549014729"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{
RowBox[{"(*", "\[IndentingNewLine]",
RowBox[{
RowBox[{"with", " ", "exclusive"}], "-",
RowBox[{"inclusive", " ",
RowBox[{"principle", ":"}]}]}], "\[IndentingNewLine]", "*)"}],
"\[IndentingNewLine]",
RowBox[{
RowBox[{"Sum", "[",
RowBox[{"x", ",",
RowBox[{"{",
RowBox[{"x", ",", "0", ",", "999", ",", "3"}], "}"}]}], "]"}], "+",
RowBox[{"Sum", "[",
RowBox[{"x", ",",
RowBox[{"{",
RowBox[{"x", ",", "0", ",", "999", ",", "5"}], "}"}]}], "]"}], "-",
RowBox[{"Sum", "[",
RowBox[{"x", ",",
RowBox[{"{",
RowBox[{"x", ",", "0", ",", "999", ",", "15"}], "}"}]}],
"]"}]}]}]], "Input",
CellChangeTimes->{{3.846220300864189*^9, 3.8462203312499285`*^9}},
CellLabel->"In[15]:=",ExpressionUUID->"5cf22aef-db3b-4c74-abde-f00cb8bc0e1e"],
Cell[BoxData["233168"], "Output",
CellChangeTimes->{3.84622033291444*^9},
CellLabel->"Out[15]=",ExpressionUUID->"aed0faf0-cc9f-4c91-88bc-50cbc250ebc0"]
}, Open ]]
},
WindowSize->{786, 554},
WindowMargins->{{Automatic, 482}, {81, Automatic}},
FrontEndVersion->"12.3 for Microsoft Windows (64-bit) (July 9, 2021)",
StyleDefinitions->Notebook[{
Cell[
StyleData[
StyleDefinitions ->
FrontEnd`FileName[{$RootDirectory, "C:", "Users", "stary", "AppData",
"Roaming", "Mathematica", "SystemFiles", "FrontEnd", "StyleSheets"},
"OD.nb", CharacterEncoding -> "UTF-8"]]]}, WindowSize -> {573, 645},
WindowMargins -> {{Automatic, 240}, {114, Automatic}}, Visible -> False,
FrontEndVersion -> "12.3 for Microsoft Windows (64-bit) (July 9, 2021)",
StyleDefinitions -> "PrivateStylesheetFormatting.nb"],
ExpressionUUID->"25bdad5d-8dc7-43e7-91e4-58c05ee1292e"
]
(* End of Notebook Content *)
(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[580, 22, 710, 18, 70, "Input",ExpressionUUID->"0697ccb1-a45b-45f8-8738-aa088ca202c5"],
Cell[1293, 42, 176, 2, 42, "Output",ExpressionUUID->"e24cd49e-99e8-43fe-83c4-787549014729"]
}, Open ]],
Cell[CellGroupData[{
Cell[1506, 49, 842, 23, 132, "Input",ExpressionUUID->"5cf22aef-db3b-4c74-abde-f00cb8bc0e1e"],
Cell[2351, 74, 153, 2, 67, "Output",ExpressionUUID->"aed0faf0-cc9f-4c91-88bc-50cbc250ebc0"]
}, Open ]]
}
]
*)