Solved problem 58.
This commit is contained in:
73
ipython/EulerProblem061.ipynb
Normal file
73
ipython/EulerProblem061.ipynb
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Cyclical figurate numbers (Euler Problem 61)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
},
|
||||
"source": [
|
||||
"[https://projecteuler.net/problem=61](https://projecteuler.net/problem=61)\n",
|
||||
"\n",
|
||||
"Triangle, square, pentagonal, hexagonal, heptagonal, and octagonal numbers are all figurate (polygonal) numbers and are generated by the following formulae:\n",
|
||||
"\n",
|
||||
"Triangle\t \tP3,n=n(n+1)/2\t \t1, 3, 6, 10, 15, ...\n",
|
||||
"\n",
|
||||
"Square\t \tP4,n=n2\t \t1, 4, 9, 16, 25, ...\n",
|
||||
"\n",
|
||||
"Pentagonal\t \tP5,n=n(3n−1)/2\t \t1, 5, 12, 22, 35, ...\n",
|
||||
"\n",
|
||||
"Hexagonal\t \tP6,n=n(2n−1)\t \t1, 6, 15, 28, 45, ...\n",
|
||||
"\n",
|
||||
"Heptagonal\t \tP7,n=n(5n−3)/2\t \t1, 7, 18, 34, 55, ...\n",
|
||||
"\n",
|
||||
"Octagonal\t \tP8,n=n(3n−2)\t \t1, 8, 21, 40, 65, ...\n",
|
||||
"\n",
|
||||
"The ordered set of three 4-digit numbers: 8128, 2882, 8281, has three interesting properties.\n",
|
||||
"\n",
|
||||
"The set is cyclic, in that the last two digits of each number is the first two digits of the next number (including the last number with the first).\n",
|
||||
"Each polygonal type: triangle (P3,127=8128), square (P4,91=8281), and pentagonal (P5,44=2882), is represented by a different number in the set.\n",
|
||||
"This is the only set of 4-digit numbers with this property.\n",
|
||||
"Find the sum of the only ordered set of six cyclic 4-digit numbers for which each polygonal type: triangle, square, pentagonal, hexagonal, heptagonal, and octagonal, is represented by a different number in the set."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"completion_date": "",
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"language": "python3.6",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.6.5"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
||||
Reference in New Issue
Block a user