{"id":360020,"date":"2024-05-21T00:44:38","date_gmt":"2024-05-21T00:44:38","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=360020"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-21T00:44:38","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=360020","title":{"rendered":"<span>\u0422\u0440\u044e\u043a \u0438\u0437 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0430\u043b\u0433\u0435\u0431\u0440\u044b \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><a href=\"https:\/\/habr.com\/ru\/companies\/ruvds\/articles\/773566\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/5y\/dl\/rm\/5ydlrmdzu9cbbr80mlz0c0c10hc.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/5y\/dl\/rm\/5ydlrmdzu9cbbr80mlz0c0c10hc.jpeg\" data-blurred=\"true\"\/><\/div>\n<p><\/a><br \/>  \u042f \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u0432 \u043e\u043d\u043b\u0430\u0439\u043d-\u0433\u0440\u0443\u043f\u043f\u0435 \u0447\u0442\u0435\u043d\u0438\u044f \u043a\u043d\u0438\u0433\u0438 <a href=\"https:\/\/bookstore.ams.org\/stml-53\">Thirty-three Miniatures: Mathematical and Algorithmic Applications of Linear Algebra<\/a> \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0418\u0440\u0436\u0438 \u041c\u0430\u0442\u0443\u0448\u0435\u043a\u0430. \u042d\u0442\u043e \u0441\u0430\u043c\u0430\u044f \u043d\u0435\u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u043a\u043d\u0438\u0433\u0430 \u043e \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0435, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0442\u044c\u0441\u044f. \u041f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0435 \u0433\u043b\u0430\u0432\u044b \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u044b \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438. \u0422\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439, \u0438\u043b\u0438 \u0438\u0442\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438 (\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0438\u0437\u0443\u0447\u0430\u043b\u0438 \u043d\u0430 \u043a\u0443\u0440\u0441\u0430\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043b\u0438\u043d\u0435\u0435\u043d \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041d\u043e \u0432 \u043a\u043d\u0438\u0433\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0430 \u0438\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u0442\u043e-\u0442\u043e \u0438\u0437 \u0432\u0430\u0441 \u0437\u043d\u0430\u0435\u0442 \u044d\u0442\u0443 \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0443, \u043d\u043e \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043e\u043d\u0430 \u0431\u044b\u043b\u0430 \u043d\u043e\u0432\u043e\u0439, \u0438 \u044f \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u0435\u044e \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f.<a name=\"habracut\"><\/a><\/p>\n<h2><font color=\"#3AC1EF\">\u258d \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0430\u043b\u0433\u0435\u0431\u0440\u044b \u0434\u043b\u044f \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438<\/font><\/h2>\n<p>  \u0422\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438 \u0441 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">table = {} def fib(n):     if n in table:         return table[n]          if n == 0 or n == 1:         result = n     else:         result = fib(n - 1) + fib(n - 2)          table[n] = result     return result<\/code><\/pre>\n<p>  \u042d\u0442\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f n-\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 <code>n - 1<\/code> \u0447\u0438\u0441\u043b\u0430 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441: \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043b\u0443\u0447\u0448\u0435\u0433\u043e?<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f. \u041e\u0434\u043d\u0430 \u0438\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u043e\u0431\u0449\u0451\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c <code>n<\/code>-\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e.<\/p>\n<p>  \u041e\u0434\u043d\u043e \u0438\u0437 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0439: \u043c\u044b \u0437\u043d\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f (0 \u0438 1), \u0442\u0430\u043a \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 <code>n<\/code>-\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438, \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u0442\u043e \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0435\u043c \u0441\u0432\u043e\u0435\u0439 \u0446\u0435\u043b\u0438. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u043e\u0432\u044c\u0451\u043c \u044d\u0442\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435.<\/p>\n<p>  \u0411\u0430\u0437\u043e\u0432\u044b\u0435 \u0441\u043b\u0443\u0447\u0430\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438:<\/p>\n<pre><code class=\"python\">F(0) = 0 F(1) = 1<\/code><\/pre>\n<p>  \u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 F(2) \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e:<\/p>\n<pre><code class=\"python\">F(2) = F(1) + F(0)<\/code><\/pre>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u044c F(1), \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 F(1) \u0438 F(0):<\/p>\n<pre><code class=\"python\">F(1) = 1 * F(1) + 0 * F(0)<\/code><\/pre>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 F(2) \u0438 F(1) \u0432 \u0435\u0434\u0438\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0430\u043b\u0433\u0435\u0431\u0440\u044b:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/566\/c6b\/790\/566c6b790cc06011a19c84fc130184e2.svg\" alt=\"$\\begin{align} \\begin{bmatrix} F(2) \\\\ F(1) \\end{bmatrix} = \\begin{bmatrix} 1 &amp; 1 \\\\ 1 &amp; 0 \\end{bmatrix} \\begin{bmatrix} F(1) \\\\ F(0) \\end{bmatrix} \\\\ \\\\ \u0418\u043b\u0438, \\begin{bmatrix} F(2) \\\\ F(1) \\end{bmatrix} = \\begin{bmatrix} 1 &amp; 1 \\\\ 1 &amp; 0 \\end{bmatrix} \\begin{bmatrix} 1 \\\\ 0 \\end{bmatrix} \\end{align}$\" data-tex=\"display\"\/><\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0434\u043b\u044f <code>F(3)<\/code>:<\/p>\n<pre><code class=\"python\">F(3) = F(2) + F(1) F(2) = F(1) + F(0)<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0432 \u044d\u0442\u043e \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0442\u0440\u0438\u0447\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/181\/a16\/4be\/181a164becdaf203e7120c0998ca60a5.svg\" alt=\"$\\begin{bmatrix} F(3) \\\\ F(2) \\end{bmatrix} = \\begin{bmatrix} 1 &amp; 1 \\\\ 1 &amp; 0 \\end{bmatrix} \\begin{bmatrix} F(2) \\\\ F(1) \\end{bmatrix}$\" data-tex=\"display\"\/><\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u043c\u044b \u0437\u043d\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 <code>[F(2), F(1)]<\/code> \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u044d\u0442\u0430\u043f\u0430; \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u044d\u0442\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u0451\u0442 \u043d\u0430\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/39a\/14b\/cb2\/39a14bcb26977a7095997b4fc07d91ec.svg\" alt=\"$\\begin{bmatrix} F(3) \\\\ F(2) \\end{bmatrix} = \\begin{bmatrix} 1 &amp; 1 \\\\ 1 &amp; 0 \\end{bmatrix} \\begin{bmatrix} 1 &amp; 1 \\\\ 1 &amp; 0 \\end{bmatrix} \\begin{bmatrix} 1 \\\\ 0 \\end{bmatrix}$\" data-tex=\"display\"\/><\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u043c:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3cb\/28e\/04a\/3cb28e04a36e58614f04a77e750cfd26.svg\" alt=\"$\u041e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c\\ \u043c\u0430\u0442\u0440\u0438\u0446\u0443\\ \\begin{bmatrix} 1 &amp; 1 \\\\ 1 &amp; 0 \\end{bmatrix} \u043a\u0430\u043a\\ M$\" data-tex=\"display\"\/><\/p>\n<p>  \u042d\u0442\u043e \u0434\u0430\u0451\u0442 \u043d\u0430\u043c:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7a8\/300\/aa1\/7a8300aa1af89147bec37861fa48bc6a.svg\" alt=\"$\\begin{bmatrix} F(3) \\\\ F(2) \\end{bmatrix} = M^2 \\begin{bmatrix} 1 \\\\ 0 \\end{bmatrix}$\" data-tex=\"display\"\/><\/p>\n<p>  \u041f\u043e\u0445\u043e\u0436\u0435, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u0430\u0442\u0440\u0438\u0446\u044b <code>M<\/code> \u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 <code>F(1)<\/code> \u0438 <code>F(0)<\/code>. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u044d\u0442\u043e\u0442 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0434\u043b\u044f <code>F(4)<\/code><\/p>\n<pre><code class=\"python\">F(4) = F(3) + F(2) F(3) = F(2) + F(1)<\/code><\/pre>\n<p>  \u0421\u043d\u043e\u0432\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0432 \u044d\u0442\u043e \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0442\u0440\u0438\u0447\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u043f\u043e\u043b\u0443\u0447\u0438\u043c:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/88d\/4ba\/730\/88d4ba730921850879158fd86855807c.svg\" alt=\"$\\begin{align} \\begin{bmatrix} F(4) \\\\ F(3) \\end{bmatrix} &amp;= \\begin{bmatrix} 1 &amp; 1 \\\\ 1 &amp; 0 \\end{bmatrix} \\begin{bmatrix} F(3) \\\\ F(2) \\end{bmatrix} \\\\ \\\\ \u0418\u043b\u0438, \\begin{bmatrix} F(4) \\\\ F(3) \\end{bmatrix} &amp;= M \\begin{bmatrix} F(3) \\\\ F(2) \\end{bmatrix} \\end{align}$\" data-tex=\"display\"\/><\/p>\n<p>  \u041f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0435\u043a\u0442\u043e\u0440\u0430 <code>[F(3), F(2)]<\/code> \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/88e\/bfc\/4b9\/88ebfc4b991908a68132a7c6dfcccab7.svg\" alt=\"$\\begin{bmatrix} F(4) \\\\ F(3) \\end{bmatrix} = M . M^2 \\begin{bmatrix} 1 \\\\ 0 \\end{bmatrix}$\" data-tex=\"display\"\/><\/p>\n<p>  \u0427\u0442\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/11d\/4ed\/b24\/11d4edb2409e69592d06af5ef9adb2c0.svg\" alt=\"$\\begin{bmatrix} F(4) \\\\ F(3) \\end{bmatrix} = M^3 \\begin{bmatrix} 1 \\\\ 0 \\end{bmatrix}$\" data-tex=\"display\"\/><\/p>\n<p>  \u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442\u0441\u044f \u0438 \u043e\u0431\u043e\u0431\u0449\u0430\u0435\u0442\u0441\u044f \u0434\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0432\u0438\u0434\u0430:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/007\/e43\/6ea\/007e436ea3fd720e4733e98af754487a.svg\" alt=\"$\\begin{bmatrix} F(n+1) \\\\ F(n) \\end{bmatrix} = M^n \\begin{bmatrix} 1 \\\\ 0 \\end{bmatrix}$\" data-tex=\"display\"\/><\/p>\n<p>  \u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u0435\u0431\u044f, \u0447\u0442\u043e \u044d\u0442\u043e \u0438\u0441\u0442\u0438\u043d\u043d\u043e, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Mathematical_induction\">\u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0438\u043d\u0434\u0443\u043a\u0446\u0438\u0438<\/a>.<\/p>\n<p>  \u041f\u043e\u0445\u043e\u0436\u0435, \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f <code>n<\/code>-\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438 \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 <code>n-1<\/code> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u043e\u043d \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f <code>n<\/code>-\u043d\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u043c\u0430\u0442\u0440\u0438\u0446\u044b <code>M<\/code>. \u041d\u0430\u0438\u0432\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0435\u043f\u0435\u043d\u0435\u0439 \u043b\u0438\u043d\u0435\u0435\u043d \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e <code>n<\/code>, \u0442\u043e \u0435\u0441\u0442\u044c \u044d\u0442\u043e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438 \u0442\u043e\u0436\u0435 \u043b\u0438\u043d\u0435\u0435\u043d \u0438 \u043c\u044b \u0432\u0435\u0440\u043d\u0443\u043b\u0438\u0441\u044c \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443. \u041d\u043e \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0435\u043f\u0435\u043d\u0438, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0445 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c.<\/p>\n<h2><font color=\"#3AC1EF\">\u258d \u0411\u044b\u0441\u0442\u0440\u043e\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0435\u043f\u0435\u043d\u0435\u0439<\/font><\/h2>\n<p>  \u041d\u0430\u0438\u0432\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f <code>n<\/code>-\u043d\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 <code>n<\/code> \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0439, \u0430 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043b\u0438\u043d\u0435\u0435\u043d \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 <code>n<\/code> \u2014 \u044d\u0442\u043e \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0434\u0432\u043e\u0439\u043a\u0438, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c <code>M^n<\/code> \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u044b\u043c \u0432\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u0432 \u043a\u0432\u0430\u0434\u0440\u0430\u0442 <code>M<\/code>, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0437\u0430 \u0432\u0440\u0435\u043c\u044f <code>log2(n)<\/code>.<\/p>\n<p>  \u0412\u043e <em><a href=\"https:\/\/www-cs-faculty.stanford.edu\/~knuth\/taocp.html\">\u0432\u0442\u043e\u0440\u043e\u043c \u0442\u043e\u043c\u0435<\/a><\/em><a href=\"https:\/\/www-cs-faculty.stanford.edu\/~knuth\/taocp.html\"><\/a><a href=\"https:\/\/www-cs-faculty.stanford.edu\/~knuth\/taocp.html\"> <em>\u00ab\u0418\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\u00bb<\/em><\/a> \u0414\u043e\u043d\u0430\u043b\u044c\u0434 \u041a\u043d\u0443\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0449\u0438\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f <code>x^n<\/code>. \u0412 \u044d\u0442\u043e\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e, \u0447\u0442\u043e \u043b\u044e\u0431\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u043d\u0430 \u0441\u0443\u043c\u043c\u044b \u0441\u0442\u0435\u043f\u0435\u043d\u0435\u0439 \u0434\u0432\u043e\u0439\u043a\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 5 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u043a <code>2^2 + 2^0<\/code>, \u0430 9 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u043a <code>2^3 + 2^0<\/code>. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c <code>x^n<\/code> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4b8\/454\/9f1\/4b84549f1d1c2eeda14d63f6be6a6186.svg\" alt=\"$x^n = x^{k_1} * x^{k_2} * x^{k_3}...x^{k_m}$\" data-tex=\"display\"\/><\/p>\n<p>  \u0413\u0434\u0435 <code>k1, k2, \u2026, km<\/code> \u2014 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0434\u0432\u043e\u0439\u043a\u0438, \u0441\u0443\u043c\u043c\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0432\u043d\u0430 <code>n<\/code>.<\/p>\n<p>  \u0425\u043e\u0442\u044f \u044d\u0442\u0430 \u0438\u0434\u0435\u044f \u043f\u0440\u043e\u0441\u0442\u0430, \u0441\u0430\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0447\u0443\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u044f \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e. \u0412\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0434\u0435\u043b\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u043d\u0430 \u0434\u0432\u0430 \u0438 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430. \u0412 \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u0440\u0435\u0434\u0430\u043a\u0446\u0438\u0438 <em>\u00ab\u0418\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\u00bb, \u0442\u043e\u043c\u0435 \u0432\u0442\u043e\u0440\u043e\u043c (\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 462)<\/em> \u0435\u0441\u0442\u044c \u043b\u0438\u0441\u0442\u0438\u043d\u0433 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f <code>x^n<\/code>:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/z1\/ec\/ax\/z1ecaxek595sfkvuqrc2qxcwq8m.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/z1\/ec\/ax\/z1ecaxek595sfkvuqrc2qxcwq8m.jpeg\" data-blurred=\"true\"\/><\/div>\n<p><i><font color=\"#999999\">\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f x^n. \u041e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435, \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 462 \u00ab\u0418\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\u00bb, \u0442\u043e\u043c \u0432\u0442\u043e\u0440\u043e\u0439, \u0442\u0440\u0435\u0442\u044c\u044f \u0440\u0435\u0434\u0430\u043a\u0446\u0438\u044f<\/font><\/i><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u043a\u043e\u0434 \u0432\u043c\u0435\u0441\u0442\u043e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0433\u043e \u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043e\u0434\u0430, \u0442\u043e \u043c\u0435\u0442\u043e\u0434 <a href=\"https:\/\/numpy.org\/doc\/stable\/reference\/generated\/numpy.linalg.matrix_power.html\">linalg.matrix_power<\/a> \u0432 numpy \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c (\u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u043d\u0438\u0436\u0435).<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/ca\/bs\/e7\/cabse775_ypkkdwg865gtlimczk.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/ca\/bs\/e7\/cabse775_ypkkdwg865gtlimczk.jpeg\" data-blurred=\"true\"\/><\/div>\n<p><i><font color=\"#999999\">\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 linalg.matrix_power \u0432 Numpy<\/font><\/i><\/p>\n<p>  \u041a\u0430\u043a\u043e\u0432\u0430 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430? \u0426\u0438\u043a\u043b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 log2(n) \u0448\u0430\u0433\u043e\u0432, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0448\u0430\u0433\u0435 \u043c\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u043c n \u0432\u0434\u0432\u043e\u0435. \u0418 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0448\u0430\u0433\u0435 \u0446\u0438\u043a\u043b\u0430 \u043c\u044b \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u043c <code>Z<\/code> \u043d\u0430 \u0441\u0435\u0431\u044f, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a <code>log2(n)<\/code> \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f\u043c. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0441\u0442\u0430\u0442\u043e\u043a 1, \u0442\u043e \u0442\u0430\u043a\u0436\u0435 \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u043c <code>Z<\/code> \u043d\u0430 <code>Y<\/code>, \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0439. \u0424\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u043e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0439, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0435 \u044d\u0442\u0438\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c, \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u0438\u043c:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/bfb\/dbf\/44a\/bfbdbf44acc1d26bacfce04219c5eb42.svg\" alt=\"$\\lfloor \\log_2(n) \\rfloor + v(n)$\" data-tex=\"display\"\/><\/p>\n<p>  \u0413\u0434\u0435 <code>v(n)<\/code> \u2014 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0438\u0442\u043e\u0432 \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c 1 \u0432 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0435 <code>n<\/code>.<\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u044d\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0448\u0435\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u0430\u044f \u0438\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0430\u044f \u043e\u0442<code>n<\/code> \u2014 \u044d\u0442\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 <code>M^n<\/code>.<\/p>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c. \u041d\u043e \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0440\u0430\u0437\u0434\u043d\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0431\u0435\u0434\u0443, \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0438\u0445 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c. \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u0435\u0440\u0435\u0434 \u044d\u0442\u0438\u043c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438.<\/p>\n<h2><font color=\"#3AC1EF\">\u258d \u0410\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0447\u0438\u0441\u0435\u043b \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438<\/font><\/h2>\n<p>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f n-\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0437\u043e\u043b\u043e\u0442\u043e\u0435 \u0441\u0435\u0447\u0435\u043d\u0438\u0435:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b6e\/7e1\/570\/b6e7e1570b76585cbfd735f4fd392b3e.svg\" alt=\"$F(n) = \\frac{1}{\\sqrt{5}} \\left(\\left(\\frac{1 + \\sqrt{5}}{2}\\right)^n - \\left(\\frac{1 - \\sqrt{5}}{2}\\right)^n\\right)$\" data-tex=\"display\"\/><\/p>\n<p>  \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u044d\u0442\u043e \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u0430, \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u043d\u0430\u044f \u0432 <em>\u00ab\u0418\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\u00bb, \u0442\u043e\u043c \u043f\u0435\u0440\u0432\u044b\u0439 (\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 79)<\/em>. \u0412 \u043a\u043d\u0438\u0433\u0435 <em>Thirty-three Miniatures<\/em> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0435 \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u044d\u0442\u043e\u0439 \u0444\u043e\u0440\u043c\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0430\u043b\u0433\u0435\u0431\u0440\u044b. \u0418\u0437 \u0441\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u043e\u0431\u044a\u0451\u043c\u0430 \u0441\u0442\u0430\u0442\u044c\u0438 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u044d\u0442\u0438 \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0430, \u0435\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0438\u0445 \u0432 \u043a\u043d\u0438\u0433\u0430\u0445. \u042f \u043f\u0440\u043e\u0441\u0442\u043e \u0445\u043e\u0442\u0435\u043b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0443, \u0447\u0442\u043e\u0431\u044b \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u043d\u044b\u0439 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0433\u043e.<\/p>\n<h2><font color=\"#3AC1EF\">\u258d \u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043d\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438<\/font><\/h2>\n<p>  \u0418\u0442\u0430\u043a, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0434\u043b\u044f \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b, \u043d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0438\u0445 \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c. \u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u0438\u0445 \u0442\u0440\u0451\u0445 \u043c\u0435\u0442\u043e\u0434\u0438\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u043d\u0438\u0436\u0435.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/oa\/nv\/4a\/oanv4azgkh9z34cxsmbdbcp1rxe.png\" data-src=\"https:\/\/habrastorage.org\/webt\/oa\/nv\/4a\/oanv4azgkh9z34cxsmbdbcp1rxe.png\"\/><\/div>\n<p><i><font color=\"#999999\">\u0412\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0440\u0451\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438 \u0434\u043b\u044f \u0440\u0430\u0441\u0442\u0443\u0449\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 n<\/font><\/i><\/p>\n<p>  \u0417\u0434\u0435\u0441\u044c:<\/p>\n<ul>\n<li><code>fib(n)<\/code> \u2014 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441 \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c;<\/li>\n<li><code>fib_fast(n)<\/code> \u2014 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u0438\u0437\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u043c\u0438 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435; \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 <code>M^n<\/code>.<\/li>\n<li><code>fib_closed_form(n)<\/code> \u2014 \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u0437\u043e\u043b\u043e\u0442\u043e\u0433\u043e \u0441\u0435\u0447\u0435\u043d\u0438\u044f.<\/li>\n<\/ul>\n<p>  \u042d\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0435\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0441 \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u043c \u0438 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c. \u041f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0441 \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0434\u0440\u0443\u0433\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043a\u0430\u043a \u043f\u043b\u043e\u0441\u043a\u0438\u0435 \u043b\u0438\u043d\u0438\u0438.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0437\u0434\u0435\u0441\u044c \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 <code>fib_fast<\/code> \u0438 <code>fib_closed_form<\/code>. \u041f\u043e \u0441\u0443\u0442\u0438, \u043e\u0431\u0430 \u044d\u0442\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442 <code>n<\/code>-\u043d\u0443\u044e \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u0438\u0445 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e <code>n<\/code> \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0430. \u041e\u0434\u043d\u0430\u043a\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u0437\u043e\u043b\u043e\u0442\u043e\u0433\u043e \u0441\u0435\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 <code>n<\/code>-\u043d\u0443\u044e \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0441\u043a\u0430\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 <code>n<\/code>-\u043d\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u043c\u0430\u0442\u0440\u0438\u0446\u044b <code>2X2<\/code>, \u043e\u0442\u0441\u044e\u0434\u0430 \u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u0432 \u0438\u0445 <em>\u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439<\/em> \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0438\u0440\u0440\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430\u0445 \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u043d\u043e, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0435\u0434\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u044d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 <em>\u043c\u043e\u0436\u0435\u0442<\/em> \u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438\u0437-\u0437\u0430 \u043e\u0448\u0438\u0431\u043e\u043a \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438. \u041c\u0430\u0442\u0440\u0438\u0447\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u043f\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043b\u044e\u0431\u043e\u0433\u043e \u0438\u0437 \u044d\u0442\u0438\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u0440\u0443\u043f\u043d\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b.<\/p>\n<h2><font color=\"#3AC1EF\">\u258d \u041f\u043e\u0434\u0432\u0435\u0434\u0451\u043c \u0438\u0442\u043e\u0433<\/font><\/h2>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043c\u044b \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u043c \u044d\u043a\u0441\u043a\u0443\u0440\u0441\u0438\u044e \u043f\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u043c \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438. \u041a\u043e\u0433\u0434\u0430 \u044f \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u0443\u0432\u0438\u0434\u0435\u043b \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0430\u043b\u0433\u0435\u0431\u0440\u044b \u0434\u043b\u044f \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438, \u043e\u043d\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u043c\u043d\u0435 \u043c\u0430\u0433\u0438\u0435\u0439. \u0410\u0432\u0442\u043e\u0440 \u043a\u043d\u0438\u0433\u0438 <em>Thirty-three Miniatures<\/em> \u0418\u0440\u0436\u0438 \u041c\u0430\u0442\u0443\u0448\u0435\u043a \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442, \u0447\u0442\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u044d\u0442\u043e\u0439 \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0438 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0443\u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a \u043e\u043d \u0431\u044b\u043b \u043e\u0442\u043a\u0440\u044b\u0442. \u042f \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u044f \u0441 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044f\u043c\u0438, \u0432\u044b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b\u0435 \u043f\u043e\u0432\u0435\u0441\u0442\u0438 \u0432\u0430\u0441 \u043f\u043e \u043f\u0443\u0442\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0439 \u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0438\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438. \u042f \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u0432\u0430\u043c \u043b\u0438\u0448\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0438\u0445 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f, \u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0448\u0435. \u0415\u0441\u043b\u0438 \u0443 \u043a\u043e\u0433\u043e-\u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442 \u0431\u043e\u043b\u0435\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f, \u0442\u043e \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u0435\u0441\u044c \u0438\u043c\u0438 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<h2><font color=\"#3AC1EF\">\u258d \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0441\u0442\u0438<\/font><\/h2>\n<p>  \u042f \u0431\u044b \u0445\u043e\u0442\u0435\u043b \u043f\u043e\u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0438\u0442\u044c \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u043e\u0440\u0430 \u041d\u0438\u043b\u0434\u0445\u0430\u0440\u0443 \u041c\u0438\u0441\u0440\u0443 \u0437\u0430 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u043f\u043e \u044d\u0442\u043e\u0439 \u0442\u0435\u043c\u0435 \u0438 \u0437\u0430 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f \u043e \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u0435. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f \u0442\u0435\u043c \u0438\u0437 CS \u0438 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438, \u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0435\u0451 \u0432 <a href=\"https:\/\/twitter.com\/neeldhara\">X\/Twitter<\/a>.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043f\u043e\u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0438\u0442\u044c <a href=\"https:\/\/open.substack.com\/users\/6970039-alejandro-piad-morffis?utm_source=mentions\">\u0410\u043b\u0435\u0445\u0430\u043d\u0434\u0440\u043e \u041f\u0438\u0430\u0434\u0430 \u041c\u043e\u0440\u0444\u0438\u0441\u0430<\/a> \u0437\u0430 \u0432\u044b\u0447\u0438\u0442\u043a\u0443 \u0438 \u043e\u0442\u0437\u044b\u0432\u044b \u043f\u043e \u0441\u0442\u0430\u0442\u044c\u0435. \u041e\u043d \u043f\u0438\u0448\u0435\u0442 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043e computer science \u0432 \u0441\u0432\u043e\u0451\u043c \u0431\u043b\u043e\u0433\u0435 <a href=\"https:\/\/open.substack.com\/pub\/apiad\">Mostly Harmless Ideas<\/a>.<\/p>\n<h2><font color=\"#3AC1EF\">\u258d \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u0438 \u0441\u0441\u044b\u043b\u043a\u0438<\/font><\/h2>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=_CNLV8ngMQghttps:\/\/www.youtube.com\/watch?v=_CNLV8ngMQghttps:\/\/www.youtube.com\/watch?v=_CNLV8ngMQg\">\u0417\u0430\u043f\u0438\u0441\u044c \u0441\u0435\u0441\u0441\u0438\u0438 \u043f\u043e \u043f\u0435\u0440\u0432\u043e\u0439 \u0433\u043b\u0430\u0432\u0435 \u043a\u043d\u0438\u0433\u0438 \u0433\u043b\u0430\u0432\u0435 <em>Thirty-three Miniatures<\/em><\/a><\/li>\n<li><a href=\"https:\/\/github.com\/abhinav-upadhyay\/fast_fibonacci\">\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043d\u0430 Github \u0441 \u043a\u043e\u0434\u043e\u043c<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<blockquote><p><b><font color=\"#3AC1EF\"><a href=\"https:\/\/t.me\/ruvds_community\">\u0423\u0437\u043d\u0430\u0432\u0430\u0439\u0442\u0435 \u043e \u043d\u043e\u0432\u044b\u0445 \u0430\u043a\u0446\u0438\u044f\u0445 \u0438 \u043f\u0440\u043e\u043c\u043e\u043a\u043e\u0434\u0430\u0445 \u043f\u0435\u0440\u0432\u044b\u043c\u0438 \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e Telegram-\u043a\u0430\u043d\u0430\u043b\u0430 ?<\/a><\/font><\/b><\/p><\/blockquote>\n<p><a href=\"http:\/\/ruvds.com\/ru-rub?utm_source=habr&amp;utm_medium=article&amp;utm_campaign=ru_vds&amp;utm_content=tryuk_iz_linejnoj_algebry_dlya_bystrogo_naxozhdeniya_chisel_fibonachchi\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/os\/g2\/ms\/osg2msglmcba81cfkh0vl0nlnu4.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/os\/g2\/ms\/osg2msglmcba81cfkh0vl0nlnu4.jpeg\" data-blurred=\"true\"\/><\/a><\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/773566\/\"> https:\/\/habr.com\/ru\/articles\/773566\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><a href=\"https:\/\/habr.com\/ru\/companies\/ruvds\/articles\/773566\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/5y\/dl\/rm\/5ydlrmdzu9cbbr80mlz0c0c10hc.jpeg\" data-src=\"https:\/\/habrastorage.org\/webt\/5y\/dl\/rm\/5ydlrmdzu9cbbr80mlz0c0c10hc.jpeg\" data-blurred=\"true\"\/><\/div>\n<p><\/a><br \/>  \u042f \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u0432 \u043e\u043d\u043b\u0430\u0439\u043d-\u0433\u0440\u0443\u043f\u043f\u0435 \u0447\u0442\u0435\u043d\u0438\u044f \u043a\u043d\u0438\u0433\u0438 <a href=\"https:\/\/bookstore.ams.org\/stml-53\">Thirty-three Miniatures: Mathematical and Algorithmic Applications of Linear Algebra<\/a> \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0418\u0440\u0436\u0438 \u041c\u0430\u0442\u0443\u0448\u0435\u043a\u0430. \u042d\u0442\u043e \u0441\u0430\u043c\u0430\u044f \u043d\u0435\u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u043a\u043d\u0438\u0433\u0430 \u043e \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0435, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0442\u044c\u0441\u044f. \u041f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0435 \u0433\u043b\u0430\u0432\u044b \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u044b \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438. \u0422\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439, \u0438\u043b\u0438 \u0438\u0442\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u0424\u0438\u0431\u043e\u043d\u0430\u0447\u0447\u0438 (\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0438\u0437\u0443\u0447\u0430\u043b\u0438 \u043d\u0430 \u043a\u0443\u0440\u0441\u0430\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043b\u0438\u043d\u0435\u0435\u043d \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041d\u043e \u0432 \u043a\u043d\u0438\u0433\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0430 \u0438\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u0442\u043e-\u0442\u043e \u0438\u0437 \u0432\u0430\u0441 \u0437\u043d\u0430\u0435\u0442 \u044d\u0442\u0443 \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0443, \u043d\u043e \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043e\u043d\u0430 \u0431\u044b\u043b\u0430 \u043d\u043e\u0432\u043e\u0439, \u0438 \u044f \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u0435\u044e \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-360020","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/360020","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=360020"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/360020\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=360020"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=360020"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=360020"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}