Ruff in pre-commit
This commit is contained in:
@@ -1,20 +1,31 @@
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.4.0
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v5.0.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
- id: check-yaml
|
||||
- id: check-added-large-files
|
||||
- repo: https://github.com/PyCQA/flake8
|
||||
rev: 6.0.0
|
||||
- id: check-added-large-files
|
||||
- id: check-yaml
|
||||
- id: end-of-file-fixer
|
||||
- id: trailing-whitespace
|
||||
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: flake8
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 23.1.0
|
||||
hooks:
|
||||
- id: black
|
||||
- repo: https://github.com/PyCQA/isort
|
||||
rev: 5.12.0
|
||||
hooks:
|
||||
- id: isort
|
||||
- id: ruff-check
|
||||
name: ruff check
|
||||
entry: uv run ruff check --fix
|
||||
language: system
|
||||
types_or: [python, pyi]
|
||||
require_serial: true
|
||||
|
||||
- id: ruff-format
|
||||
name: ruff format
|
||||
entry: uv run ruff format
|
||||
language: system
|
||||
types_or: [python, pyi]
|
||||
require_serial: true
|
||||
|
||||
- id: mypy
|
||||
name: mypy
|
||||
entry: uv run mypy src
|
||||
language: system
|
||||
pass_filenames: false
|
||||
require_serial: true
|
||||
|
||||
@@ -1 +1 @@
|
||||
system
|
||||
3.14
|
||||
|
||||
2
how-to-python
Normal file
2
how-to-python
Normal file
@@ -0,0 +1,2 @@
|
||||
from the src folder:
|
||||
$ python -m project_euler_python.problems_001_005.Problem001
|
||||
@@ -7,17 +7,16 @@ authors = [
|
||||
]
|
||||
requires-python = ">=3.14"
|
||||
dependencies = [
|
||||
"pytablereader>=0.30.0,<0.35.0",
|
||||
"pytablewriter>=0.64.1,<0.65.0",
|
||||
"sympy>=1.12,<2.0",
|
||||
]
|
||||
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
"pre-commit>=2.16.0,<3.0.0",
|
||||
"flake8>=4.0.1,<5.0.0",
|
||||
"mypy>=0.920,<1.0.0",
|
||||
"isort>=5.10.1,<6.0.0",
|
||||
"black>=21.12b0,<22.0",
|
||||
"mypy>=1.11.0,<2.0.0",
|
||||
"pre-commit>=4.0.0,<5.0.0",
|
||||
"ruff>=0.6.0,<1.0.0",
|
||||
]
|
||||
|
||||
[build-system]
|
||||
@@ -30,3 +29,30 @@ package-dir = {"" = "src"}
|
||||
[tool.setuptools.packages.find]
|
||||
where = ["src"]
|
||||
include = ["project_euler_python*"]
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 88
|
||||
target-version = "py314"
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = [
|
||||
"E",
|
||||
"F",
|
||||
"I",
|
||||
"UP",
|
||||
]
|
||||
|
||||
[tool.ruff.format]
|
||||
quote-style = "double"
|
||||
indent-style = "space"
|
||||
|
||||
[tool.mypy]
|
||||
python_version = "3.14"
|
||||
|
||||
[[tool.mypy.overrides]]
|
||||
module = ["sympy", "sympy.*"]
|
||||
ignore_missing_imports = true
|
||||
|
||||
[[tool.mypy.overrides]]
|
||||
module = ["pytablereader", "pytablereader.*"]
|
||||
ignore_missing_imports = true
|
||||
|
||||
147
src/Julia/Problem054.jl
Normal file
147
src/Julia/Problem054.jl
Normal file
@@ -0,0 +1,147 @@
|
||||
#=
|
||||
Created on 02 Oct 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for Problem 54 of Project Euler
|
||||
https://projecteuler.net/problem=54 =#
|
||||
|
||||
using BenchmarkTools
|
||||
|
||||
# function replace_values_in_string(text, args_dict)
|
||||
# for (k, v) in args_dict
|
||||
# text = text.replace(k, string(v))
|
||||
# end
|
||||
|
||||
# return text
|
||||
# end
|
||||
|
||||
# function n_of_a_kind(hand, n)
|
||||
# return max([x for x in hand if hand.count(x) == n] || [0])
|
||||
# end
|
||||
|
||||
# function to_numerical(hand)
|
||||
# return sorted([int(x[:end]) for x in hand], reverse=True)
|
||||
# end
|
||||
|
||||
# # 10 Ranks functions.
|
||||
# function high_card(str_hand)
|
||||
# return to_numerical(str_hand)
|
||||
# end
|
||||
|
||||
# function one_pair(hand)
|
||||
# return n_of_a_kind(hand, 2)
|
||||
# end
|
||||
|
||||
# function two_pair(hand)
|
||||
# pairs = set([x for x in hand if hand.count(x) == 2])
|
||||
# return 0 if len(pairs) < 2 else max(pairs)
|
||||
# end
|
||||
|
||||
# function three_of_a_kind(hand)
|
||||
# return n_of_a_kind(hand, 3)
|
||||
# end
|
||||
|
||||
# function straight(hand)
|
||||
# return 0 if not list(range(hand[0], hand[-1]-1, -1)) == hand else max(hand)
|
||||
# end
|
||||
|
||||
# function flush(str_hand)
|
||||
# return len(set([x[-1] for x in str_hand])) == 1
|
||||
# end
|
||||
|
||||
# function full_house(hand)
|
||||
# return three_of_a_kind(hand) if one_pair(hand) and three_of_a_kind(hand) else 0
|
||||
# end
|
||||
|
||||
# function four_of_a_kind(hand)
|
||||
# return n_of_a_kind(hand, 4)
|
||||
# end
|
||||
|
||||
# function straight_flush(str_hand)
|
||||
# straight_result = straight(to_numerical(str_hand))
|
||||
# return straight_result if straight_result and flush(str_hand) else 0
|
||||
# end
|
||||
|
||||
# function royal_flush(str_hand)
|
||||
# return flush(str_hand) && list(range(14, 9, -1)) == to_numerical(str_hand)
|
||||
# end
|
||||
|
||||
function Problem54()
|
||||
#=
|
||||
In the card game poker, a hand consists of five cards and are ranked,
|
||||
from lowest to highest, in the following way:
|
||||
|
||||
High Card: Highest value card.
|
||||
One Pair: Two cards of the same value.
|
||||
Two Pairs: Two different pairs.
|
||||
Three of a Kind: Three cards of the same value.
|
||||
Straight: All cards are consecutive values.
|
||||
Flush: All cards of the same suit.
|
||||
Full House: Three of a kind and a pair.
|
||||
Four of a Kind: Four cards of the same value.
|
||||
Straight Flush: All cards are consecutive values of same suit.
|
||||
Royal Flush: Ten, Jack, Queen, King, Ace, in same suit.
|
||||
|
||||
The cards are valued in the order:
|
||||
|
||||
2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King, Ace.
|
||||
|
||||
If two players have the same ranked hands then the rank made up of the
|
||||
highest value wins; for example, a pair of eights beats a pair of fives
|
||||
(see example 1 below). But if two ranks tie, for example, both players
|
||||
have a pair of queens, then highest cards in each hand are compared
|
||||
(see example 4 below); if the highest cards tie then the next highest
|
||||
cards are compared, and so on.
|
||||
|
||||
Consider the following five hands dealt to two players:
|
||||
|
||||
Hand Player 1 Player 2 Winner
|
||||
1 5H 5C 6S 7S KD 2C 3S 8S 8D TD Player 2
|
||||
Pair of Fives Pair of Eights
|
||||
2 5D 8C 9S JS AC 2C 5C 7D 8S QH Player 1
|
||||
Highest card Ace Highest card Queen
|
||||
3 2D 9C AS AH AC 3D 6D 7D TD QD Player 2
|
||||
Three Aces Flush with Diamonds
|
||||
4 4D 6S 9H QH QC 3D 6D 7H QD QS Player 1
|
||||
Pair of Queens Pair of Queens
|
||||
Highest card Nine Highest card Seven
|
||||
5 2H 2D 4C 4D 4S 3C 3D 3S 9S 9D Player 1
|
||||
Full House Full House
|
||||
With Three Fours with Three Threes
|
||||
|
||||
The file, poker.txt, contains one-thousand random hands dealt to two
|
||||
players. Each line of the file contains ten cards (separated by a single
|
||||
space): the first five are Player 1's cards and the last five are Player
|
||||
2's cards. You can assume that all hands are valid (no invalid characters
|
||||
or repeated cards), each player's hand is in no specific order, and in
|
||||
each hand there is a clear winner.
|
||||
|
||||
How many hands does Player 1 win? =#
|
||||
|
||||
# replace_map = {"T"=> 10, "J"=> 11, "Q"=> 12, "K"=> 13, "A"=> 14}
|
||||
# score = [0, 0]
|
||||
# for line in open("../files/Problem54.txt", "r").read().splitlines():
|
||||
# line = replace_values_in_string(line, replace_map).split()
|
||||
# hands = line[:5], line[5:]
|
||||
# for rank in (royal_flush, straight_flush, four_of_a_kind, full_house, flush,
|
||||
# straight, three_of_a_kind, two_pair, one_pair, high_card):
|
||||
# should_convert_hand = "str" not in rank.__code__.co_varnames[0] # Checks parameter name.
|
||||
# result = [rank(to_numerical(hand) if should_convert_hand else hand) for hand in hands]
|
||||
# if result[0] != result[1]:
|
||||
# score[0 if result[0] > result[1] else 1] += 1
|
||||
# break
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
|
||||
# return score[0]
|
||||
return 0
|
||||
end
|
||||
|
||||
|
||||
println("Time to evaluate Problem $(lpad(54, 3, "0")):")
|
||||
@btime Problem54()
|
||||
println("")
|
||||
println("Result for Problem $(lpad(54, 3, "0")): ", Problem54())
|
||||
23
src/Julia/Problem060.jl
Normal file
23
src/Julia/Problem060.jl
Normal file
@@ -0,0 +1,23 @@
|
||||
#=
|
||||
Created on 30 Oct 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for Problem 60 of Project Euler
|
||||
https://projecteuler.net/problem=60 =#
|
||||
|
||||
using BenchmarkTools
|
||||
|
||||
function Problem60()
|
||||
#=
|
||||
Statement =#
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
println("Time to evaluate Problem $(lpad(60, 3, "0")):")
|
||||
@btime Problem60()
|
||||
println("")
|
||||
println("Result for Problem $(lpad(60, 3, "0")): ", Problem60())
|
||||
88
src/Julia/Problems001-050/Problem011.jl
Normal file
88
src/Julia/Problems001-050/Problem011.jl
Normal file
@@ -0,0 +1,88 @@
|
||||
#=
|
||||
Created on 07 Jul 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for Problem 11 of Project Euler
|
||||
https://projecteuler.net/problem=11 =#
|
||||
|
||||
using BenchmarkTools
|
||||
|
||||
GRID = [
|
||||
[8, 2, 22, 97, 38, 15, 0, 40, 0, 75, 4, 5, 7, 78, 52, 12, 50, 77, 91, 8],
|
||||
[49, 49, 99, 40, 17, 81, 18, 57, 60, 87, 17, 40, 98, 43, 69, 48, 4, 56, 62, 0],
|
||||
[81, 49, 31, 73, 55, 79, 14, 29, 93, 71, 40, 67, 53, 88, 30, 3, 49, 13, 36, 65],
|
||||
[52, 70, 95, 23, 4, 60, 11, 42, 69, 24, 68, 56, 1, 32, 56, 71, 37, 2, 36, 91],
|
||||
[22, 31, 16, 71, 51, 67, 63, 89, 41, 92, 36, 54, 22, 40, 40, 28, 66, 33, 13, 80],
|
||||
[24, 47, 32, 60, 99, 3, 45, 2, 44, 75, 33, 53, 78, 36, 84, 20, 35, 17, 12, 50],
|
||||
[32, 98, 81, 28, 64, 23, 67, 10, 26, 38, 40, 67, 59, 54, 70, 66, 18, 38, 64, 70],
|
||||
[67, 26, 20, 68, 2, 62, 12, 20, 95, 63, 94, 39, 63, 8, 40, 91, 66, 49, 94, 21],
|
||||
[24, 55, 58, 5, 66, 73, 99, 26, 97, 17, 78, 78, 96, 83, 14, 88, 34, 89, 63, 72],
|
||||
[21, 36, 23, 9, 75, 0, 76, 44, 20, 45, 35, 14, 0, 61, 33, 97, 34, 31, 33, 95],
|
||||
[78, 17, 53, 28, 22, 75, 31, 67, 15, 94, 3, 80, 4, 62, 16, 14, 9, 53, 56, 92],
|
||||
[16, 39, 5, 42, 96, 35, 31, 47, 55, 58, 88, 24, 0, 17, 54, 24, 36, 29, 85, 57],
|
||||
[86, 56, 0, 48, 35, 71, 89, 7, 5, 44, 44, 37, 44, 60, 21, 58, 51, 54, 17, 58],
|
||||
[19, 80, 81, 68, 5, 94, 47, 69, 28, 73, 92, 13, 86, 52, 17, 77, 4, 89, 55, 40],
|
||||
[4, 52, 8, 83, 97, 35, 99, 16, 7, 97, 57, 32, 16, 26, 26, 79, 33, 27, 98, 66],
|
||||
[88, 36, 68, 87, 57, 62, 20, 72, 3, 46, 33, 67, 46, 55, 12, 32, 63, 93, 53, 69],
|
||||
[4, 42, 16, 73, 38, 25, 39, 11, 24, 94, 72, 18, 8, 46, 29, 32, 40, 62, 76, 36],
|
||||
[20, 69, 36, 41, 72, 30, 23, 88, 34, 62, 99, 69, 82, 67, 59, 85, 74, 4, 36, 16],
|
||||
[20, 73, 35, 29, 78, 31, 90, 1, 74, 31, 49, 71, 48, 86, 81, 16, 23, 57, 5, 54],
|
||||
[1, 70, 54, 71, 83, 51, 54, 69, 16, 92, 33, 48, 61, 43, 52, 1, 89, 19, 67, 48],
|
||||
]
|
||||
|
||||
|
||||
function grid_product(x, y, dx, dy, n)
|
||||
result = 1
|
||||
for i = 0:n
|
||||
println("Accessing GRID: ", x, y, dx, dy)
|
||||
println(y + i * dy, x + i * dx)
|
||||
result *= GRID[y+i*dy][x+i*dx]
|
||||
println("result from grid product: ", result)
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
|
||||
function Problem11()
|
||||
#=
|
||||
In the 20x20 grid above, four numbers along a diagonal line have been
|
||||
marked in red.
|
||||
|
||||
The product of these numbers is 26 x 63 x 78 x 14 = 1788696.
|
||||
|
||||
What is the greatest product of four adjacent numbers in any direction
|
||||
(up, down, left, right, or diagonally) in the 20x20 grid? =#
|
||||
|
||||
ans = 0
|
||||
width = height = length(GRID)
|
||||
adjacent_nums = 4
|
||||
for y in 1:height
|
||||
for x in 1:width
|
||||
println("ans before: ", ans)
|
||||
println(y, x)
|
||||
if x + adjacent_nums <= width
|
||||
ans = max(grid_product(x, y, 1, 0, adjacent_nums), ans)
|
||||
end
|
||||
if y + adjacent_nums <= height
|
||||
ans = max(grid_product(x, y, 0, 1, adjacent_nums), ans)
|
||||
end
|
||||
if (x + adjacent_nums <= width) & (y + adjacent_nums <= height)
|
||||
ans = max(grid_product(x, y, 1, 1, adjacent_nums), ans)
|
||||
end
|
||||
if (x - adjacent_nums >= -1) & (y + adjacent_nums <= height)
|
||||
ans = max(grid_product(x, y, -1, 1, adjacent_nums), ans)
|
||||
end
|
||||
println("ans after: ", ans)
|
||||
end
|
||||
end
|
||||
return ans
|
||||
end
|
||||
|
||||
|
||||
# println("Time to evaluate Problem 11:")
|
||||
# @btime Problem11()
|
||||
# println("")
|
||||
# println("Result for Problem 11: ", Problem11())
|
||||
Problem11()
|
||||
@@ -18,13 +18,13 @@ def create_problem():
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for Problem {args['problem']:0>3} of Project Euler
|
||||
https://projecteuler.net/problem={args['problem']}
|
||||
Solution for Problem {args["problem"]:0>3} of Project Euler
|
||||
https://projecteuler.net/problem={args["problem"]}
|
||||
=#
|
||||
|
||||
using BenchmarkTools
|
||||
|
||||
function Problem{args['problem']:0>3}()
|
||||
function Problem{args["problem"]:0>3}()
|
||||
#=
|
||||
Statement
|
||||
=#
|
||||
@@ -35,9 +35,9 @@ def create_problem():
|
||||
|
||||
|
||||
println("Took:")
|
||||
@btime Problem{args['problem']:0>3}()
|
||||
@btime Problem{args["problem"]:0>3}()
|
||||
println("")
|
||||
println("Result for Problem $(lpad({args['problem']}, 3, "0")): ", Problem{args['problem']:0>3}())
|
||||
println("Result for Problem $(lpad({args["problem"]}, 3, "0")): ", Problem{args["problem"]:0>3}())
|
||||
""" # noqa: E501
|
||||
)
|
||||
|
||||
|
||||
@@ -97,4 +97,4 @@
|
||||
77158542502016545090413245809786882778948721859617
|
||||
72107838435069186155435662884062257473692284509516
|
||||
20849603980134001723930671666823555245252804609722
|
||||
53503534226472524250874054075591789781264330331690
|
||||
53503534226472524250874054075591789781264330331690
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
36,22,80,0,0,4,23,25,19,17,88,4,4,19,21,11,88,22,23,23,29,69,12,24,0,88,25,11,12,2,10,28,5,6,12,25,10,22,80,10,30,80,10,22,21,69,23,22,69,61,5,9,29,2,66,11,80,8,23,3,17,88,19,0,20,21,7,10,17,17,29,20,69,8,17,21,29,2,22,84,80,71,60,21,69,11,5,8,21,25,22,88,3,0,10,25,0,10,5,8,88,2,0,27,25,21,10,31,6,25,2,16,21,82,69,35,63,11,88,4,13,29,80,22,13,29,22,88,31,3,88,3,0,10,25,0,11,80,10,30,80,23,29,19,12,8,2,10,27,17,9,11,45,95,88,57,69,16,17,19,29,80,23,29,19,0,22,4,9,1,80,3,23,5,11,28,92,69,9,5,12,12,21,69,13,30,0,0,0,0,27,4,0,28,28,28,84,80,4,22,80,0,20,21,2,25,30,17,88,21,29,8,2,0,11,3,12,23,30,69,30,31,23,88,4,13,29,80,0,22,4,12,10,21,69,11,5,8,88,31,3,88,4,13,17,3,69,11,21,23,17,21,22,88,65,69,83,80,84,87,68,69,83,80,84,87,73,69,83,80,84,87,65,83,88,91,69,29,4,6,86,92,69,15,24,12,27,24,69,28,21,21,29,30,1,11,80,10,22,80,17,16,21,69,9,5,4,28,2,4,12,5,23,29,80,10,30,80,17,16,21,69,27,25,23,27,28,0,84,80,22,23,80,17,16,17,17,88,25,3,88,4,13,29,80,17,10,5,0,88,3,16,21,80,10,30,80,17,16,25,22,88,3,0,10,25,0,11,80,12,11,80,10,26,4,4,17,30,0,28,92,69,30,2,10,21,80,12,12,80,4,12,80,10,22,19,0,88,4,13,29,80,20,13,17,1,10,17,17,13,2,0,88,31,3,88,4,13,29,80,6,17,2,6,20,21,69,30,31,9,20,31,18,11,94,69,54,17,8,29,28,28,84,80,44,88,24,4,14,21,69,30,31,16,22,20,69,12,24,4,12,80,17,16,21,69,11,5,8,88,31,3,88,4,13,17,3,69,11,21,23,17,21,22,88,25,22,88,17,69,11,25,29,12,24,69,8,17,23,12,80,10,30,80,17,16,21,69,11,1,16,25,2,0,88,31,3,88,4,13,29,80,21,29,2,12,21,21,17,29,2,69,23,22,69,12,24,0,88,19,12,10,19,9,29,80,18,16,31,22,29,80,1,17,17,8,29,4,0,10,80,12,11,80,84,67,80,10,10,80,7,1,80,21,13,4,17,17,30,2,88,4,13,29,80,22,13,29,69,23,22,69,12,24,12,11,80,22,29,2,12,29,3,69,29,1,16,25,28,69,12,31,69,11,92,69,17,4,69,16,17,22,88,4,13,29,80,23,25,4,12,23,80,22,9,2,17,80,70,76,88,29,16,20,4,12,8,28,12,29,20,69,26,9,69,11,80,17,23,80,84,88,31,3,88,4,13,29,80,21,29,2,12,21,21,17,29,2,69,12,31,69,12,24,0,88,20,12,25,29,0,12,21,23,86,80,44,88,7,12,20,28,69,11,31,10,22,80,22,16,31,18,88,4,13,25,4,69,12,24,0,88,3,16,21,80,10,30,80,17,16,25,22,88,3,0,10,25,0,11,80,17,23,80,7,29,80,4,8,0,23,23,8,12,21,17,17,29,28,28,88,65,75,78,68,81,65,67,81,72,70,83,64,68,87,74,70,81,75,70,81,67,80,4,22,20,69,30,2,10,21,80,8,13,28,17,17,0,9,1,25,11,31,80,17,16,25,22,88,30,16,21,18,0,10,80,7,1,80,22,17,8,73,88,17,11,28,80,17,16,21,11,88,4,4,19,25,11,31,80,17,16,21,69,11,1,16,25,2,0,88,2,10,23,4,73,88,4,13,29,80,11,13,29,7,29,2,69,75,94,84,76,65,80,65,66,83,77,67,80,64,73,82,65,67,87,75,72,69,17,3,69,17,30,1,29,21,1,88,0,23,23,20,16,27,21,1,84,80,18,16,25,6,16,80,0,0,0,23,29,3,22,29,3,69,12,24,0,88,0,0,10,25,8,29,4,0,10,80,10,30,80,4,88,19,12,10,19,9,29,80,18,16,31,22,29,80,1,17,17,8,29,4,0,10,80,12,11,80,84,86,80,35,23,28,9,23,7,12,22,23,69,25,23,4,17,30,69,12,24,0,88,3,4,21,21,69,11,4,0,8,3,69,26,9,69,15,24,12,27,24,69,49,80,13,25,20,69,25,2,23,17,6,0,28,80,4,12,80,17,16,25,22,88,3,16,21,92,69,49,80,13,25,6,0,88,20,12,11,19,10,14,21,23,29,20,69,12,24,4,12,80,17,16,21,69,11,5,8,88,31,3,88,4,13,29,80,22,29,2,12,29,3,69,73,80,78,88,65,74,73,70,69,83,80,84,87,72,84,88,91,69,73,95,87,77,70,69,83,80,84,87,70,87,77,80,78,88,21,17,27,94,69,25,28,22,23,80,1,29,0,0,22,20,22,88,31,11,88,4,13,29,80,20,13,17,1,10,17,17,13,2,0,88,31,3,88,4,13,29,80,6,17,2,6,20,21,75,88,62,4,21,21,9,1,92,69,12,24,0,88,3,16,21,80,10,30,80,17,16,25,22,88,29,16,20,4,12,8,28,12,29,20,69,26,9,69,65,64,69,31,25,19,29,3,69,12,24,0,88,18,12,9,5,4,28,2,4,12,21,69,80,22,10,13,2,17,16,80,21,23,7,0,10,89,69,23,22,69,12,24,0,88,19,12,10,19,16,21,22,0,10,21,11,27,21,69,23,22,69,12,24,0,88,0,0,10,25,8,29,4,0,10,80,10,30,80,4,88,19,12,10,19,9,29,80,18,16,31,22,29,80,1,17,17,8,29,4,0,10,80,12,11,80,84,86,80,36,22,20,69,26,9,69,11,25,8,17,28,4,10,80,23,29,17,22,23,30,12,22,23,69,49,80,13,25,6,0,88,28,12,19,21,18,17,3,0,88,18,0,29,30,69,25,18,9,29,80,17,23,80,1,29,4,0,10,29,12,22,21,69,12,24,0,88,3,16,21,3,69,23,22,69,12,24,0,88,3,16,26,3,0,9,5,0,22,4,69,11,21,23,17,21,22,88,25,11,88,7,13,17,19,13,88,4,13,29,80,0,0,0,10,22,21,11,12,3,69,25,2,0,88,21,19,29,30,69,22,5,8,26,21,23,11,94
|
||||
36,22,80,0,0,4,23,25,19,17,88,4,4,19,21,11,88,22,23,23,29,69,12,24,0,88,25,11,12,2,10,28,5,6,12,25,10,22,80,10,30,80,10,22,21,69,23,22,69,61,5,9,29,2,66,11,80,8,23,3,17,88,19,0,20,21,7,10,17,17,29,20,69,8,17,21,29,2,22,84,80,71,60,21,69,11,5,8,21,25,22,88,3,0,10,25,0,10,5,8,88,2,0,27,25,21,10,31,6,25,2,16,21,82,69,35,63,11,88,4,13,29,80,22,13,29,22,88,31,3,88,3,0,10,25,0,11,80,10,30,80,23,29,19,12,8,2,10,27,17,9,11,45,95,88,57,69,16,17,19,29,80,23,29,19,0,22,4,9,1,80,3,23,5,11,28,92,69,9,5,12,12,21,69,13,30,0,0,0,0,27,4,0,28,28,28,84,80,4,22,80,0,20,21,2,25,30,17,88,21,29,8,2,0,11,3,12,23,30,69,30,31,23,88,4,13,29,80,0,22,4,12,10,21,69,11,5,8,88,31,3,88,4,13,17,3,69,11,21,23,17,21,22,88,65,69,83,80,84,87,68,69,83,80,84,87,73,69,83,80,84,87,65,83,88,91,69,29,4,6,86,92,69,15,24,12,27,24,69,28,21,21,29,30,1,11,80,10,22,80,17,16,21,69,9,5,4,28,2,4,12,5,23,29,80,10,30,80,17,16,21,69,27,25,23,27,28,0,84,80,22,23,80,17,16,17,17,88,25,3,88,4,13,29,80,17,10,5,0,88,3,16,21,80,10,30,80,17,16,25,22,88,3,0,10,25,0,11,80,12,11,80,10,26,4,4,17,30,0,28,92,69,30,2,10,21,80,12,12,80,4,12,80,10,22,19,0,88,4,13,29,80,20,13,17,1,10,17,17,13,2,0,88,31,3,88,4,13,29,80,6,17,2,6,20,21,69,30,31,9,20,31,18,11,94,69,54,17,8,29,28,28,84,80,44,88,24,4,14,21,69,30,31,16,22,20,69,12,24,4,12,80,17,16,21,69,11,5,8,88,31,3,88,4,13,17,3,69,11,21,23,17,21,22,88,25,22,88,17,69,11,25,29,12,24,69,8,17,23,12,80,10,30,80,17,16,21,69,11,1,16,25,2,0,88,31,3,88,4,13,29,80,21,29,2,12,21,21,17,29,2,69,23,22,69,12,24,0,88,19,12,10,19,9,29,80,18,16,31,22,29,80,1,17,17,8,29,4,0,10,80,12,11,80,84,67,80,10,10,80,7,1,80,21,13,4,17,17,30,2,88,4,13,29,80,22,13,29,69,23,22,69,12,24,12,11,80,22,29,2,12,29,3,69,29,1,16,25,28,69,12,31,69,11,92,69,17,4,69,16,17,22,88,4,13,29,80,23,25,4,12,23,80,22,9,2,17,80,70,76,88,29,16,20,4,12,8,28,12,29,20,69,26,9,69,11,80,17,23,80,84,88,31,3,88,4,13,29,80,21,29,2,12,21,21,17,29,2,69,12,31,69,12,24,0,88,20,12,25,29,0,12,21,23,86,80,44,88,7,12,20,28,69,11,31,10,22,80,22,16,31,18,88,4,13,25,4,69,12,24,0,88,3,16,21,80,10,30,80,17,16,25,22,88,3,0,10,25,0,11,80,17,23,80,7,29,80,4,8,0,23,23,8,12,21,17,17,29,28,28,88,65,75,78,68,81,65,67,81,72,70,83,64,68,87,74,70,81,75,70,81,67,80,4,22,20,69,30,2,10,21,80,8,13,28,17,17,0,9,1,25,11,31,80,17,16,25,22,88,30,16,21,18,0,10,80,7,1,80,22,17,8,73,88,17,11,28,80,17,16,21,11,88,4,4,19,25,11,31,80,17,16,21,69,11,1,16,25,2,0,88,2,10,23,4,73,88,4,13,29,80,11,13,29,7,29,2,69,75,94,84,76,65,80,65,66,83,77,67,80,64,73,82,65,67,87,75,72,69,17,3,69,17,30,1,29,21,1,88,0,23,23,20,16,27,21,1,84,80,18,16,25,6,16,80,0,0,0,23,29,3,22,29,3,69,12,24,0,88,0,0,10,25,8,29,4,0,10,80,10,30,80,4,88,19,12,10,19,9,29,80,18,16,31,22,29,80,1,17,17,8,29,4,0,10,80,12,11,80,84,86,80,35,23,28,9,23,7,12,22,23,69,25,23,4,17,30,69,12,24,0,88,3,4,21,21,69,11,4,0,8,3,69,26,9,69,15,24,12,27,24,69,49,80,13,25,20,69,25,2,23,17,6,0,28,80,4,12,80,17,16,25,22,88,3,16,21,92,69,49,80,13,25,6,0,88,20,12,11,19,10,14,21,23,29,20,69,12,24,4,12,80,17,16,21,69,11,5,8,88,31,3,88,4,13,29,80,22,29,2,12,29,3,69,73,80,78,88,65,74,73,70,69,83,80,84,87,72,84,88,91,69,73,95,87,77,70,69,83,80,84,87,70,87,77,80,78,88,21,17,27,94,69,25,28,22,23,80,1,29,0,0,22,20,22,88,31,11,88,4,13,29,80,20,13,17,1,10,17,17,13,2,0,88,31,3,88,4,13,29,80,6,17,2,6,20,21,75,88,62,4,21,21,9,1,92,69,12,24,0,88,3,16,21,80,10,30,80,17,16,25,22,88,29,16,20,4,12,8,28,12,29,20,69,26,9,69,65,64,69,31,25,19,29,3,69,12,24,0,88,18,12,9,5,4,28,2,4,12,21,69,80,22,10,13,2,17,16,80,21,23,7,0,10,89,69,23,22,69,12,24,0,88,19,12,10,19,16,21,22,0,10,21,11,27,21,69,23,22,69,12,24,0,88,0,0,10,25,8,29,4,0,10,80,10,30,80,4,88,19,12,10,19,9,29,80,18,16,31,22,29,80,1,17,17,8,29,4,0,10,80,12,11,80,84,86,80,36,22,20,69,26,9,69,11,25,8,17,28,4,10,80,23,29,17,22,23,30,12,22,23,69,49,80,13,25,6,0,88,28,12,19,21,18,17,3,0,88,18,0,29,30,69,25,18,9,29,80,17,23,80,1,29,4,0,10,29,12,22,21,69,12,24,0,88,3,16,21,3,69,23,22,69,12,24,0,88,3,16,26,3,0,9,5,0,22,4,69,11,21,23,17,21,22,88,25,11,88,7,13,17,19,13,88,4,13,29,80,0,0,0,10,22,21,11,12,3,69,25,2,0,88,21,19,29,30,69,22,5,8,26,21,23,11,94
|
||||
|
||||
70
src/project_euler_python/Problem051.py
Normal file
70
src/project_euler_python/Problem051.py
Normal file
@@ -0,0 +1,70 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 24 Sep 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 051 of Project Euler
|
||||
https://projecteuler.net/problem=51
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import is_prime, list_primes, timeit
|
||||
|
||||
|
||||
@timeit("Problem 051")
|
||||
def compute():
|
||||
"""
|
||||
By replacing the 1st digit of the 2-digit number *3, it turns out that
|
||||
six of the nine possible values: 13, 23, 43, 53, 73, and 83, are all prime.
|
||||
|
||||
By replacing the 3rd and 4th digits of 56**3 with the same digit, this
|
||||
5-digit number is the first example having seven primes among the ten
|
||||
generated numbers, yielding the family:
|
||||
|
||||
56003, 56113, 56333, 56443, 56663, 56773, and 56993.
|
||||
|
||||
Consequently 56003, being the first member of this family, is the smallest
|
||||
prime with this property.
|
||||
|
||||
Find the smallest prime which, by replacing part of the number (not
|
||||
necessarily adjacent digits) with the same digit, is part of an eight prime
|
||||
value family.
|
||||
"""
|
||||
|
||||
primes = sorted(set(list_primes(1_000_000)) - set(list_primes(57_000)))
|
||||
digits = {
|
||||
"0": [],
|
||||
"1": [],
|
||||
"2": [],
|
||||
"3": [],
|
||||
"4": [],
|
||||
"5": [],
|
||||
"6": [],
|
||||
"7": [],
|
||||
"8": [],
|
||||
"9": [],
|
||||
}
|
||||
for d in digits.keys():
|
||||
for p in primes:
|
||||
p = str(p)
|
||||
if p.count(d) == 3 and p[-1] != d:
|
||||
digits[d].append(p)
|
||||
|
||||
for d in {"0", "1", "2"}:
|
||||
for p in digits[d]:
|
||||
res = 0
|
||||
i = 10
|
||||
for D in {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"} - {d}:
|
||||
i -= 1
|
||||
q = int(p.replace(d, D))
|
||||
if is_prime(q) and q > 57_000:
|
||||
res += 1
|
||||
if i + res < 7:
|
||||
break
|
||||
if res == 7:
|
||||
return p
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 051: {compute()}")
|
||||
38
src/project_euler_python/Problem052.py
Normal file
38
src/project_euler_python/Problem052.py
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 26 Sep 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 052 of Project Euler
|
||||
https://projecteuler.net/problem=52
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 052")
|
||||
def compute():
|
||||
"""
|
||||
It can be seen that the number, 125874, and its double, 251748,
|
||||
contain exactly the same digits, but in a different order.
|
||||
|
||||
Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x,
|
||||
and 6x, contain the same digits.
|
||||
"""
|
||||
|
||||
for number in range(123_456, 1_000_000):
|
||||
if (
|
||||
sorted(str(number))
|
||||
== sorted(str(2 * number))
|
||||
== sorted(str(3 * number))
|
||||
== sorted(str(4 * number))
|
||||
== sorted(str(5 * number))
|
||||
== sorted(str(6 * number))
|
||||
):
|
||||
return number
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 052: {compute()}")
|
||||
45
src/project_euler_python/Problem053.py
Normal file
45
src/project_euler_python/Problem053.py
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 26 Sep 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 053 of Project Euler
|
||||
https://projecteuler.net/problem=53
|
||||
"""
|
||||
|
||||
from math import comb
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 053")
|
||||
def compute():
|
||||
"""
|
||||
There are exactly ten ways of selecting three from five, 12345:
|
||||
|
||||
123, 124, 125, 134, 135, 145, 234, 235, 245, and 345
|
||||
|
||||
In combinatorics, we use the notation, (5 over 3) = 10.
|
||||
|
||||
In general, (n over r) = n!/r!*(n-r)!, where r<=n, n!=n*(n-1)*...*2*1,
|
||||
and 0!=1.
|
||||
|
||||
It is not until, that a value exceeds one-million: (23 over 10) = 1144066.
|
||||
|
||||
How many, not necessarily distinct, values of (n over r) for 1<=n<=100,
|
||||
are greater than one-million?
|
||||
"""
|
||||
|
||||
ans = 0
|
||||
for x in range(101):
|
||||
for y in range(101):
|
||||
if comb(x, y) > 1_000_000:
|
||||
ans += 1
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 053: {compute()}")
|
||||
163
src/project_euler_python/Problem054.py
Normal file
163
src/project_euler_python/Problem054.py
Normal file
@@ -0,0 +1,163 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 27 Sep 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 054 of Project Euler
|
||||
https://projecteuler.net/problem=54
|
||||
"""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
# 3 help functions.
|
||||
def replace_values_in_string(text: str, args_dict: dict) -> str:
|
||||
for k, v in args_dict.items():
|
||||
text = text.replace(k, str(v))
|
||||
return text
|
||||
|
||||
|
||||
def n_of_a_kind(hand: list, n: int) -> int:
|
||||
return max([x for x in hand if hand.count(x) == n] or [0])
|
||||
|
||||
|
||||
def to_numerical(hand: list) -> list:
|
||||
return sorted([int(x[:-1]) for x in hand], reverse=True)
|
||||
|
||||
|
||||
# 10 Ranks functions.
|
||||
def high_card(str_hand: list) -> list:
|
||||
return to_numerical(str_hand)
|
||||
|
||||
|
||||
def one_pair(hand: list) -> int:
|
||||
return n_of_a_kind(hand, 2)
|
||||
|
||||
|
||||
def two_pair(hand: list) -> int:
|
||||
pairs = set([x for x in hand if hand.count(x) == 2])
|
||||
return 0 if len(pairs) < 2 else max(pairs)
|
||||
|
||||
|
||||
def three_of_a_kind(hand: list) -> int:
|
||||
return n_of_a_kind(hand, 3)
|
||||
|
||||
|
||||
def straight(hand: list) -> int:
|
||||
return 0 if not list(range(hand[0], hand[-1] - 1, -1)) == hand else max(hand)
|
||||
|
||||
|
||||
def flush(str_hand: list) -> bool:
|
||||
return len(set([x[-1] for x in str_hand])) == 1
|
||||
|
||||
|
||||
def full_house(hand: list) -> int:
|
||||
return three_of_a_kind(hand) if one_pair(hand) and three_of_a_kind(hand) else 0
|
||||
|
||||
|
||||
def four_of_a_kind(hand: list) -> int:
|
||||
return n_of_a_kind(hand, 4)
|
||||
|
||||
|
||||
def straight_flush(str_hand: list) -> int:
|
||||
straight_result = straight(to_numerical(str_hand))
|
||||
return straight_result if straight_result and flush(str_hand) else 0
|
||||
|
||||
|
||||
def royal_flush(str_hand: list) -> bool:
|
||||
return flush(str_hand) and list(range(14, 9, -1)) == to_numerical(str_hand)
|
||||
|
||||
|
||||
@timeit("Problem 054")
|
||||
def compute():
|
||||
"""
|
||||
In the card game poker, a hand consists of five cards and are ranked,
|
||||
from lowest to highest, in the following way:
|
||||
|
||||
High Card: Highest value card.
|
||||
One Pair: Two cards of the same value.
|
||||
Two Pairs: Two different pairs.
|
||||
Three of a Kind: Three cards of the same value.
|
||||
Straight: All cards are consecutive values.
|
||||
Flush: All cards of the same suit.
|
||||
Full House: Three of a kind and a pair.
|
||||
Four of a Kind: Four cards of the same value.
|
||||
Straight Flush: All cards are consecutive values of same suit.
|
||||
Royal Flush: Ten, Jack, Queen, King, Ace, in same suit.
|
||||
|
||||
The cards are valued in the order:
|
||||
|
||||
2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King, Ace.
|
||||
|
||||
If two players have the same ranked hands then the rank made up of the
|
||||
highest value wins; for example, a pair of eights beats a pair of fives
|
||||
(see example 1 below). But if two ranks tie, for example, both players
|
||||
have a pair of queens, then highest cards in each hand are compared
|
||||
(see example 4 below); if the highest cards tie then the next highest
|
||||
cards are compared, and so on.
|
||||
|
||||
Consider the following five hands dealt to two players:
|
||||
|
||||
Hand Player 1 Player 2 Winner
|
||||
1 5H 5C 6S 7S KD 2C 3S 8S 8D TD Player 2
|
||||
Pair of Fives Pair of Eights
|
||||
2 5D 8C 9S JS AC 2C 5C 7D 8S QH Player 1
|
||||
Highest card Ace Highest card Queen
|
||||
3 2D 9C AS AH AC 3D 6D 7D TD QD Player 2
|
||||
Three Aces Flush with Diamonds
|
||||
4 4D 6S 9H QH QC 3D 6D 7H QD QS Player 1
|
||||
Pair of Queens Pair of Queens
|
||||
Highest card Nine Highest card Seven
|
||||
5 2H 2D 4C 4D 4S 3C 3D 3S 9S 9D Player 1
|
||||
Full House Full House
|
||||
With Three Fours with Three Threes
|
||||
|
||||
The file, poker.txt, contains one-thousand random hands dealt to two
|
||||
players. Each line of the file contains ten cards (separated by a single
|
||||
space): the first five are Player 1's cards and the last five are Player
|
||||
2's cards. You can assume that all hands are valid (no invalid characters
|
||||
or repeated cards), each player's hand is in no specific order, and in
|
||||
each hand there is a clear winner.
|
||||
|
||||
How many hands does Player 1 win?
|
||||
"""
|
||||
|
||||
replace_map = {"T": 10, "J": 11, "Q": 12, "K": 13, "A": 14}
|
||||
score = [0, 0]
|
||||
|
||||
file = Path("files/Problem54.txt")
|
||||
for line in open(file).read().splitlines():
|
||||
line = replace_values_in_string(line, replace_map).split()
|
||||
hands = line[:5], line[5:]
|
||||
for rank in (
|
||||
royal_flush,
|
||||
straight_flush,
|
||||
four_of_a_kind,
|
||||
full_house,
|
||||
flush,
|
||||
straight,
|
||||
three_of_a_kind,
|
||||
two_pair,
|
||||
one_pair,
|
||||
high_card,
|
||||
):
|
||||
should_convert_hand = (
|
||||
"str" not in rank.__code__.co_varnames[0]
|
||||
) # Checks parameter name.
|
||||
result = [
|
||||
rank(to_numerical(hand) if should_convert_hand else hand)
|
||||
for hand in hands
|
||||
]
|
||||
if result[0] != result[1]:
|
||||
score[0 if result[0] > result[1] else 1] += 1
|
||||
break
|
||||
|
||||
return score[0]
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 054: {compute()}")
|
||||
66
src/project_euler_python/Problem055.py
Normal file
66
src/project_euler_python/Problem055.py
Normal file
@@ -0,0 +1,66 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 02 Oct 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 055 of Project Euler
|
||||
https://projecteuler.net/problem=55
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import is_palindrome, timeit
|
||||
|
||||
|
||||
@timeit("Problem 055")
|
||||
def compute():
|
||||
"""
|
||||
If we take 47, reverse and add, 47 + 74 = 121, which is palindromic.
|
||||
|
||||
Not all numbers produce palindromes so quickly. For example,
|
||||
|
||||
349 + 943 = 1292,
|
||||
1292 + 2921 = 4213
|
||||
4213 + 3124 = 7337
|
||||
|
||||
That is, 349 took three iterations to arrive at a palindrome.
|
||||
|
||||
Although no one has proved it yet, it is thought that some numbers, like
|
||||
196, never produce a palindrome. A number that never forms a palindrome
|
||||
through the reverse and add process is called a Lychrel number. Due to the
|
||||
theoretical nature of these numbers, and for the purpose of this problem,
|
||||
we shall assume that a number is Lychrel until proven otherwise. In
|
||||
addition you are given that for every number below ten-thousand, it will
|
||||
either:
|
||||
(i) become a palindrome in less than fifty iterations, or,
|
||||
(ii) no one, with all the computing power that exists, has managed so far
|
||||
to map it to a palindrome.
|
||||
|
||||
In fact, 10677 is the first number to be shown to require over fifty
|
||||
iterations before producing a palindrome:
|
||||
|
||||
4668731596684224866951378664 (53 iterations, 28-digits).
|
||||
|
||||
Surprisingly, there are palindromic numbers that are themselves Lychrel
|
||||
numbers; the first example is 4994.
|
||||
|
||||
How many Lychrel numbers are there below ten-thousand?
|
||||
"""
|
||||
|
||||
ans = 0
|
||||
for n in range(11, 10_000):
|
||||
num = n
|
||||
is_lychrel = True
|
||||
for _ in range(50):
|
||||
num += int(str(num)[::-1])
|
||||
if is_palindrome(num):
|
||||
is_lychrel = False
|
||||
break
|
||||
if is_lychrel:
|
||||
ans += 1
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 055: {compute()}")
|
||||
37
src/project_euler_python/Problem056.py
Normal file
37
src/project_euler_python/Problem056.py
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 07 Oct 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 056 of Project Euler
|
||||
https://projecteuler.net/problem=56
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 056")
|
||||
def compute():
|
||||
"""
|
||||
A googol (10^100) is a massive number: one followed by one-hundred zeros;
|
||||
100100 is almost unimaginably large: one followed by two-hundred zeros.
|
||||
Despite their size, the sum of the digits in each number is only 1.
|
||||
|
||||
Considering natural numbers of the form, a^b, where a, b < 100, what is the
|
||||
maximum digital sum?
|
||||
"""
|
||||
|
||||
ans = 0
|
||||
for a in range(100):
|
||||
for b in range(100):
|
||||
num = sum([int(digit) for digit in str(a**b)])
|
||||
if num > ans:
|
||||
ans = num
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 056: {compute()}")
|
||||
50
src/project_euler_python/Problem057.py
Normal file
50
src/project_euler_python/Problem057.py
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 09 Oct 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 057 of Project Euler
|
||||
https://projecteuler.net/problem=57
|
||||
"""
|
||||
|
||||
from fractions import Fraction
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 057")
|
||||
def compute():
|
||||
"""
|
||||
It is possible to show that the square root of two can be expressed
|
||||
as an infinite continued fraction.
|
||||
|
||||
By expanding this for the first four iterations, we get:
|
||||
|
||||
1 + 1/2 = 3/2 = 1.5
|
||||
1 + 1/2+1/2 = 7/5 = 1.4
|
||||
1 + 1/2+1/2+1/2 = 17/12 = 1.41666...
|
||||
1 + 1/2+1/2+1/2+1/2 = 41/29 = 1.41379...
|
||||
|
||||
The next three expansions are 99/70, 239/169, and 577/408, but the eighth
|
||||
expansion, 1393/985, is the first example where the number of digits in
|
||||
the numerator exceeds the number of digits in the denominator.
|
||||
|
||||
In the first one-thousand expansions, how many fractions contain a numerator
|
||||
with more digits than the denominator?
|
||||
"""
|
||||
|
||||
ans = 0
|
||||
f = Fraction(1, 2)
|
||||
for _ in range(1000):
|
||||
f = 1 / (2 + f)
|
||||
result = 1 + f
|
||||
if len(str(result.numerator)) > len(str(result.denominator)):
|
||||
ans += 1
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 057: {compute()}")
|
||||
55
src/project_euler_python/Problem058.py
Normal file
55
src/project_euler_python/Problem058.py
Normal file
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 10 Oct 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 058 of Project Euler
|
||||
https://projecteuler.net/problem=58
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import is_prime, timeit
|
||||
|
||||
|
||||
@timeit("Problem 058")
|
||||
def compute():
|
||||
"""
|
||||
Starting with 1 and spiralling anticlockwise in the following way,
|
||||
a square spiral with side length 7 is formed.
|
||||
|
||||
37 36 35 34 33 32 31
|
||||
38 17 16 15 14 13 30
|
||||
39 18 5 4 3 12 29
|
||||
40 19 6 1 2 11 28
|
||||
41 20 7 8 9 10 27
|
||||
42 21 22 23 24 25 26
|
||||
43 44 45 46 47 48 49
|
||||
|
||||
It is interesting to note that the odd squares lie along the bottom right
|
||||
diagonal, but what is more interesting is that 8 out of the 13 numbers
|
||||
lying along both diagonals are prime; that is, a ratio of 8/13 ≈ 62%.
|
||||
|
||||
If one complete new layer is wrapped around the spiral above, a square
|
||||
spiral with side length 9 will be formed. If this process is continued,
|
||||
what is the side length of the square spiral for which the ratio of primes
|
||||
along both diagonals first falls below 10%?
|
||||
"""
|
||||
|
||||
ratio = 1
|
||||
corners = []
|
||||
side = 0
|
||||
num = 1
|
||||
|
||||
while ratio > 0.1:
|
||||
side += 2
|
||||
for _ in range(4):
|
||||
num += side
|
||||
corners.append(is_prime(num))
|
||||
ratio = sum(corners) / len(corners)
|
||||
|
||||
return side + 1
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 058: {compute()}")
|
||||
64
src/project_euler_python/Problem059.py
Normal file
64
src/project_euler_python/Problem059.py
Normal file
@@ -0,0 +1,64 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 13 Oct 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 059 of Project Euler
|
||||
https://projecteuler.net/problem=59
|
||||
"""
|
||||
|
||||
from itertools import permutations
|
||||
from string import ascii_lowercase
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 059")
|
||||
def compute():
|
||||
"""
|
||||
Each character on a computer is assigned a unique code and the preferred
|
||||
standard is ASCII (American Standard Code for Information Interchange).
|
||||
For example, uppercase A = 65, asterisk (*) = 42, and lowercase k = 107.
|
||||
|
||||
A modern encryption method is to take a text file, convert the bytes to
|
||||
ASCII, then XOR each byte with a given value, taken from a secret key.
|
||||
The advantage with the XOR function is that using the same encryption key
|
||||
on the cipher text, restores the plain text; for example, 65 XOR 42 = 107,
|
||||
then 107 XOR 42 = 65.
|
||||
|
||||
For unbreakable encryption, the key is the same length as the plain text
|
||||
message, and the key is made up of random bytes. The user would keep the
|
||||
encrypted message and the encryption key in different locations, and
|
||||
without both "halves", it is impossible to decrypt the message.
|
||||
|
||||
Unfortunately, this method is impractical for most users, so the modified
|
||||
method is to use a password as a key. If the password is shorter than the
|
||||
message, which is likely, the key is repeated cyclically throughout the
|
||||
message. The balance for this method is using a sufficiently long password
|
||||
key for security, but short enough to be memorable.
|
||||
|
||||
Your task has been made easy, as the encryption key consists of three
|
||||
lower case characters. Using p059_cipher.txt, a file containing the
|
||||
encrypted ASCII codes, and the knowledge that the plain text must contain
|
||||
common English words, decrypt the message and find the sum of the ASCII
|
||||
values in the original text.
|
||||
"""
|
||||
|
||||
with open("files/Problem59.txt") as f:
|
||||
encrypted = [int(char) for char in f.read().split(",")]
|
||||
|
||||
plain_text = len(encrypted) // 3
|
||||
for key in permutations(ascii_lowercase, 3):
|
||||
decrypted = ""
|
||||
for k, i in zip(list(key) * plain_text, encrypted):
|
||||
decrypted += chr(ord(k) ^ i)
|
||||
|
||||
# assuming Euler will be in the text
|
||||
if "Euler" in decrypted:
|
||||
return sum([ord(c) for c in decrypted])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 059: {compute()}")
|
||||
56
src/project_euler_python/Problem060.py
Normal file
56
src/project_euler_python/Problem060.py
Normal file
@@ -0,0 +1,56 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 04 Dic 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 060 of Project Euler
|
||||
https://projecteuler.net/problem=60
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import is_prime, list_primes, timeit
|
||||
|
||||
|
||||
def solve_backtrack(max_chain_length, chain):
|
||||
primes_list = list_primes(10_000)
|
||||
|
||||
for p in primes_list[1:]:
|
||||
if p not in chain and is_concatenable(chain, p):
|
||||
chain.append(p)
|
||||
if len(chain) == max_chain_length:
|
||||
return chain
|
||||
solve_backtrack(max_chain_length, chain)
|
||||
chain.pop()
|
||||
return chain
|
||||
|
||||
|
||||
def is_concatenable(chain, candidate):
|
||||
for n in chain:
|
||||
if not is_prime(int(str(n) + str(candidate))):
|
||||
return False
|
||||
if not is_prime(int(str(candidate) + str(n))):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
@timeit("Problem 060")
|
||||
def compute():
|
||||
"""
|
||||
The primes 3, 7, 109, and 673, are quite remarkable. By taking any two
|
||||
primes and concatenating them in any order the result will always be prime.
|
||||
For example, taking 7 and 109, both 7109 and 1097 are prime. The sum of
|
||||
these four primes, 792, represents the lowest sum for a set of four primes
|
||||
with this property.
|
||||
|
||||
Find the lowest sum for a set of five primes for which any two primes
|
||||
concatenate to produce another prime.
|
||||
"""
|
||||
|
||||
ans = solve_backtrack(5, [])
|
||||
|
||||
return sum(ans)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 060: {compute()}")
|
||||
83
src/project_euler_python/Problem061.py
Normal file
83
src/project_euler_python/Problem061.py
Normal file
@@ -0,0 +1,83 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 16 Jul 2022
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 061 of Project Euler
|
||||
https://projecteuler.net/problem=61
|
||||
"""
|
||||
|
||||
from itertools import permutations
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
def get_numbers(order: int, number: int) -> int:
|
||||
return (number * (number - 1) * (order - 2) // 2) + number
|
||||
|
||||
|
||||
poligonals: dict[int, set[str]] = {
|
||||
o: set(str(get_numbers(o, n)) for n in range(150)) for o in range(3, 9)
|
||||
}
|
||||
|
||||
four_digits_numbers: set[str] = {str(n) for n in range(10**3, 10**4)}
|
||||
|
||||
eligibles: dict[int, list[str]] = {
|
||||
k: list(v & four_digits_numbers) for k, v in poligonals.items()
|
||||
}
|
||||
|
||||
|
||||
@timeit("Problem 061")
|
||||
def compute():
|
||||
"""
|
||||
Triangle, square, pentagonal, hexagonal, heptagonal, and octagonal numbers
|
||||
are all figurate (polygonal) numbers and are generated by the following
|
||||
formulae:
|
||||
Triangle P3,n=n(n+1)/2 1, 3, 6, 10, 15, ...
|
||||
Square P4,n=n2 1, 4, 9, 16, 25, ...
|
||||
Pentagonal P5,n=n(3n-1)/2 1, 5, 12, 22, 35, ...
|
||||
Hexagonal P6,n=n(2n-1) 1, 6, 15, 28, 45, ...
|
||||
Heptagonal P7,n=n(5n-3)/2 1, 7, 18, 34, 55, ...
|
||||
Octagonal P8,n=n(3n-2) 1, 8, 21, 40, 65, ...
|
||||
|
||||
The ordered set of three 4-digit numbers: 8128, 2882, 8281, has three
|
||||
interesting properties.
|
||||
|
||||
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).
|
||||
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.
|
||||
This is the only set of 4-digit numbers with this property.
|
||||
|
||||
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.
|
||||
"""
|
||||
|
||||
perms = permutations(eligibles.keys(), 6)
|
||||
for perm in perms:
|
||||
for a in eligibles.get(perm[0]):
|
||||
ans = []
|
||||
a1, a2 = a[:2], a[2:]
|
||||
for b in filter(lambda n: n[:2] == a2, eligibles.get(perm[1])):
|
||||
b2 = b[2:]
|
||||
for c in filter(lambda n: n[:2] == b2, eligibles.get(perm[2])):
|
||||
c2 = c[2:]
|
||||
for d in filter(lambda n: n[:2] == c2, eligibles.get(perm[3])):
|
||||
d2 = d[2:]
|
||||
for e in filter(lambda n: n[:2] == d2, eligibles.get(perm[4])):
|
||||
e2 = e[2:]
|
||||
for f in filter(
|
||||
lambda n: n[:2] == e2 and n[2:] == a1,
|
||||
eligibles.get(perm[5]),
|
||||
):
|
||||
ans.append([a, b, c, d, e, f])
|
||||
return sum(map(int, ans[0]))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 061: {compute()}")
|
||||
38
src/project_euler_python/Problem062.py
Normal file
38
src/project_euler_python/Problem062.py
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 25 Jul 2022
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 062 of Project Euler
|
||||
https://projecteuler.net/problem=62
|
||||
"""
|
||||
|
||||
from collections import defaultdict
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 062")
|
||||
def compute():
|
||||
"""
|
||||
The cube, 41063625 (345^3), can be permuted to produce two other cubes:
|
||||
56623104 (384^3) and 66430125 (405^3). In fact, 41063625 is the smallest
|
||||
cube which has exactly three permutations of its digits which are also
|
||||
cube.
|
||||
|
||||
Find the smallest cube for which exactly five permutations of its digits
|
||||
are cube.
|
||||
"""
|
||||
|
||||
cubes = defaultdict(list)
|
||||
for number in range(345, 10_000):
|
||||
cube_str = "".join(sorted(list(str(number**3))))
|
||||
cubes[cube_str].append(number**3)
|
||||
if len(cubes[cube_str]) == 5:
|
||||
return min(cubes[cube_str])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 062: {compute()}")
|
||||
35
src/project_euler_python/Problem063.py
Normal file
35
src/project_euler_python/Problem063.py
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 05 Aug 2022
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 063 of Project Euler
|
||||
https://projecteuler.net/problem=63
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 063")
|
||||
def compute():
|
||||
"""
|
||||
The 5-digit number, 16807=7^5, is also a fifth power. Similarly, the
|
||||
9-digit number, 134217728=8^9, is a ninth power.
|
||||
|
||||
How many n-digit positive integers exist which are also an nth power?
|
||||
"""
|
||||
|
||||
ans = 0
|
||||
# no need to go higher than 10, because 10**2 = 100
|
||||
for number in range(1, 10):
|
||||
for exp in range(1, 30):
|
||||
if len(str(number**exp)) == exp:
|
||||
ans += 1
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 063: {compute()}")
|
||||
58
src/project_euler_python/Problem064.py
Normal file
58
src/project_euler_python/Problem064.py
Normal file
@@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 26 Oct 2022
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 64 of Project Euler
|
||||
https://projecteuler.net/problem=64
|
||||
"""
|
||||
|
||||
from math import floor, sqrt
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
def continuedFraction(n):
|
||||
m = 0
|
||||
d = 1
|
||||
a = floor(sqrt(n))
|
||||
i = 0
|
||||
while True:
|
||||
m = d * a - m
|
||||
d = (n - m**2) / d
|
||||
a = floor((floor(sqrt(n)) + m) / d)
|
||||
if i == 0:
|
||||
m0 = m
|
||||
d0 = d
|
||||
a0 = a
|
||||
if i > 0:
|
||||
if m == m0 and d == d0 and a == a0:
|
||||
return True if i % 2 != 0 else False
|
||||
i += 1
|
||||
|
||||
|
||||
def checkIfSquare(n):
|
||||
return True if floor(sqrt(n)) == sqrt(n) else False
|
||||
|
||||
|
||||
@timeit("Problem 64")
|
||||
def compute():
|
||||
"""
|
||||
# Statement
|
||||
"""
|
||||
# https://en.wikipedia.org/wiki/Periodic_continued_fraction#Canonical_form_and_repetend
|
||||
|
||||
result = 0
|
||||
|
||||
for i in range(2, 10001):
|
||||
if not checkIfSquare(i):
|
||||
if continuedFraction(i):
|
||||
result += 1
|
||||
|
||||
return result
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem {64:003d} is {compute()}")
|
||||
62
src/project_euler_python/Problem066.py
Normal file
62
src/project_euler_python/Problem066.py
Normal file
@@ -0,0 +1,62 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 08 Sep 2023
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 066 from Project Euler
|
||||
https://projecteuler.net/problem=66
|
||||
"""
|
||||
|
||||
from sympy import simplify
|
||||
from sympy.abc import t, x, y
|
||||
from sympy.solvers.diophantine.diophantine import diop_quadratic
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 066")
|
||||
def compute():
|
||||
"""
|
||||
Consider quadratic Diophantine equations of the form:
|
||||
|
||||
x^2 - Dy^2 = 1
|
||||
|
||||
For example, when D = 13, the minimal solution in x is
|
||||
649^2 - 13 * 180^2 = 1
|
||||
|
||||
It can be assumed that there are no solutions in positive integers when D is
|
||||
square.
|
||||
|
||||
By finding minimal solutions in x for D = {2, 3, 5, 6, 7}, we obtain the
|
||||
following:
|
||||
|
||||
3^2 - 2 * 2^2 = 1
|
||||
2^2 - 3 * 1^2 = 1
|
||||
9^2 - 5 * 4^2 = 1
|
||||
5^2 - 6 * 2^2 = 1
|
||||
8^2 - 7 * 3^2 = 1
|
||||
|
||||
Hence, by considering minimal solutions in x for D <= 7, the largest x is
|
||||
obtained when D = 5.
|
||||
|
||||
Find the value of D <= 1000 in minimal solutions of x for which the largest
|
||||
value of x is obtained.
|
||||
"""
|
||||
|
||||
max_d, max_x = 0, 0
|
||||
for d in range(2, 1000):
|
||||
solve = diop_quadratic(x**2 - d * y**2 - 1, t)
|
||||
for i in solve:
|
||||
sol = simplify(i.subs({t: 0}))
|
||||
xx = sol[0]
|
||||
if xx > max_x:
|
||||
max_x = xx
|
||||
max_d = d
|
||||
|
||||
return max_d
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 066 is {compute()}")
|
||||
0
src/project_euler_python/__init__.py
Normal file
0
src/project_euler_python/__init__.py
Normal file
52
src/project_euler_python/create_template.py
Executable file
52
src/project_euler_python/create_template.py
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Creation of templates for the problems of Project Euler
|
||||
"""
|
||||
|
||||
import datetime
|
||||
import inspect
|
||||
from argparse import ArgumentParser
|
||||
|
||||
|
||||
def create_problem():
|
||||
with open(Problem, "w+") as f:
|
||||
template = inspect.cleandoc(
|
||||
f'''#!/usr/bin/env python
|
||||
"""
|
||||
Created on {today}
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem {(args["problem"]):0>3} from Project Euler
|
||||
https://projecteuler.net/problem={args["problem"]}
|
||||
"""
|
||||
|
||||
from utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem {(args["problem"]):0>3}")
|
||||
def compute():
|
||||
"""
|
||||
# Statement
|
||||
"""
|
||||
|
||||
# Your code goes here
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem {(args["problem"]):0>3} is {{compute()}}")
|
||||
''' # noqa: E501
|
||||
)
|
||||
|
||||
f.write(template)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
today = datetime.datetime.now().strftime("%d %b %Y")
|
||||
parser = ArgumentParser(description=__doc__)
|
||||
# Add your arguments here
|
||||
parser.add_argument("-p", "--problem", help="number of the problem to solve")
|
||||
args = vars(parser.parse_args())
|
||||
Problem = f"Problem{(args['problem']):0>3}.py"
|
||||
create_problem()
|
||||
31
src/project_euler_python/problems_001_050/Problem001.py
Normal file
31
src/project_euler_python/problems_001_050/Problem001.py
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 14 Mar 2017
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 001 of Project Euler
|
||||
https://projecteuler.net/problem=1
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 001")
|
||||
def compute():
|
||||
"""
|
||||
If we list all the natural numbers below 10 that are multiples of 3 or 5,
|
||||
we get 3, 5, 6 and 9. The sum of these multiples is 23.
|
||||
|
||||
Find the sum of all the multiples of 3 or 5 below 1000.
|
||||
"""
|
||||
|
||||
limit = 1000
|
||||
ans = sum(n for n in range(limit) if (n % 3 == 0 or n % 5 == 0))
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for problem 001: {compute()}")
|
||||
41
src/project_euler_python/problems_001_050/Problem002.py
Normal file
41
src/project_euler_python/problems_001_050/Problem002.py
Normal file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 14 Mar 2017
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 002 of Project Euler
|
||||
https://projecteuler.net/problem=2
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 002")
|
||||
def compute():
|
||||
"""
|
||||
Each new term in the Fibonacci sequence is generated by adding the
|
||||
previous two terms. By starting with 1 and 2, the first 10 terms will be:
|
||||
|
||||
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
|
||||
|
||||
Find the sum of all the even-valued terms in the sequence which do not
|
||||
exceed four million.
|
||||
"""
|
||||
|
||||
ans = 0
|
||||
limit = 4_000_000
|
||||
x, y = 1, 1
|
||||
z = x + y # Because every third Fibonacci number is even
|
||||
while z <= limit:
|
||||
ans += z
|
||||
x = y + z
|
||||
y = z + x
|
||||
z = x + y
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for problem 002: {compute()}")
|
||||
34
src/project_euler_python/problems_001_050/Problem003.py
Normal file
34
src/project_euler_python/problems_001_050/Problem003.py
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 18 Mar 2017
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 003 of Project Euler
|
||||
https://projecteuler.net/problem=3
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 003")
|
||||
def compute():
|
||||
"""
|
||||
The prime factors of 13195 are 5, 7, 13 and 29.
|
||||
|
||||
What is the largest prime factor of the number 600851475143?
|
||||
"""
|
||||
|
||||
ans = 600851475143
|
||||
factor = 2
|
||||
while factor * factor < ans:
|
||||
while ans % factor == 0:
|
||||
ans = ans // factor
|
||||
factor += 1
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for problem 003: {compute()}")
|
||||
36
src/project_euler_python/problems_001_050/Problem004.py
Normal file
36
src/project_euler_python/problems_001_050/Problem004.py
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 18 Mar 2017
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 004 of Project Euler
|
||||
https://projecteuler.net/problem=4
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 004")
|
||||
def compute():
|
||||
"""
|
||||
A palindromic number reads the same both ways. The largest palindrome made
|
||||
from the product of two 2-digit numbers is 9009 = 91 x 99.
|
||||
|
||||
Find the largest palindrome made from the product of two 3-digit numbers.
|
||||
"""
|
||||
|
||||
ans = 0
|
||||
for i in range(100, 1_000):
|
||||
for j in range(100, 1_000):
|
||||
palindrome = i * j
|
||||
s = str(palindrome)
|
||||
if s == s[::-1] and palindrome > ans:
|
||||
ans = palindrome
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for problem 004: {compute()}")
|
||||
42
src/project_euler_python/problems_001_050/Problem005.py
Normal file
42
src/project_euler_python/problems_001_050/Problem005.py
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 23 Apr 2017
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 005 of Project Euler
|
||||
https://projecteuler.net/problem=5
|
||||
"""
|
||||
|
||||
from math import gcd
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
# The LCM of two natural numbers x and y is given by:
|
||||
# def lcm(x, y):
|
||||
# return x * y // math.gcd(x, y)
|
||||
|
||||
# It is possible to compute the LCM of more than two numbers by iteratively
|
||||
# computing the LCM of two numbers, i.e. LCM(a, b, c) = LCM(a, LCM(b, c))
|
||||
|
||||
|
||||
@timeit("Problem 005")
|
||||
def compute():
|
||||
"""
|
||||
2520 is the smallest number that can be divided by each of the numbers
|
||||
from 1 to 10 without any remainder.
|
||||
|
||||
What is the smallest positive number that is evenly divisible by all of
|
||||
the numbers from 1 to 20?
|
||||
"""
|
||||
|
||||
ans = 1
|
||||
for i in range(1, 21):
|
||||
ans *= i // gcd(i, ans)
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for problem 005: {compute()}")
|
||||
40
src/project_euler_python/problems_001_050/Problem006.py
Normal file
40
src/project_euler_python/problems_001_050/Problem006.py
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 17 Jun 2017
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 006 of Project Euler
|
||||
https://projecteuler.net/problem=6
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 006")
|
||||
def compute():
|
||||
"""
|
||||
The sum of the squares of the first ten natural numbers is,
|
||||
1^2 + 2^2 + ... + 10^2 = 385
|
||||
|
||||
The square of the sum of the first ten natural numbers is,
|
||||
(1 + 2 + ... + 10)^2 = 55^2 = 3025
|
||||
|
||||
Hence the difference between the sum of the squares of the first ten
|
||||
natural numbers and the square of the sum is 3025 − 385 = 2640.
|
||||
|
||||
Find the difference between the sum of the squares of the first one
|
||||
hundred natural numbers and the square of the sum.
|
||||
"""
|
||||
|
||||
limit = 100 + 1
|
||||
square_of_sum = sum(n for n in range(limit)) ** 2
|
||||
sum_squares = sum(n**2 for n in range(limit))
|
||||
diff = square_of_sum - sum_squares
|
||||
|
||||
return diff
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 006: {compute()}")
|
||||
36
src/project_euler_python/problems_001_050/Problem007.py
Normal file
36
src/project_euler_python/problems_001_050/Problem007.py
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 28 Jun 2017
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 007 of Project Euler
|
||||
https://projecteuler.net/problem=7
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import is_prime, timeit
|
||||
|
||||
|
||||
@timeit("Problem 007")
|
||||
def compute():
|
||||
"""
|
||||
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see
|
||||
that the 6th prime is 13.
|
||||
|
||||
What is the 10001st prime number?
|
||||
"""
|
||||
|
||||
target = 10_001
|
||||
number = 2
|
||||
primes_list = []
|
||||
while len(primes_list) < target:
|
||||
if is_prime(number):
|
||||
primes_list.append(number)
|
||||
number += 1
|
||||
|
||||
return primes_list[-1]
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 007: {compute()}")
|
||||
79
src/project_euler_python/problems_001_050/Problem008.py
Normal file
79
src/project_euler_python/problems_001_050/Problem008.py
Normal file
@@ -0,0 +1,79 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 28 Abr 2017
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 008 of Project Euler
|
||||
https://projecteuler.net/problem=8
|
||||
"""
|
||||
|
||||
import collections
|
||||
from itertools import islice
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
# recipe from more-itertools
|
||||
def sliding_window(iterable, n):
|
||||
# sliding_window('ABCDEFG', 4) -> ABCD BCDE CDEF DEFG
|
||||
it = iter(iterable)
|
||||
window = collections.deque(islice(it, n), maxlen=n)
|
||||
if len(window) == n:
|
||||
yield tuple(window)
|
||||
for x in it:
|
||||
window.append(x)
|
||||
yield tuple(window)
|
||||
|
||||
|
||||
@timeit("Problem 008")
|
||||
def compute():
|
||||
"""
|
||||
The four adjacent digits in the 1000-digit number that have the
|
||||
greatest product are 9 x 9 x 8 x 9 = 5832.
|
||||
|
||||
731671...963450
|
||||
|
||||
Find the thirteen adjacent digits in the 1000-digit number that have
|
||||
the greatest product. What is the value of this product?
|
||||
"""
|
||||
|
||||
NUM = """
|
||||
73167176531330624919225119674426574742355349194934
|
||||
96983520312774506326239578318016984801869478851843
|
||||
85861560789112949495459501737958331952853208805511
|
||||
12540698747158523863050715693290963295227443043557
|
||||
66896648950445244523161731856403098711121722383113
|
||||
62229893423380308135336276614282806444486645238749
|
||||
30358907296290491560440772390713810515859307960866
|
||||
70172427121883998797908792274921901699720888093776
|
||||
65727333001053367881220235421809751254540594752243
|
||||
52584907711670556013604839586446706324415722155397
|
||||
53697817977846174064955149290862569321978468622482
|
||||
83972241375657056057490261407972968652414535100474
|
||||
82166370484403199890008895243450658541227588666881
|
||||
16427171479924442928230863465674813919123162824586
|
||||
17866458359124566529476545682848912883142607690042
|
||||
24219022671055626321111109370544217506941658960408
|
||||
07198403850962455444362981230987879927244284909188
|
||||
84580156166097919133875499200524063689912560717606
|
||||
05886116467109405077541002256983155200055935729725
|
||||
71636269561882670428252483600823257530420752963450
|
||||
"""
|
||||
|
||||
num = NUM.replace("\n", "").replace(" ", "")
|
||||
adjacent_digits = 13
|
||||
ans = 0
|
||||
for nums in sliding_window(num, adjacent_digits):
|
||||
prod = 1
|
||||
for num in nums:
|
||||
prod *= int(num)
|
||||
if prod > ans:
|
||||
ans = prod
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 008: {compute()}")
|
||||
37
src/project_euler_python/problems_001_050/Problem009.py
Normal file
37
src/project_euler_python/problems_001_050/Problem009.py
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 26 Aug 2017
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 009 of Project Euler
|
||||
https://projecteuler.net/problem=9
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 009")
|
||||
def compute():
|
||||
"""
|
||||
A Pythagorean triplet is a set of three natural numbers, a < b < c,
|
||||
for which a^2 + b^2 = c^2
|
||||
|
||||
For example, 3^2 + 4^2 = 9 + 16 = 25 = 5^2.
|
||||
|
||||
There exists exactly one Pythagorean triplet for which a + b + c = 1000.
|
||||
Find the product abc.
|
||||
"""
|
||||
|
||||
upper_limit = 1000
|
||||
for a in range(1, upper_limit + 1):
|
||||
for b in range(a + 1, upper_limit + 1):
|
||||
c = upper_limit - a - b
|
||||
if a * a + b * b == c * c:
|
||||
# It is now implied that b < c, because we have a > 0
|
||||
return a * b * c
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 009: {compute()}")
|
||||
29
src/project_euler_python/problems_001_050/Problem010.py
Normal file
29
src/project_euler_python/problems_001_050/Problem010.py
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 26 Aug 2017
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 010 of Project Euler
|
||||
https://projecteuler.net/problem=10
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import list_primes, timeit
|
||||
|
||||
|
||||
@timeit("Problem 010")
|
||||
def compute():
|
||||
"""
|
||||
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
|
||||
|
||||
Find the sum of all the primes below two million.
|
||||
"""
|
||||
|
||||
ans = sum(list_primes(1_999_999))
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 010: {compute()}")
|
||||
75
src/project_euler_python/problems_001_050/Problem011.py
Normal file
75
src/project_euler_python/problems_001_050/Problem011.py
Normal file
@@ -0,0 +1,75 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 07 Jul 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 011 of Project Euler
|
||||
https://projecteuler.net/problem=11
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
GRID = [
|
||||
[8, 2, 22, 97, 38, 15, 0, 40, 0, 75, 4, 5, 7, 78, 52, 12, 50, 77, 91, 8],
|
||||
[49, 49, 99, 40, 17, 81, 18, 57, 60, 87, 17, 40, 98, 43, 69, 48, 4, 56, 62, 0],
|
||||
[81, 49, 31, 73, 55, 79, 14, 29, 93, 71, 40, 67, 53, 88, 30, 3, 49, 13, 36, 65],
|
||||
[52, 70, 95, 23, 4, 60, 11, 42, 69, 24, 68, 56, 1, 32, 56, 71, 37, 2, 36, 91],
|
||||
[22, 31, 16, 71, 51, 67, 63, 89, 41, 92, 36, 54, 22, 40, 40, 28, 66, 33, 13, 80],
|
||||
[24, 47, 32, 60, 99, 3, 45, 2, 44, 75, 33, 53, 78, 36, 84, 20, 35, 17, 12, 50],
|
||||
[32, 98, 81, 28, 64, 23, 67, 10, 26, 38, 40, 67, 59, 54, 70, 66, 18, 38, 64, 70],
|
||||
[67, 26, 20, 68, 2, 62, 12, 20, 95, 63, 94, 39, 63, 8, 40, 91, 66, 49, 94, 21],
|
||||
[24, 55, 58, 5, 66, 73, 99, 26, 97, 17, 78, 78, 96, 83, 14, 88, 34, 89, 63, 72],
|
||||
[21, 36, 23, 9, 75, 0, 76, 44, 20, 45, 35, 14, 0, 61, 33, 97, 34, 31, 33, 95],
|
||||
[78, 17, 53, 28, 22, 75, 31, 67, 15, 94, 3, 80, 4, 62, 16, 14, 9, 53, 56, 92],
|
||||
[16, 39, 5, 42, 96, 35, 31, 47, 55, 58, 88, 24, 0, 17, 54, 24, 36, 29, 85, 57],
|
||||
[86, 56, 0, 48, 35, 71, 89, 7, 5, 44, 44, 37, 44, 60, 21, 58, 51, 54, 17, 58],
|
||||
[19, 80, 81, 68, 5, 94, 47, 69, 28, 73, 92, 13, 86, 52, 17, 77, 4, 89, 55, 40],
|
||||
[4, 52, 8, 83, 97, 35, 99, 16, 7, 97, 57, 32, 16, 26, 26, 79, 33, 27, 98, 66],
|
||||
[88, 36, 68, 87, 57, 62, 20, 72, 3, 46, 33, 67, 46, 55, 12, 32, 63, 93, 53, 69],
|
||||
[4, 42, 16, 73, 38, 25, 39, 11, 24, 94, 72, 18, 8, 46, 29, 32, 40, 62, 76, 36],
|
||||
[20, 69, 36, 41, 72, 30, 23, 88, 34, 62, 99, 69, 82, 67, 59, 85, 74, 4, 36, 16],
|
||||
[20, 73, 35, 29, 78, 31, 90, 1, 74, 31, 49, 71, 48, 86, 81, 16, 23, 57, 5, 54],
|
||||
[1, 70, 54, 71, 83, 51, 54, 69, 16, 92, 33, 48, 61, 43, 52, 1, 89, 19, 67, 48],
|
||||
]
|
||||
|
||||
|
||||
def grid_product(x, y, dx, dy, n):
|
||||
result = 1
|
||||
for i in range(n):
|
||||
result *= GRID[y + i * dy][x + i * dx]
|
||||
return result
|
||||
|
||||
|
||||
@timeit("Problem 011")
|
||||
def compute():
|
||||
"""
|
||||
In the 20x20 grid above, four numbers along a diagonal line have been
|
||||
marked in red.
|
||||
|
||||
The product of these numbers is 26 x 63 x 78 x 14 = 1788696.
|
||||
|
||||
What is the greatest product of four adjacent numbers in any direction
|
||||
(up, down, left, right, or diagonally) in the 20x20 grid?
|
||||
"""
|
||||
|
||||
ans = 0
|
||||
width = height = len(GRID)
|
||||
adjacent_nums = 4
|
||||
for y in range(height):
|
||||
for x in range(width):
|
||||
if x + adjacent_nums <= width:
|
||||
ans = max(grid_product(x, y, 1, 0, adjacent_nums), ans)
|
||||
if y + adjacent_nums <= height:
|
||||
ans = max(grid_product(x, y, 0, 1, adjacent_nums), ans)
|
||||
if x + adjacent_nums <= width and y + adjacent_nums <= height:
|
||||
ans = max(grid_product(x, y, 1, 1, adjacent_nums), ans)
|
||||
if x - adjacent_nums >= -1 and y + adjacent_nums <= height:
|
||||
ans = max(grid_product(x, y, -1, 1, adjacent_nums), ans)
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 011: {compute()}")
|
||||
66
src/project_euler_python/problems_001_050/Problem012.py
Normal file
66
src/project_euler_python/problems_001_050/Problem012.py
Normal file
@@ -0,0 +1,66 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 01 Jan 2018
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 012 of Project Euler
|
||||
https://projecteuler.net/problem=12
|
||||
"""
|
||||
|
||||
from itertools import count
|
||||
from math import floor, sqrt
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
# Returns the number of integers in the range [1, n] that divide n.
|
||||
def num_divisors(n):
|
||||
end = floor(sqrt(n))
|
||||
divs = []
|
||||
for i in range(1, end + 1):
|
||||
if n % i == 0:
|
||||
divs.append(i)
|
||||
if end**2 == n:
|
||||
divs.pop()
|
||||
return 2 * len(divs)
|
||||
|
||||
|
||||
@timeit("Problem 012")
|
||||
def compute():
|
||||
"""
|
||||
The sequence of triangle numbers is generated by adding the natural
|
||||
numbers. So the 7th triangle number would be:
|
||||
1 + 2 + 3 + 4 + 5 + 6 + 7 = 28.
|
||||
|
||||
The first ten terms would be:
|
||||
1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...
|
||||
|
||||
Let us list the factors of the first seven triangle numbers:
|
||||
|
||||
1: 1
|
||||
3: 1,3
|
||||
6: 1,2,3,6
|
||||
10: 1,2,5,10
|
||||
15: 1,3,5,15
|
||||
21: 1,3,7,21
|
||||
28: 1,2,4,7,14,28
|
||||
|
||||
We can see that 28 is the first triangle number to have over five divisors.
|
||||
|
||||
What is the value of the first triangle number to have over five hundred
|
||||
divisors?
|
||||
"""
|
||||
|
||||
triangle = 0
|
||||
for i in count(1):
|
||||
# This is the ith triangle number, i.e. num = 1 + 2 + ... + i =
|
||||
# = i*(i+1)/2
|
||||
triangle += i
|
||||
if num_divisors(triangle) > 500:
|
||||
return str(triangle)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 012: {compute()}")
|
||||
35
src/project_euler_python/problems_001_050/Problem013.py
Normal file
35
src/project_euler_python/problems_001_050/Problem013.py
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 1 Jan 2018
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 013 of Project Euler
|
||||
https://projecteuler.net/problem=13
|
||||
"""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 013")
|
||||
def compute():
|
||||
"""
|
||||
Work out the first ten digits of the sum of the following one-hundred
|
||||
50-digit numbers.
|
||||
"""
|
||||
|
||||
file = Path("files/Problem13.txt")
|
||||
with open(file) as f:
|
||||
num = f.readlines()
|
||||
ans = 0
|
||||
for line in num:
|
||||
ans += int(line)
|
||||
|
||||
return str(ans)[:10]
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 013: {compute()}")
|
||||
66
src/project_euler_python/problems_001_050/Problem014.py
Normal file
66
src/project_euler_python/problems_001_050/Problem014.py
Normal file
@@ -0,0 +1,66 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 7 Jan 2018
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 014 of Project Euler
|
||||
https://projecteuler.net/problem=14
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
def chain_length(n, terms):
|
||||
length = 0
|
||||
while n != 1:
|
||||
if n in terms:
|
||||
length += terms[n]
|
||||
break
|
||||
if n % 2 == 0:
|
||||
n = n / 2
|
||||
else:
|
||||
n = 3 * n + 1
|
||||
length += 1
|
||||
return length
|
||||
|
||||
|
||||
@timeit("Problem 014")
|
||||
def compute():
|
||||
"""
|
||||
The following iterative sequence is defined for the set of positive
|
||||
integers:
|
||||
|
||||
n → n/2 (n is even)
|
||||
n → 3n + 1 (n is odd)
|
||||
|
||||
Using the rule above and starting with 13, we generate the following
|
||||
sequence:
|
||||
|
||||
13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1
|
||||
|
||||
It can be seen that this sequence (starting at 13 and finishing at 1)
|
||||
contains 10 terms. Although it has not been proved yet (Collatz Problem),
|
||||
it is thought that all starting numbers finish at 1.
|
||||
|
||||
Which starting number, under one million, produces the longest chain?
|
||||
|
||||
NOTE: Once the chain starts the terms are allowed to go above one million.
|
||||
"""
|
||||
|
||||
ans = 0
|
||||
limit = 1_000_000
|
||||
score = 0
|
||||
terms = dict()
|
||||
for i in range(1, limit):
|
||||
terms[i] = chain_length(i, terms)
|
||||
if terms[i] > score:
|
||||
score = terms[i]
|
||||
ans = i
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 014: {compute()}")
|
||||
34
src/project_euler_python/problems_001_050/Problem015.py
Normal file
34
src/project_euler_python/problems_001_050/Problem015.py
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 7 Jan 2018
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 015 of Project Euler
|
||||
https://projecteuler.net/problem=15
|
||||
"""
|
||||
|
||||
from math import factorial
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 015")
|
||||
def compute():
|
||||
"""
|
||||
Starting in the top left corner of a 2x2 grid, and only being able to
|
||||
move to the right and down, there are exactly 6 routes to the bottom
|
||||
right corner.
|
||||
|
||||
How many such routes are there through a 20x20 grid?
|
||||
"""
|
||||
|
||||
n = 20
|
||||
ans = int(factorial(2 * n) / (factorial(n) * factorial(2 * n - n)))
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 015: {compute()}")
|
||||
30
src/project_euler_python/problems_001_050/Problem016.py
Normal file
30
src/project_euler_python/problems_001_050/Problem016.py
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 13 Jan 2018
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 016 of Project Euler
|
||||
https://projecteuler.net/problem=16
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 016")
|
||||
def compute():
|
||||
"""
|
||||
2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.
|
||||
|
||||
What is the sum of the digits of the number 2^1000?
|
||||
"""
|
||||
|
||||
n = 1000
|
||||
ans = sum(int(digit) for digit in str(2**n))
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 016: {compute()}")
|
||||
94
src/project_euler_python/problems_001_050/Problem017.py
Normal file
94
src/project_euler_python/problems_001_050/Problem017.py
Normal file
@@ -0,0 +1,94 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 13 Jan 2018
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 017 of Project Euler
|
||||
https://projecteuler.net/problem=17
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
def num_to_letters(num):
|
||||
nums = {
|
||||
0: "",
|
||||
1: "one",
|
||||
2: "two",
|
||||
3: "three",
|
||||
4: "four",
|
||||
5: "five",
|
||||
6: "six",
|
||||
7: "seven",
|
||||
8: "eight",
|
||||
9: "nine",
|
||||
10: "ten",
|
||||
11: "eleven",
|
||||
12: "twelve",
|
||||
13: "thirteen",
|
||||
14: "fourteen",
|
||||
15: "fifteen",
|
||||
16: "sixteen",
|
||||
17: "seventeen",
|
||||
18: "eighteen",
|
||||
19: "nineteen",
|
||||
20: "twenty",
|
||||
30: "thirty",
|
||||
40: "forty",
|
||||
50: "fifty",
|
||||
60: "sixty",
|
||||
70: "seventy",
|
||||
80: "eighty",
|
||||
90: "ninety",
|
||||
100: "hundred",
|
||||
1000: "thousand",
|
||||
}
|
||||
|
||||
if num <= 20:
|
||||
return len(nums[num])
|
||||
elif num < 100:
|
||||
tens, units = divmod(num, 10)
|
||||
return len(nums[tens * 10]) + num_to_letters(units)
|
||||
elif num < 1000:
|
||||
hundreds, rest = divmod(num, 100)
|
||||
if rest:
|
||||
return (
|
||||
num_to_letters(hundreds)
|
||||
+ len(nums[100])
|
||||
+ len("and")
|
||||
+ num_to_letters(rest)
|
||||
)
|
||||
else:
|
||||
return num_to_letters(hundreds) + len(nums[100])
|
||||
else:
|
||||
thousands, _ = divmod(num, 1000)
|
||||
return num_to_letters(thousands) + len(nums[1000])
|
||||
|
||||
|
||||
@timeit("Problem 017")
|
||||
def compute():
|
||||
"""
|
||||
If the numbers 1 to 5 are written out in words: one, two, three, four,
|
||||
five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.
|
||||
|
||||
If all the numbers from 1 to 1000 (one thousand) inclusive were written
|
||||
out in words, how many letters would be used?
|
||||
|
||||
NOTE: Do not count spaces or hyphens. For example, 342 (three hundred and
|
||||
forty-two) contains 23 letters and 115 (one hundred and fifteen) contains
|
||||
20 letters. The use of "and" when writing out numbers is in compliance
|
||||
with British usage.
|
||||
"""
|
||||
|
||||
n = 1000
|
||||
ans = 0
|
||||
for num in range(1, n + 1):
|
||||
ans += num_to_letters(num)
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 017: {compute()}")
|
||||
57
src/project_euler_python/problems_001_050/Problem018.py
Normal file
57
src/project_euler_python/problems_001_050/Problem018.py
Normal file
@@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 15 Sep 2018
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 018 of Project Euler
|
||||
https://projecteuler.net/problem=18
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
triangle = [
|
||||
[75],
|
||||
[95, 64],
|
||||
[17, 47, 82],
|
||||
[18, 35, 87, 10],
|
||||
[20, 4, 82, 47, 65],
|
||||
[19, 1, 23, 75, 3, 34],
|
||||
[88, 2, 77, 73, 7, 63, 67],
|
||||
[99, 65, 4, 28, 6, 16, 70, 92],
|
||||
[41, 41, 26, 56, 83, 40, 80, 70, 33],
|
||||
[41, 48, 72, 33, 47, 32, 37, 16, 94, 29],
|
||||
[53, 71, 44, 65, 25, 43, 91, 52, 97, 51, 14],
|
||||
[70, 11, 33, 28, 77, 73, 17, 78, 39, 68, 17, 57],
|
||||
[91, 71, 52, 38, 17, 14, 91, 43, 58, 50, 27, 29, 48],
|
||||
[63, 66, 4, 68, 89, 53, 67, 30, 73, 16, 69, 87, 40, 31],
|
||||
[4, 62, 98, 27, 23, 9, 70, 98, 73, 93, 38, 53, 60, 4, 23],
|
||||
]
|
||||
|
||||
|
||||
@timeit("Problem 018")
|
||||
def compute():
|
||||
"""
|
||||
By starting at the top of the triangle below and moving to adjacent
|
||||
numbers on the row below, the maximum total from top to bottom is 23.
|
||||
|
||||
3
|
||||
7 4
|
||||
2 4 6
|
||||
8 5 9 3
|
||||
|
||||
That is, 3 + 7 + 4 + 9 = 23.
|
||||
|
||||
Find the maximum total from top to bottom of the triangle above
|
||||
"""
|
||||
|
||||
for i in reversed(range(len(triangle) - 1)):
|
||||
for j in range(len(triangle[i])):
|
||||
triangle[i][j] += max(triangle[i + 1][j], triangle[i + 1][j + 1])
|
||||
|
||||
return triangle[0][0]
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 018: {compute()}")
|
||||
46
src/project_euler_python/problems_001_050/Problem019.py
Normal file
46
src/project_euler_python/problems_001_050/Problem019.py
Normal file
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 15 Sep 2018
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 019 of Project Euler
|
||||
https://projecteuler.net/problem=19
|
||||
"""
|
||||
|
||||
from datetime import date
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 019")
|
||||
def compute():
|
||||
"""
|
||||
You are given the following information, but you may prefer to do some
|
||||
research for yourself.
|
||||
|
||||
1 Jan 1900 was a Monday.
|
||||
Thirty days has September, April, June and November.
|
||||
All the rest have thirty-one,
|
||||
Saving February alone,
|
||||
Which has twenty-eight, rain or shine.
|
||||
And on leap years, twenty-nine.
|
||||
A leap year occurs on any year evenly divisible by 4, but not on a century
|
||||
unless it is divisible by 400.
|
||||
|
||||
How many Sundays fell on the first of the month during the twentieth
|
||||
century (1 Jan 1901 to 31 Dec 2000)?
|
||||
"""
|
||||
|
||||
ans = 0
|
||||
for year in range(1901, 2001):
|
||||
for month in range(1, 13):
|
||||
if date(year, month, 1).weekday() == 6:
|
||||
ans += 1
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 019: {compute()}")
|
||||
36
src/project_euler_python/problems_001_050/Problem020.py
Normal file
36
src/project_euler_python/problems_001_050/Problem020.py
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 15 Sep 2018
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 020 of Project Euler
|
||||
https://projecteuler.net/problem=20
|
||||
"""
|
||||
|
||||
from math import factorial
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 020")
|
||||
def compute():
|
||||
"""
|
||||
n! means n x (n - 1) x ... x 3 x 2 x 1
|
||||
|
||||
For example, 10! = 10 x 9 x ... x 3 x 2 x 1 = 3628800,
|
||||
and the sum of the digits in the number 10! is:
|
||||
3 + 6 + 2 + 8 + 8 + 0 + 0 = 27.
|
||||
|
||||
Find the sum of the digits in the number 100!
|
||||
"""
|
||||
|
||||
fact = factorial(100)
|
||||
ans = sum(int(digit) for digit in str(fact))
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 020: {compute()}")
|
||||
45
src/project_euler_python/problems_001_050/Problem021.py
Normal file
45
src/project_euler_python/problems_001_050/Problem021.py
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 15 Sep 2018
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 021 of Project Euler
|
||||
https://projecteuler.net/problem=21
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
def sum_divisors(n):
|
||||
return sum(i for i in range(1, n // 2 + 1) if n % i == 0)
|
||||
|
||||
|
||||
@timeit("Problem 021")
|
||||
def compute():
|
||||
"""
|
||||
Let d(n) be defined as the sum of proper divisors of n (numbers
|
||||
less than n which divide evenly into n).
|
||||
If d(a) = b and d(b) = a, where a ≠ b, then a and b are an amicable
|
||||
pair and each of a and b are called amicable numbers.
|
||||
|
||||
For example, the proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22,
|
||||
44, 55 and 110; therefore d(220) = 284. The proper divisors of 284 are
|
||||
1, 2, 4, 71 and 142; so d(284) = 220.
|
||||
|
||||
Evaluate the sum of all the amicable numbers under 10000.
|
||||
"""
|
||||
|
||||
n = 10_000
|
||||
ans = 0
|
||||
for i in range(1, n):
|
||||
value = sum_divisors(i)
|
||||
if i != value and sum_divisors(value) == i:
|
||||
ans += i
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 021: {compute()}")
|
||||
44
src/project_euler_python/problems_001_050/Problem022.py
Normal file
44
src/project_euler_python/problems_001_050/Problem022.py
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 31 Dec 2018
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 022 of Project Euler
|
||||
https://projecteuler.net/problem=22
|
||||
"""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 022")
|
||||
def compute():
|
||||
"""
|
||||
Using names.txt, a 46K text file containing over five-thousand first names,
|
||||
begin by sorting it into alphabetical order. Then working out the
|
||||
alphabetical value for each name, multiply this value by its alphabetical
|
||||
position in the list to obtain a name score.
|
||||
|
||||
For example, when the list is sorted into alphabetical order, COLIN, which
|
||||
is worth 3 + 15 + 12 + 9 + 14 = 53, is the 938th name in the list. So,
|
||||
COLIN would obtain a score of 938 x 53 = 49714.
|
||||
|
||||
What is the total of all the name scores in the file?
|
||||
"""
|
||||
|
||||
file = Path("files/Problem22.txt")
|
||||
with open(file) as f:
|
||||
names = sorted(f.read().replace('"', "").split(","))
|
||||
|
||||
ans = 0
|
||||
for idx, name in enumerate(names, 1):
|
||||
ans += sum(ord(char) - 64 for char in name) * idx
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 022: {compute()}")
|
||||
60
src/project_euler_python/problems_001_050/Problem023.py
Normal file
60
src/project_euler_python/problems_001_050/Problem023.py
Normal file
@@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 05 Jan 2019
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 023 of Project Euler
|
||||
https://projecteuler.net/problem=23
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 023")
|
||||
def compute():
|
||||
"""
|
||||
A perfect number is a number for which the sum of its proper divisors is
|
||||
exactly equal to the number. For example, the sum of the proper divisors
|
||||
of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means that 28 is a perfect
|
||||
number.
|
||||
|
||||
A number n is called deficient if the sum of its proper divisors is less
|
||||
than n and it is called abundant if this sum exceeds n.
|
||||
|
||||
As 12 is the smallest abundant number, 1 + 2 + 3 + 4 + 6 = 16, the smallest
|
||||
number that can be written as the sum of two abundant numbers is 24. By
|
||||
mathematical analysis, it can be shown that all integers greater than 28123
|
||||
can be written as the sum of two abundant numbers. However, this upper
|
||||
limit cannot be reduced any further by analysis even though it is known
|
||||
that the greatest number that cannot be expressed as the sum of two
|
||||
abundant numbers is less than this limit.
|
||||
|
||||
Find the sum of all the positive integers which cannot be written as the
|
||||
sum of two abundant numbers.
|
||||
"""
|
||||
|
||||
limit = 28124
|
||||
divisor_sum = [0] * limit
|
||||
for i in range(1, limit):
|
||||
for j in range(i * 2, limit, i):
|
||||
divisor_sum[j] += i
|
||||
|
||||
abundant_nums = [i for (i, x) in enumerate(divisor_sum) if x > i]
|
||||
|
||||
expressible = [False] * limit
|
||||
for i in abundant_nums:
|
||||
for j in abundant_nums:
|
||||
if i + j < limit:
|
||||
expressible[i + j] = True
|
||||
else:
|
||||
break
|
||||
|
||||
ans = sum(i for (i, x) in enumerate(expressible) if not x)
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 023: {compute()}")
|
||||
39
src/project_euler_python/problems_001_050/Problem024.py
Normal file
39
src/project_euler_python/problems_001_050/Problem024.py
Normal file
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 11 Sep 2019
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 024 of Project Euler
|
||||
https://projecteuler.net/problem=24
|
||||
"""
|
||||
|
||||
from itertools import permutations
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 024")
|
||||
def compute():
|
||||
"""
|
||||
A permutation is an ordered arrangement of objects. For example, 3124 is
|
||||
one possible permutation of the digits 1, 2, 3 and 4. If all of the
|
||||
permutations are listed numerically or alphabetically, we call it
|
||||
lexicographic order. The lexicographic permutations of 0, 1 and 2 are:
|
||||
|
||||
012 021 102 120 201 210
|
||||
|
||||
What is the millionth lexicographic permutation of the digits
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8 and 9?
|
||||
"""
|
||||
|
||||
digits = list(range(10))
|
||||
_permutations = list(permutations(digits))
|
||||
ans = "".join(str(digit) for digit in _permutations[999_999])
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 024: {compute()}")
|
||||
53
src/project_euler_python/problems_001_050/Problem025.py
Normal file
53
src/project_euler_python/problems_001_050/Problem025.py
Normal file
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 11 Sep 2019
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 025 of Project Euler
|
||||
https://projecteuler.net/problem=25
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 025")
|
||||
def compute():
|
||||
"""
|
||||
The Fibonacci sequence is defined by the recurrence relation:
|
||||
|
||||
Fn = Fn-1 + Fn-2, where F1 = 1 and F2 = 1.
|
||||
|
||||
Hence the first 12 terms will be:
|
||||
|
||||
F1 = 1
|
||||
F2 = 1
|
||||
F3 = 2
|
||||
F4 = 3
|
||||
F5 = 5
|
||||
F6 = 8
|
||||
F7 = 13
|
||||
F8 = 21
|
||||
F9 = 34
|
||||
F10 = 55
|
||||
F11 = 89
|
||||
F12 = 144
|
||||
|
||||
The 12th term, F12, is the first term to contain three digits.
|
||||
|
||||
What is the index of the first term in the Fibonacci sequence to
|
||||
contain 1000 digits?
|
||||
"""
|
||||
|
||||
a, b = 1, 1
|
||||
ans = 2
|
||||
while len(str(b)) < 1000:
|
||||
a, b = b, b + a
|
||||
ans += 1
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 025: {compute()}")
|
||||
53
src/project_euler_python/problems_001_050/Problem026.py
Normal file
53
src/project_euler_python/problems_001_050/Problem026.py
Normal file
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 11 Sep 2019
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 026 of Project Euler
|
||||
https://projecteuler.net/problem=26
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 026")
|
||||
def compute():
|
||||
"""
|
||||
A unit fraction contains 1 in the numerator. The decimal representation
|
||||
of the unit fractions with denominators 2 to 10 are given:
|
||||
|
||||
1/2 = 0.5
|
||||
1/3 = 0.(3)
|
||||
1/4 = 0.25
|
||||
1/5 = 0.2
|
||||
1/6 = 0.1(6)
|
||||
1/7 = 0.(142857)
|
||||
1/8 = 0.125
|
||||
1/9 = 0.(1)
|
||||
1/10 = 0.1
|
||||
|
||||
Where 0.1(6) means 0.166666..., and has a 1-digit recurring cycle.
|
||||
It can be seen that 1/7 has a 6-digit recurring cycle.
|
||||
|
||||
Find the value of d < 1000 for which 1/d contains the longest recurring
|
||||
cycle in its decimal fraction part.
|
||||
"""
|
||||
|
||||
cycle_length = 0
|
||||
ans = 0
|
||||
for number in range(3, 1000, 2):
|
||||
if number % 5 == 0:
|
||||
continue
|
||||
p = 1
|
||||
while 10**p % number != 1:
|
||||
p += 1
|
||||
if p > cycle_length:
|
||||
cycle_length, ans = p, number
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 026: {compute()}")
|
||||
59
src/project_euler_python/problems_001_050/Problem027.py
Normal file
59
src/project_euler_python/problems_001_050/Problem027.py
Normal file
@@ -0,0 +1,59 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 15 Sep 2019
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 027 of Project Euler
|
||||
https://projecteuler.net/problem=27
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import is_prime, timeit
|
||||
|
||||
|
||||
@timeit("Problem 027")
|
||||
def compute():
|
||||
"""
|
||||
Euler discovered the remarkable quadratic formula:
|
||||
|
||||
n^2 + n + 41
|
||||
|
||||
It turns out that the formula will produce 40 primes for the consecutive
|
||||
integer values 0≤n≤39. However, when n=40, 40^2+40+41=40(40+1)+41 is
|
||||
divisible by 41, and certainly when n=41,41^2+41+41 is clearly divisible
|
||||
by 41.
|
||||
|
||||
The incredible formula n^2-79n+1601 was discovered, which produces 80
|
||||
primes for the consecutive values 0≤n≤79. The product of the coefficients,
|
||||
-79 and 1601, is -126479.
|
||||
|
||||
Considering quadratics of the form:
|
||||
|
||||
n^2 + an + b
|
||||
|
||||
where |a|<1000, |b|≤1000 and |n| is the modulus/absolute value of n
|
||||
e.g. |11|=11 and |-4|=4
|
||||
|
||||
Find the product of the coefficients, a and b, for the quadratic expression
|
||||
that produces the maximum number of primes for consecutive values of n,
|
||||
starting with n=0.
|
||||
"""
|
||||
|
||||
limit = 1000
|
||||
consecutive_values = 0
|
||||
|
||||
for a in range(-999, limit):
|
||||
for b in range(limit + 1):
|
||||
n = 0
|
||||
while is_prime(abs((n**2) + (a * n) + b)):
|
||||
n += 1
|
||||
if n > consecutive_values:
|
||||
consecutive_values = n
|
||||
ans = a * b
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 027: {compute()}")
|
||||
48
src/project_euler_python/problems_001_050/Problem028.py
Normal file
48
src/project_euler_python/problems_001_050/Problem028.py
Normal file
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 3 Jan 2020
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 028 of Project Euler
|
||||
https://projecteuler.net/problem=28
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 028")
|
||||
def compute():
|
||||
"""
|
||||
Starting with the number 1 and moving to the right in a clockwise
|
||||
direction a 5 by 5 spiral is formed as follows:
|
||||
|
||||
21 22 23 24 25
|
||||
20 7 8 9 10
|
||||
19 6 1 2 11
|
||||
18 5 4 3 12
|
||||
17 16 15 14 13
|
||||
|
||||
It can be verified that the sum of the numbers on the diagonals is 101.
|
||||
|
||||
What is the sum of the numbers on the diagonals in a 1001 by 1001 spiral
|
||||
formed in the same way?
|
||||
"""
|
||||
|
||||
size = 1001 # Must be odd
|
||||
ans = 1 # Special case for size 1
|
||||
step = 0
|
||||
i, current = 1, 1
|
||||
while step < size - 1:
|
||||
step = i * 2
|
||||
for _ in range(1, 5):
|
||||
current += step
|
||||
ans += current
|
||||
i += 1
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 028: {compute()}")
|
||||
42
src/project_euler_python/problems_001_050/Problem029.py
Normal file
42
src/project_euler_python/problems_001_050/Problem029.py
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 3 Jan 2020
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 029 of Project Euler
|
||||
https://projecteuler.net/problem=29
|
||||
"""
|
||||
|
||||
from itertools import product
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 029")
|
||||
def compute():
|
||||
"""
|
||||
Consider all integer combinations of ab for 2 ≤ a ≤ 5 and 2 ≤ b ≤ 5:
|
||||
|
||||
2^2=4, 2^3=8, 2^4=16, 2^5=32
|
||||
3^2=9, 3^3=27, 3^4=81, 3^5=243
|
||||
4^2=16, 4^3=64, 4^4=256, 4^5=1024
|
||||
5^2=25, 5^3=125, 5^4=625, 5^5=3125
|
||||
|
||||
If they are then placed in numerical order, with any repeats removed, we
|
||||
get the following sequence of 15 distinct terms:
|
||||
|
||||
4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024, 3125
|
||||
|
||||
How many distinct terms are in the sequence generated by ab for 2≤a≤100
|
||||
and 2≤b≤100?
|
||||
"""
|
||||
|
||||
ans = len(set(a**b for a, b in product(range(2, 101), repeat=2)))
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 029: {compute()}")
|
||||
43
src/project_euler_python/problems_001_050/Problem030.py
Normal file
43
src/project_euler_python/problems_001_050/Problem030.py
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 3 Jan 2020
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 030 of Project Euler
|
||||
https://projecteuler.net/problem=30
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
def power_digit_sum(pow, n):
|
||||
return sum(int(c) ** pow for c in str(n))
|
||||
|
||||
|
||||
@timeit("Problem 030")
|
||||
def compute():
|
||||
"""
|
||||
Surprisingly there are only three numbers that can be written as the sum
|
||||
of fourth powers of their digits:
|
||||
|
||||
1634 = 1^4 + 6^4 + 3^4 + 4^4
|
||||
8208 = 8^4 + 2^4 + 0^4 + 8^4
|
||||
9474 = 9^4 + 4^4 + 7^4 + 4^4
|
||||
|
||||
As 1 = 14 is not a sum it is not included.
|
||||
|
||||
The sum of these numbers is 1634 + 8208 + 9474 = 19316.
|
||||
|
||||
Find the sum of all the numbers that can be written as the sum of fifth
|
||||
powers of their digits.
|
||||
"""
|
||||
|
||||
ans = sum(i for i in range(2, 1_000_000) if i == power_digit_sum(5, i))
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 030: {compute()}")
|
||||
46
src/project_euler_python/problems_001_050/Problem031.py
Normal file
46
src/project_euler_python/problems_001_050/Problem031.py
Normal file
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 24 Feb 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 031 of Project Euler
|
||||
https://projecteuler.net/problem=31
|
||||
"""
|
||||
|
||||
from itertools import product
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 031")
|
||||
def compute():
|
||||
"""
|
||||
In the United Kingdom the currency is made up of pound (£) and pence (p).
|
||||
There are eight coins in general circulation:
|
||||
|
||||
1p, 2p, 5p, 10p, 20p, 50p, £1 (100p), and £2 (200p).
|
||||
|
||||
It is possible to make £2 in the following way:
|
||||
|
||||
1x£1 + 1x50p + 2x20p + 1x5p + 1x2p + 3x1p
|
||||
|
||||
How many different ways can £2 be made using any number of coins?
|
||||
|
||||
"""
|
||||
|
||||
ans = 0
|
||||
coins = [2, 5, 10, 20, 50, 100]
|
||||
bunch_of_coins = product(*[range(0, 201, i) for i in coins])
|
||||
|
||||
for money in bunch_of_coins:
|
||||
if sum(money) <= 200:
|
||||
ans += 1
|
||||
|
||||
# consider also the case for 200 coins of 1p
|
||||
return ans + 1
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 031: {compute()}")
|
||||
44
src/project_euler_python/problems_001_050/Problem032.py
Normal file
44
src/project_euler_python/problems_001_050/Problem032.py
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 26 Feb 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 032 of Project Euler
|
||||
https://projecteuler.net/problem=32
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 032")
|
||||
def compute():
|
||||
"""
|
||||
We shall say that an n-digit number is pandigital if it makes use of all
|
||||
the digits 1 to n exactly once; for example, the 5-digit number, 15234, is
|
||||
1 through 5 pandigital.
|
||||
|
||||
The product 7254 is unusual, as the identity, 39 x 186 = 7254, containing
|
||||
multiplicand, multiplier, and product is 1 through 9 pandigital.
|
||||
|
||||
Find the sum of all products whose multiplicand/multiplier/product identity
|
||||
can be written as a 1 through 9 pandigital.
|
||||
HINT: Some products can be obtained in more than one way so be sure to only
|
||||
include it once in your sum.
|
||||
"""
|
||||
|
||||
ans = set()
|
||||
pandigital = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
|
||||
|
||||
for x in range(1, 100):
|
||||
for y in range(100, 10_000):
|
||||
# product = x * y
|
||||
if sorted(str(x) + str(y) + str(x * y)) == pandigital:
|
||||
ans.add(x * y)
|
||||
|
||||
return sum(ans)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 032: {compute()}")
|
||||
48
src/project_euler_python/problems_001_050/Problem033.py
Normal file
48
src/project_euler_python/problems_001_050/Problem033.py
Normal file
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 04 Mar 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 033 of Project Euler
|
||||
https://projecteuler.net/problem=33
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 033")
|
||||
def compute():
|
||||
"""
|
||||
The fraction 49/98 is a curious fraction, as an inexperienced mathematician
|
||||
in attempting to simplify it may incorrectly believe that 49/98 = 4/8,
|
||||
which is correct, is obtained by cancelling the 9s.
|
||||
|
||||
We shall consider fractions like, 30/50 = 3/5, to be trivial examples.
|
||||
|
||||
There are exactly four non-trivial examples of this type of fraction, less
|
||||
than one in value, and containing two digits in the numerator and
|
||||
denominator.
|
||||
|
||||
If the product of these four fractions is given in its lowest common terms,
|
||||
find the value of the denominator.
|
||||
"""
|
||||
|
||||
numerator = 1
|
||||
denominator = 1
|
||||
for x in range(10, 100):
|
||||
for y in range(10, 100):
|
||||
if x < y:
|
||||
if str(x)[1] == str(y)[0]:
|
||||
if int(str(y)[1]) != 0:
|
||||
if int(str(x)[0]) / int(str(y)[1]) == x / y:
|
||||
numerator *= x
|
||||
denominator *= y
|
||||
ans = int(denominator / numerator)
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 033: {compute()}")
|
||||
40
src/project_euler_python/problems_001_050/Problem034.py
Normal file
40
src/project_euler_python/problems_001_050/Problem034.py
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 02 Apr 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 034 of Project Euler
|
||||
https://projecteuler.net/problem=34
|
||||
"""
|
||||
|
||||
from math import factorial
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 034")
|
||||
def compute():
|
||||
"""
|
||||
145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145.
|
||||
|
||||
Find the sum of all numbers which are equal to the sum of the factorial
|
||||
of their digits.
|
||||
|
||||
Note: As 1! = 1 and 2! = 2 are not sums they are not included.
|
||||
"""
|
||||
|
||||
ans = 0
|
||||
for num in range(10, 2_540_160):
|
||||
sum_of_factorial = 0
|
||||
for digit in str(num):
|
||||
sum_of_factorial += factorial(int(digit))
|
||||
if sum_of_factorial == num:
|
||||
ans += sum_of_factorial
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 034: {compute()}")
|
||||
50
src/project_euler_python/problems_001_050/Problem035.py
Normal file
50
src/project_euler_python/problems_001_050/Problem035.py
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 02 Apr 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 035 of Project Euler
|
||||
https://projecteuler.net/problem=35
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import is_prime, timeit
|
||||
|
||||
|
||||
def circular_number(number):
|
||||
num_str = str(number)
|
||||
ans = []
|
||||
for i in range(len(num_str)):
|
||||
ans.append(int(num_str[i:] + num_str[:i]))
|
||||
return ans
|
||||
|
||||
|
||||
@timeit("Problem 035")
|
||||
def compute():
|
||||
"""
|
||||
The number, 197, is called a circular prime because all rotations of the
|
||||
digits: 197, 971, and 719, are themselves prime.
|
||||
|
||||
There are thirteen such primes below 100:
|
||||
2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, and 97.
|
||||
|
||||
How many circular primes are there below one million?
|
||||
"""
|
||||
|
||||
ans = []
|
||||
for i in range(2, 1_000_000):
|
||||
if is_prime(i):
|
||||
all_primes = True
|
||||
for j in circular_number(i):
|
||||
if not is_prime(j):
|
||||
all_primes = False
|
||||
break
|
||||
if all_primes:
|
||||
ans.append(i)
|
||||
|
||||
return len(ans)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 035: {compute()}")
|
||||
38
src/project_euler_python/problems_001_050/Problem036.py
Normal file
38
src/project_euler_python/problems_001_050/Problem036.py
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 08 Apr 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 036 of Project Euler
|
||||
https://projecteuler.net/problem=36
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
def is_palidrome(num):
|
||||
return str(num) == str(num)[::-1]
|
||||
|
||||
|
||||
@timeit("Problem 036")
|
||||
def compute():
|
||||
"""
|
||||
The decimal number, 585 = 1001001001_2 (binary), is palindromic
|
||||
in both bases.
|
||||
|
||||
Find the sum of all numbers, less than one million, which are palindromic
|
||||
in base 10 and base 2.
|
||||
"""
|
||||
|
||||
ans = 0
|
||||
for i in range(1, 1_000_001, 2):
|
||||
if is_palidrome(i) and is_palidrome(bin(i)[2:]):
|
||||
ans += i
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 036: {compute()}")
|
||||
48
src/project_euler_python/problems_001_050/Problem037.py
Normal file
48
src/project_euler_python/problems_001_050/Problem037.py
Normal file
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 09 Apr 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 037 of Project Euler
|
||||
https://projecteuler.net/problem=37
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import is_prime, list_primes, timeit
|
||||
|
||||
|
||||
def is_truncatable_prime(number):
|
||||
num_str = str(number)
|
||||
for i in range(1, len(num_str)):
|
||||
if not is_prime(int(num_str[i:])) or not is_prime(int(num_str[:-i])):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
@timeit("Problem 037")
|
||||
def compute():
|
||||
"""
|
||||
The number 3797 has an interesting property. Being prime itself, it is
|
||||
possible to continuously remove digits from left to right, and remain
|
||||
prime at each stage: 3797, 797, 97, and 7.
|
||||
Similarly we can work from right to left: 3797, 379, 37, and 3.
|
||||
|
||||
Find the sum of the only eleven primes that are both truncatable from left
|
||||
to right and right to left.
|
||||
|
||||
NOTE: 2, 3, 5, and 7 are not considered to be truncatable primes.
|
||||
"""
|
||||
|
||||
ans = 0
|
||||
primes = list_primes(1_000_000)
|
||||
# Statement of the problem says this
|
||||
for number in primes[4:]:
|
||||
if is_truncatable_prime(number):
|
||||
ans += number
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 037: {compute()}")
|
||||
53
src/project_euler_python/problems_001_050/Problem038.py
Normal file
53
src/project_euler_python/problems_001_050/Problem038.py
Normal file
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 03 Jun 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 038 of Project Euler
|
||||
https://projecteuler.net/problem=38
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 038")
|
||||
def compute():
|
||||
"""
|
||||
Take the number 192 and multiply it by each of 1, 2, and 3:
|
||||
|
||||
192 x 1 = 192
|
||||
192 x 2 = 384
|
||||
192 x 3 = 576
|
||||
|
||||
By concatenating each product we get the 1 to 9 pandigital,
|
||||
192384576. We will call 192384576 the concatenated product of
|
||||
192 and (1,2,3)
|
||||
|
||||
The same can be achieved by starting with 9 and multiplying by
|
||||
1, 2, 3, 4, and 5, giving the pandigital, 918273645, which is
|
||||
the concatenated product of 9 and (1,2,3,4,5).
|
||||
|
||||
What is the largest 1 to 9 pandigital 9-digit number that can
|
||||
be formed as the concatenated product of an integer with
|
||||
(1,2, ... , n) where n > 1?
|
||||
"""
|
||||
|
||||
ans = []
|
||||
# Number must 4 digits (exactly) to be pandigital
|
||||
# if n > 1
|
||||
for i in range(1, 10_000):
|
||||
integer = 1
|
||||
number = ""
|
||||
while len(number) < 9:
|
||||
number += str(integer * i)
|
||||
if sorted(number) == list("123456789"):
|
||||
ans.append(number)
|
||||
integer += 1
|
||||
|
||||
return max(ans)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 038: {compute()}")
|
||||
45
src/project_euler_python/problems_001_050/Problem039.py
Normal file
45
src/project_euler_python/problems_001_050/Problem039.py
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 05 Jun 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 039 of Project Euler
|
||||
https://projecteuler.net/problem=39
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 039")
|
||||
def compute():
|
||||
"""
|
||||
If p is the perimeter of a right angle triangle with integral length sides,
|
||||
{a,b,c}, there are exactly three solutions for p = 120:
|
||||
|
||||
{20,48,52}, {24,45,51}, {30,40,50}
|
||||
|
||||
For which value of p ≤ 1000, is the number of solutions maximised?
|
||||
"""
|
||||
|
||||
ans, val = 0, 0
|
||||
for p in range(2, 1001, 2):
|
||||
sol = 0
|
||||
for a in range(1, p):
|
||||
for b in range(a + 1, p - 2 * a):
|
||||
c = p - (a + b)
|
||||
if a**2 + b**2 == c**2:
|
||||
sol += 1
|
||||
elif a**2 + b**2 > c**2:
|
||||
# As we continue our innermost loop, the left side
|
||||
# gets bigger, right gets smaller, so we're done here
|
||||
break
|
||||
if sol > ans:
|
||||
ans, val = sol, p
|
||||
|
||||
return val
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 039: {compute()}")
|
||||
44
src/project_euler_python/problems_001_050/Problem040.py
Normal file
44
src/project_euler_python/problems_001_050/Problem040.py
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 23 Jun 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 040 of Project Euler
|
||||
https://projecteuler.net/problem=40
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 040")
|
||||
def compute():
|
||||
"""
|
||||
An irrational decimal fraction is created by concatenating the positive
|
||||
integers:
|
||||
|
||||
0.123456789101112131415161718192021...
|
||||
|
||||
It can be seen that the 12th digit of the fractional part is 1.
|
||||
|
||||
If d_n represents the n^th digit of the fractional part, find the value of
|
||||
the following expression.
|
||||
|
||||
d_1 x d_{10} x d_{100} x d_{1_000} x d_{10_000} x d_{100_000}
|
||||
x d_{1_000_000}
|
||||
"""
|
||||
|
||||
fraction = ""
|
||||
for i in range(1, 1_000_000):
|
||||
fraction += str(i)
|
||||
|
||||
ans = 1
|
||||
for i in range(7):
|
||||
ans *= int(fraction[10**i - 1])
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 040: {compute()}")
|
||||
40
src/project_euler_python/problems_001_050/Problem041.py
Normal file
40
src/project_euler_python/problems_001_050/Problem041.py
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 29 Jun 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 041 of Project Euler
|
||||
https://projecteuler.net/problem=41
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import is_prime, timeit
|
||||
|
||||
|
||||
def is_pandigital(number):
|
||||
number = sorted(str(number))
|
||||
check = [str(i) for i in range(1, len(number) + 1)]
|
||||
if number == check:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
@timeit("Problem 041")
|
||||
def compute():
|
||||
"""
|
||||
We shall say that an n-digit number is pandigital if it makes
|
||||
use of all the digits 1 to n exactly once. For example, 2143 is
|
||||
a 4-digit pandigital and is also prime.
|
||||
|
||||
What is the largest n-digit pandigital prime that exists?
|
||||
"""
|
||||
|
||||
for ans in range(7654321, 1, -1):
|
||||
if is_pandigital(ans):
|
||||
if is_prime(ans):
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 041: {compute()}")
|
||||
56
src/project_euler_python/problems_001_050/Problem042.py
Normal file
56
src/project_euler_python/problems_001_050/Problem042.py
Normal file
@@ -0,0 +1,56 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 26 Jul 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 042 of Project Euler
|
||||
https://projecteuler.net/problem=42
|
||||
"""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
def triangle_number(num):
|
||||
return int(0.5 * num * (num + 1))
|
||||
|
||||
|
||||
def word_to_value(word):
|
||||
return sum(ord(letter) - 64 for letter in word)
|
||||
|
||||
|
||||
@timeit("Problem 042")
|
||||
def compute():
|
||||
"""
|
||||
The nth term of the sequence of triangle numbers is given by,
|
||||
tn = n(n+1)/2; so the first ten triangle numbers are:
|
||||
|
||||
1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...
|
||||
|
||||
By converting each letter in a word to a number corresponding to its
|
||||
alphabetical position and adding these values we form a word value. For
|
||||
example, the word value for SKY is 19 + 11 + 25 = 55 = t10. If the word
|
||||
value is a triangle number then we shall call the word a triangle word.
|
||||
|
||||
Using words.txt, a 16K text file containing nearly two-thousand common
|
||||
English words, how many are triangle words?
|
||||
"""
|
||||
|
||||
triangular_numbers = [triangle_number(n) for n in range(27)]
|
||||
ans = 0
|
||||
|
||||
file = Path("files/Problem42.txt")
|
||||
with open(file) as f:
|
||||
words = f.readline().strip('"').split('","')
|
||||
for word in words:
|
||||
if word_to_value(word) in triangular_numbers:
|
||||
ans += 1
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 042: {compute()}")
|
||||
57
src/project_euler_python/problems_001_050/Problem043.py
Normal file
57
src/project_euler_python/problems_001_050/Problem043.py
Normal file
@@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 03 Aug 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 043 of Project Euler
|
||||
https://projecteuler.net/problem=43
|
||||
"""
|
||||
|
||||
from itertools import permutations
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 043")
|
||||
def compute():
|
||||
"""
|
||||
The number, 1406357289, is a 0 to 9 pandigital number because
|
||||
it is made up of each of the digits 0 to 9 in some order, but
|
||||
it also has a rather interesting sub-string divisibility property.
|
||||
|
||||
Let d1 be the 1st digit, d2 be the 2nd digit, and so on. In this
|
||||
way, we note the following:
|
||||
|
||||
d2d3d4=406 is divisible by 2
|
||||
d3d4d5=063 is divisible by 3
|
||||
d4d5d6=635 is divisible by 5
|
||||
d5d6d7=357 is divisible by 7
|
||||
d6d7d8=572 is divisible by 11
|
||||
d7d8d9=728 is divisible by 13
|
||||
d8d9d10=289 is divisible by 17
|
||||
|
||||
Find the sum of all 0 to 9 pandigital numbers with this property.
|
||||
"""
|
||||
|
||||
ans = []
|
||||
pandigital = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
|
||||
|
||||
for n in permutations(pandigital):
|
||||
n_ = "".join(n)
|
||||
if n_[0] != "0" and sorted("".join(n_)) == pandigital:
|
||||
if int(n_[7:]) % 17 == 0:
|
||||
if int(n_[6:9]) % 13 == 0:
|
||||
if int(n_[5:8]) % 11 == 0:
|
||||
if int(n_[4:7]) % 7 == 0:
|
||||
if int(n_[3:6]) % 5 == 0:
|
||||
if int(n_[2:5]) % 3 == 0:
|
||||
if int(n_[1:4]) % 2 == 0:
|
||||
ans.append(int(n_))
|
||||
|
||||
return sum(ans)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 043: {compute()}")
|
||||
52
src/project_euler_python/problems_001_050/Problem044.py
Normal file
52
src/project_euler_python/problems_001_050/Problem044.py
Normal file
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 30 Aug 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 044 of Project Euler
|
||||
https://projecteuler.net/problem=44
|
||||
"""
|
||||
|
||||
from itertools import combinations
|
||||
from operator import add, sub
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
def pentagonal(n):
|
||||
return int(n * (3 * n - 1) / 2)
|
||||
|
||||
|
||||
@timeit("Problem 044")
|
||||
def compute():
|
||||
"""
|
||||
Pentagonal numbers are generated by the formula, Pn=n(3n-1)/2.
|
||||
The first ten pentagonal numbers are:
|
||||
|
||||
1, 5, 12, 22, 35, 51, 70, 92, 117, 145, ...
|
||||
|
||||
It can be seen that P4 + P7 = 22 + 70 = 92 = P8. However, their
|
||||
difference, 70 - 22 = 48, is not pentagonal.
|
||||
|
||||
Find the pair of pentagonal numbers, Pj and Pk, for which their
|
||||
sum and difference are pentagonal and D = |Pk - Pj| is minimised.
|
||||
|
||||
What is the value of D?
|
||||
"""
|
||||
|
||||
ans = 0
|
||||
pentagonal_list = set(pentagonal(n) for n in range(1, 2500))
|
||||
pairs = combinations(pentagonal_list, 2)
|
||||
for p in pairs:
|
||||
if add(*p) in pentagonal_list and abs(sub(*p)) in pentagonal_list:
|
||||
ans = abs(sub(*p))
|
||||
# the first one found would be the smallest
|
||||
break
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 044: {compute()}")
|
||||
46
src/project_euler_python/problems_001_050/Problem045.py
Normal file
46
src/project_euler_python/problems_001_050/Problem045.py
Normal file
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 09 Sep 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 045 of Project Euler
|
||||
https://projecteuler.net/problem=45
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
def pentagonal(n):
|
||||
return int(n * (3 * n - 1) / 2)
|
||||
|
||||
|
||||
def hexagonal(n):
|
||||
return int(n * (2 * n - 1))
|
||||
|
||||
|
||||
@timeit("Problem 045")
|
||||
def compute():
|
||||
"""
|
||||
Triangle, pentagonal, and hexagonal numbers are generated by the following formulae:
|
||||
Triangle Tn=n(n+1)/2 1, 3, 6, 10, 15, ...
|
||||
Pentagonal Pn=n(3n-1)/2 1, 5, 12, 22, 35, ...
|
||||
Hexagonal Hn=n(2n-1) 1, 6, 15, 28, 45, ...
|
||||
|
||||
It can be verified that T285 = P165 = H143 = 40755.
|
||||
|
||||
Find the next triangle number that is also pentagonal and hexagonal.
|
||||
"""
|
||||
|
||||
pentagonal_list = set(pentagonal(n) for n in range(2, 100_000))
|
||||
# all hexagonal numbers are also triangle numbers!
|
||||
hexagonal_list = set(hexagonal(n) for n in range(2, 100_000))
|
||||
|
||||
ans = sorted(hexagonal_list & pentagonal_list)
|
||||
# First one is already known
|
||||
return ans[1]
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 045: {compute()}")
|
||||
49
src/project_euler_python/problems_001_050/Problem046.py
Normal file
49
src/project_euler_python/problems_001_050/Problem046.py
Normal file
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 12 Sep 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 046 of Project Euler
|
||||
https://projecteuler.net/problem=46
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import is_prime, timeit
|
||||
|
||||
|
||||
def is_goldbach(number):
|
||||
for i in range(number - 1, 1, -1):
|
||||
if is_prime(i) and ((number - i) / 2) ** 0.5 % 1 == 0:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
@timeit("Problem 046")
|
||||
def compute():
|
||||
"""
|
||||
It was proposed by Christian Goldbach that every odd composite number
|
||||
can be written as the sum of a prime and twice a square.
|
||||
|
||||
9 = 7 + 2x1^2
|
||||
15 = 7 + 2x2^2
|
||||
21 = 3 + 2x3^2
|
||||
25 = 7 + 2x3^2
|
||||
27 = 19 + 2x2^2
|
||||
33 = 31 + 2x1^2
|
||||
|
||||
It turns out that the conjecture was false.
|
||||
|
||||
What is the smallest odd composite that cannot be written as the sum
|
||||
of a prime and twice a square?
|
||||
"""
|
||||
|
||||
ans = 9
|
||||
while True:
|
||||
ans += 2
|
||||
if not is_prime(ans) and not is_goldbach(ans):
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 046: {compute()}")
|
||||
63
src/project_euler_python/problems_001_050/Problem047.py
Normal file
63
src/project_euler_python/problems_001_050/Problem047.py
Normal file
@@ -0,0 +1,63 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 12 Sep 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 047 of Project Euler
|
||||
https://projecteuler.net/problem=47
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
def factor(n):
|
||||
ans = []
|
||||
d = 2
|
||||
while d * d <= n:
|
||||
if n % d == 0:
|
||||
ans.append(d)
|
||||
n //= d
|
||||
else:
|
||||
d += 1
|
||||
if n > 1:
|
||||
ans.append(n)
|
||||
return ans
|
||||
|
||||
|
||||
@timeit("Problem 047")
|
||||
def compute():
|
||||
"""
|
||||
The first two consecutive numbers to have two distinct prime factors are:
|
||||
|
||||
14 = 2 x 7
|
||||
15 = 3 x 5
|
||||
|
||||
The first three consecutive numbers to have three distinct prime factors
|
||||
are:
|
||||
|
||||
644 = 2² x 7 x 23
|
||||
645 = 3 x 5 x 43
|
||||
646 = 2 x 17 x 19.
|
||||
|
||||
Find the first four consecutive integers to have four distinct prime
|
||||
factors each.
|
||||
|
||||
What is the first of these numbers?
|
||||
"""
|
||||
|
||||
ans = []
|
||||
for number in range(1, 1_000_000):
|
||||
if len(ans) == 4:
|
||||
break
|
||||
elif len(set(factor(number))) == 4:
|
||||
ans.append(number)
|
||||
else:
|
||||
ans = []
|
||||
|
||||
return ans[0]
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 047: {compute()}")
|
||||
30
src/project_euler_python/problems_001_050/Problem048.py
Normal file
30
src/project_euler_python/problems_001_050/Problem048.py
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 12 Sep 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 048 of Project Euler
|
||||
https://projecteuler.net/problem=48
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import timeit
|
||||
|
||||
|
||||
@timeit("Problem 048")
|
||||
def compute():
|
||||
"""
|
||||
The series, 1^1 + 2^2 + 3^3 + ... + 10^10 = 10405071317.
|
||||
|
||||
Find the last ten digits of the series, 1^1 + 2^2 + 3^3 + ... + 1000^1000.
|
||||
"""
|
||||
|
||||
series = sum(i**i for i in range(1, 1001))
|
||||
ans = str(series)[-10:]
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 048: {compute()}")
|
||||
48
src/project_euler_python/problems_001_050/Problem049.py
Normal file
48
src/project_euler_python/problems_001_050/Problem049.py
Normal file
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 18 Sep 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 049 of Project Euler
|
||||
https://projecteuler.net/problem=49
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import list_primes, timeit
|
||||
|
||||
|
||||
@timeit("Problem 049")
|
||||
def compute():
|
||||
"""
|
||||
The arithmetic sequence, 1487, 4817, 8147, in which each of the terms
|
||||
increases by 3330, is unusual in two ways:
|
||||
(i) each of the three terms are prime, and,
|
||||
(ii) each of the 4-digit numbers are permutations of one another.
|
||||
|
||||
There are no arithmetic sequences made up of three 1-, 2-, or 3-digit
|
||||
primes, exhibiting this property, but there is one other 4-digit increasing
|
||||
sequence.
|
||||
|
||||
What 12-digit number do you form by concatenating the three terms in this
|
||||
sequence?
|
||||
"""
|
||||
|
||||
ans = []
|
||||
primes_list = sorted(set(list_primes(10_000)) - set(list_primes(1_000)))
|
||||
|
||||
for number in primes_list:
|
||||
if (
|
||||
set(list(str(number)))
|
||||
== set(list(str(number + 3330)))
|
||||
== set(list(str(number + 6660)))
|
||||
):
|
||||
if number + 3330 in primes_list and number + 6660 in primes_list:
|
||||
ans.append(str(number) + str(number + 3300) + str(number + 6660))
|
||||
|
||||
# return the second one
|
||||
return ans[1]
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 049: {compute()}")
|
||||
52
src/project_euler_python/problems_001_050/Problem050.py
Normal file
52
src/project_euler_python/problems_001_050/Problem050.py
Normal file
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
Created on 18 Sep 2021
|
||||
|
||||
@author: David Doblas Jiménez
|
||||
@email: daviddoji@pm.me
|
||||
|
||||
Solution for problem 050 of Project Euler
|
||||
https://projecteuler.net/problem=50
|
||||
"""
|
||||
|
||||
from project_euler_python.utils import is_prime, list_primes, timeit
|
||||
|
||||
|
||||
@timeit("Problem 050")
|
||||
def compute():
|
||||
"""
|
||||
The prime 41, can be written as the sum of six consecutive primes:
|
||||
|
||||
41 = 2 + 3 + 5 + 7 + 11 + 13
|
||||
|
||||
This is the longest sum of consecutive primes that adds to a prime below
|
||||
one-hundred.
|
||||
|
||||
The longest sum of consecutive primes below one-thousand that adds to a
|
||||
prime, contains 21 terms, and is equal to 953.
|
||||
|
||||
Which prime, below one-million, can be written as the sum of the most
|
||||
consecutive primes?
|
||||
"""
|
||||
|
||||
ans = 0
|
||||
result = 0
|
||||
prime_list = list_primes(1_000_000)
|
||||
|
||||
for i in range(len(prime_list)):
|
||||
sum = 0
|
||||
count = 0
|
||||
for j in prime_list[i:]:
|
||||
sum += j
|
||||
count += 1
|
||||
if is_prime(sum) and count > result:
|
||||
result = count
|
||||
ans = sum
|
||||
if sum > 1_000_000:
|
||||
break
|
||||
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Result for Problem 050: {compute()}")
|
||||
54
src/project_euler_python/utils.py
Normal file
54
src/project_euler_python/utils.py
Normal file
@@ -0,0 +1,54 @@
|
||||
import math
|
||||
import time
|
||||
from functools import wraps
|
||||
|
||||
|
||||
def timeit(name):
|
||||
def profile(original):
|
||||
|
||||
@wraps(original)
|
||||
def wrapper(*args, **kwargs):
|
||||
t0 = time.perf_counter()
|
||||
result = original(*args, **kwargs)
|
||||
t1 = time.perf_counter()
|
||||
if (t1 - t0) > 1:
|
||||
print(f"Took: {(t1 - t0):.3f} s\n")
|
||||
else:
|
||||
print(f"Took: {(t1 - t0) * 1000:.3f} ms\n")
|
||||
return result
|
||||
|
||||
return wrapper
|
||||
|
||||
return profile
|
||||
|
||||
|
||||
def is_prime(n):
|
||||
if n < 2:
|
||||
return False
|
||||
for i in range(2, int(math.sqrt(n)) + 1):
|
||||
if n % i == 0:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
# Returns a list of True and False indicating whether each number is prime.
|
||||
# For 0 <= i <= n, result[i] is True if i is a prime number, False otherwise.
|
||||
def list_primality(n):
|
||||
# Sieve of Eratosthenes
|
||||
result = [True] * (n + 1)
|
||||
result[0] = result[1] = False
|
||||
for i in range(int(math.sqrt(n) + 1)):
|
||||
if result[i]:
|
||||
for j in range(i * i, len(result), i):
|
||||
result[j] = False
|
||||
return result
|
||||
|
||||
|
||||
# Returns all the prime numbers less than or equal to n, in ascending order
|
||||
# For example: list_primes(97) = [2, 3, 5, 7, 11, ..., 83, 89, 97].
|
||||
def list_primes(n):
|
||||
return [i for (i, is_prime) in enumerate(list_primality(n)) if is_prime]
|
||||
|
||||
|
||||
def is_palindrome(num):
|
||||
return str(num) == str(num)[::-1]
|
||||
@@ -29,13 +29,13 @@ def write_md(results):
|
||||
|
||||
def cache_and_save_results(func):
|
||||
@functools.wraps(func)
|
||||
@functools.lru_cache(maxsize=None)
|
||||
@functools.cache
|
||||
def wrapper(script_number):
|
||||
cache_file_name = f"{func.__name__.split('_')[1]}.json"
|
||||
num = int(script_number[-6:-3])
|
||||
|
||||
if Path(cache_file_name).exists():
|
||||
with open(cache_file_name, "r") as f:
|
||||
with open(cache_file_name) as f:
|
||||
cache = json.load(f)
|
||||
else:
|
||||
cache = {}
|
||||
|
||||
581
uv.lock
generated
Normal file
581
uv.lock
generated
Normal file
@@ -0,0 +1,581 @@
|
||||
version = 1
|
||||
revision = 3
|
||||
requires-python = ">=3.14"
|
||||
|
||||
[[package]]
|
||||
name = "attrs"
|
||||
version = "26.1.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/9a/8e/82a0fe20a541c03148528be8cac2408564a6c9a0cc7e9171802bc1d26985/attrs-26.1.0.tar.gz", hash = "sha256:d03ceb89cb322a8fd706d4fb91940737b6642aa36998fe130a9bc96c985eff32", size = 952055, upload-time = "2026-03-19T14:22:25.026Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/64/b4/17d4b0b2a2dc85a6df63d1157e028ed19f90d4cd97c36717afef2bc2f395/attrs-26.1.0-py3-none-any.whl", hash = "sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309", size = 67548, upload-time = "2026-03-19T14:22:23.645Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "beautifulsoup4"
|
||||
version = "4.14.3"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "soupsieve" },
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/c3/b0/1c6a16426d389813b48d95e26898aff79abbde42ad353958ad95cc8c9b21/beautifulsoup4-4.14.3.tar.gz", hash = "sha256:6292b1c5186d356bba669ef9f7f051757099565ad9ada5dd630bd9de5fa7fb86", size = 627737, upload-time = "2025-11-30T15:08:26.084Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/1a/39/47f9197bdd44df24d67ac8893641e16f386c984a0619ef2ee4c51fbbc019/beautifulsoup4-4.14.3-py3-none-any.whl", hash = "sha256:0918bfe44902e6ad8d57732ba310582e98da931428d231a5ecb9e7c703a735bb", size = 107721, upload-time = "2025-11-30T15:08:24.087Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cfgv"
|
||||
version = "3.5.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/4e/b5/721b8799b04bf9afe054a3899c6cf4e880fcf8563cc71c15610242490a0c/cfgv-3.5.0.tar.gz", hash = "sha256:d5b1034354820651caa73ede66a6294d6e95c1b00acc5e9b098e917404669132", size = 7334, upload-time = "2025-11-19T20:55:51.612Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/db/3c/33bac158f8ab7f89b2e59426d5fe2e4f63f7ed25df84c036890172b412b5/cfgv-3.5.0-py2.py3-none-any.whl", hash = "sha256:a8dc6b26ad22ff227d2634a65cb388215ce6cc96bbcc5cfde7641ae87e8dacc0", size = 7445, upload-time = "2025-11-19T20:55:50.744Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "chardet"
|
||||
version = "5.2.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/f3/0d/f7b6ab21ec75897ed80c17d79b15951a719226b9fababf1e40ea74d69079/chardet-5.2.0.tar.gz", hash = "sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7", size = 2069618, upload-time = "2023-08-01T19:23:02.662Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/38/6f/f5fbc992a329ee4e0f288c1fe0e2ad9485ed064cac731ed2fe47dcc38cbf/chardet-5.2.0-py3-none-any.whl", hash = "sha256:e1cf59446890a00105fe7b7912492ea04b6e6f06d4b742b2c788469e34c82970", size = 199385, upload-time = "2023-08-01T19:23:00.661Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dataproperty"
|
||||
version = "1.1.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "mbstrdecoder" },
|
||||
{ name = "typepy", extra = ["datetime"] },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/0b/81/8c8b64ae873cb9014815214c07b63b12e3b18835780fb342223cfe3fe7d8/dataproperty-1.1.0.tar.gz", hash = "sha256:b038437a4097d1a1c497695c3586ea34bea67fdd35372b9a50f30bf044d77d04", size = 42574, upload-time = "2024-12-31T14:37:26.033Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/21/c2/e12e95e289e6081a40454199ab213139ef16a528c7c86432de545b05a23a/DataProperty-1.1.0-py3-none-any.whl", hash = "sha256:c61fcb2e2deca35e6d1eb1f251a7f22f0dcde63e80e61f0cc18c19f42abfd25b", size = 27581, upload-time = "2024-12-31T14:37:22.657Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "distlib"
|
||||
version = "0.4.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/96/8e/709914eb2b5749865801041647dc7f4e6d00b549cfe88b65ca192995f07c/distlib-0.4.0.tar.gz", hash = "sha256:feec40075be03a04501a973d81f633735b4b69f98b05450592310c0f401a4e0d", size = 614605, upload-time = "2025-07-17T16:52:00.465Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/33/6b/e0547afaf41bf2c42e52430072fa5658766e3d65bd4b03a563d1b6336f57/distlib-0.4.0-py2.py3-none-any.whl", hash = "sha256:9659f7d87e46584a30b5780e43ac7a2143098441670ff0a49d5f9034c54a6c16", size = 469047, upload-time = "2025-07-17T16:51:58.613Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "filelock"
|
||||
version = "3.25.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/94/b8/00651a0f559862f3bb7d6f7477b192afe3f583cc5e26403b44e59a55ab34/filelock-3.25.2.tar.gz", hash = "sha256:b64ece2b38f4ca29dd3e810287aa8c48182bbecd1ae6e9ae126c9b35f1382694", size = 40480, upload-time = "2026-03-11T20:45:38.487Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/a4/a5/842ae8f0c08b61d6484b52f99a03510a3a72d23141942d216ebe81fefbce/filelock-3.25.2-py3-none-any.whl", hash = "sha256:ca8afb0da15f229774c9ad1b455ed96e85a81373065fb10446672f64444ddf70", size = 26759, upload-time = "2026-03-11T20:45:37.437Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "identify"
|
||||
version = "2.6.18"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/46/c4/7fb4db12296cdb11893d61c92048fe617ee853f8523b9b296ac03b43757e/identify-2.6.18.tar.gz", hash = "sha256:873ac56a5e3fd63e7438a7ecbc4d91aca692eb3fefa4534db2b7913f3fc352fd", size = 99580, upload-time = "2026-03-15T18:39:50.319Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/46/33/92ef41c6fad0233e41d3d84ba8e8ad18d1780f1e5d99b3c683e6d7f98b63/identify-2.6.18-py2.py3-none-any.whl", hash = "sha256:8db9d3c8ea9079db92cafb0ebf97abdc09d52e97f4dcf773a2e694048b7cd737", size = 99394, upload-time = "2026-03-15T18:39:48.915Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jsonschema"
|
||||
version = "4.26.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "attrs" },
|
||||
{ name = "jsonschema-specifications" },
|
||||
{ name = "referencing" },
|
||||
{ name = "rpds-py" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/b3/fc/e067678238fa451312d4c62bf6e6cf5ec56375422aee02f9cb5f909b3047/jsonschema-4.26.0.tar.gz", hash = "sha256:0c26707e2efad8aa1bfc5b7ce170f3fccc2e4918ff85989ba9ffa9facb2be326", size = 366583, upload-time = "2026-01-07T13:41:07.246Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/69/90/f63fb5873511e014207a475e2bb4e8b2e570d655b00ac19a9a0ca0a385ee/jsonschema-4.26.0-py3-none-any.whl", hash = "sha256:d489f15263b8d200f8387e64b4c3a75f06629559fb73deb8fdfb525f2dab50ce", size = 90630, upload-time = "2026-01-07T13:41:05.306Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jsonschema-specifications"
|
||||
version = "2025.9.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "referencing" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/19/74/a633ee74eb36c44aa6d1095e7cc5569bebf04342ee146178e2d36600708b/jsonschema_specifications-2025.9.1.tar.gz", hash = "sha256:b540987f239e745613c7a9176f3edb72b832a4ac465cf02712288397832b5e8d", size = 32855, upload-time = "2025-09-08T01:34:59.186Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/41/45/1a4ed80516f02155c51f51e8cedb3c1902296743db0bbc66608a0db2814f/jsonschema_specifications-2025.9.1-py3-none-any.whl", hash = "sha256:98802fee3a11ee76ecaca44429fda8a41bff98b00a0f2838151b113f210cc6fe", size = 18437, upload-time = "2025-09-08T01:34:57.871Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "librt"
|
||||
version = "0.8.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/56/9c/b4b0c54d84da4a94b37bd44151e46d5e583c9534c7e02250b961b1b6d8a8/librt-0.8.1.tar.gz", hash = "sha256:be46a14693955b3bd96014ccbdb8339ee8c9346fbe11c1b78901b55125f14c73", size = 177471, upload-time = "2026-02-17T16:13:06.101Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/c9/6a/907ef6800f7bca71b525a05f1839b21f708c09043b1c6aa77b6b827b3996/librt-0.8.1-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:6cfa7fe54fd4d1f47130017351a959fe5804bda7a0bc7e07a2cdbc3fdd28d34f", size = 66081, upload-time = "2026-02-17T16:12:12.766Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1b/18/25e991cd5640c9fb0f8d91b18797b29066b792f17bf8493da183bf5caabe/librt-0.8.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:228c2409c079f8c11fb2e5d7b277077f694cb93443eb760e00b3b83cb8b3176c", size = 68309, upload-time = "2026-02-17T16:12:13.756Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a4/36/46820d03f058cfb5a9de5940640ba03165ed8aded69e0733c417bb04df34/librt-0.8.1-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:7aae78ab5e3206181780e56912d1b9bb9f90a7249ce12f0e8bf531d0462dd0fc", size = 196804, upload-time = "2026-02-17T16:12:14.818Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/59/18/5dd0d3b87b8ff9c061849fbdb347758d1f724b9a82241aa908e0ec54ccd0/librt-0.8.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:172d57ec04346b047ca6af181e1ea4858086c80bdf455f61994c4aa6fc3f866c", size = 206907, upload-time = "2026-02-17T16:12:16.513Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d1/96/ef04902aad1424fd7299b62d1890e803e6ab4018c3044dca5922319c4b97/librt-0.8.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6b1977c4ea97ce5eb7755a78fae68d87e4102e4aaf54985e8b56806849cc06a3", size = 221217, upload-time = "2026-02-17T16:12:17.906Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6d/ff/7e01f2dda84a8f5d280637a2e5827210a8acca9a567a54507ef1c75b342d/librt-0.8.1-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:10c42e1f6fd06733ef65ae7bebce2872bcafd8d6e6b0a08fe0a05a23b044fb14", size = 214622, upload-time = "2026-02-17T16:12:19.108Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1e/8c/5b093d08a13946034fed57619742f790faf77058558b14ca36a6e331161e/librt-0.8.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:4c8dfa264b9193c4ee19113c985c95f876fae5e51f731494fc4e0cf594990ba7", size = 221987, upload-time = "2026-02-17T16:12:20.331Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d3/cc/86b0b3b151d40920ad45a94ce0171dec1aebba8a9d72bb3fa00c73ab25dd/librt-0.8.1-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:01170b6729a438f0dedc4a26ed342e3dc4f02d1000b4b19f980e1877f0c297e6", size = 215132, upload-time = "2026-02-17T16:12:21.54Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/fc/be/8588164a46edf1e69858d952654e216a9a91174688eeefb9efbb38a9c799/librt-0.8.1-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:7b02679a0d783bdae30d443025b94465d8c3dc512f32f5b5031f93f57ac32071", size = 215195, upload-time = "2026-02-17T16:12:23.073Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f5/f2/0b9279bea735c734d69344ecfe056c1ba211694a72df10f568745c899c76/librt-0.8.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:190b109bb69592a3401fe1ffdea41a2e73370ace2ffdc4a0e8e2b39cdea81b78", size = 237946, upload-time = "2026-02-17T16:12:24.275Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e9/cc/5f2a34fbc8aeb35314a3641f9956fa9051a947424652fad9882be7a97949/librt-0.8.1-cp314-cp314-win32.whl", hash = "sha256:e70a57ecf89a0f64c24e37f38d3fe217a58169d2fe6ed6d70554964042474023", size = 50689, upload-time = "2026-02-17T16:12:25.766Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a0/76/cd4d010ab2147339ca2b93e959c3686e964edc6de66ddacc935c325883d7/librt-0.8.1-cp314-cp314-win_amd64.whl", hash = "sha256:7e2f3edca35664499fbb36e4770650c4bd4a08abc1f4458eab9df4ec56389730", size = 57875, upload-time = "2026-02-17T16:12:27.465Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/84/0f/2143cb3c3ca48bd3379dcd11817163ca50781927c4537345d608b5045998/librt-0.8.1-cp314-cp314-win_arm64.whl", hash = "sha256:0d2f82168e55ddefd27c01c654ce52379c0750ddc31ee86b4b266bcf4d65f2a3", size = 48058, upload-time = "2026-02-17T16:12:28.556Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d2/0e/9b23a87e37baf00311c3efe6b48d6b6c168c29902dfc3f04c338372fd7db/librt-0.8.1-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:2c74a2da57a094bd48d03fa5d196da83d2815678385d2978657499063709abe1", size = 68313, upload-time = "2026-02-17T16:12:29.659Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/db/9a/859c41e5a4f1c84200a7d2b92f586aa27133c8243b6cac9926f6e54d01b9/librt-0.8.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:a355d99c4c0d8e5b770313b8b247411ed40949ca44e33e46a4789b9293a907ee", size = 70994, upload-time = "2026-02-17T16:12:31.516Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4c/28/10605366ee599ed34223ac2bf66404c6fb59399f47108215d16d5ad751a8/librt-0.8.1-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:2eb345e8b33fb748227409c9f1233d4df354d6e54091f0e8fc53acdb2ffedeb7", size = 220770, upload-time = "2026-02-17T16:12:33.294Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/af/8d/16ed8fd452dafae9c48d17a6bc1ee3e818fd40ef718d149a8eff2c9f4ea2/librt-0.8.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9be2f15e53ce4e83cc08adc29b26fb5978db62ef2a366fbdf716c8a6c8901040", size = 235409, upload-time = "2026-02-17T16:12:35.443Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/89/1b/7bdf3e49349c134b25db816e4a3db6b94a47ac69d7d46b1e682c2c4949be/librt-0.8.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:785ae29c1f5c6e7c2cde2c7c0e148147f4503da3abc5d44d482068da5322fd9e", size = 246473, upload-time = "2026-02-17T16:12:36.656Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4e/8a/91fab8e4fd2a24930a17188c7af5380eb27b203d72101c9cc000dbdfd95a/librt-0.8.1-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:1d3a7da44baf692f0c6aeb5b2a09c5e6fc7a703bca9ffa337ddd2e2da53f7732", size = 238866, upload-time = "2026-02-17T16:12:37.849Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b9/e0/c45a098843fc7c07e18a7f8a24ca8496aecbf7bdcd54980c6ca1aaa79a8e/librt-0.8.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5fc48998000cbc39ec0d5311312dda93ecf92b39aaf184c5e817d5d440b29624", size = 250248, upload-time = "2026-02-17T16:12:39.445Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/82/30/07627de23036640c952cce0c1fe78972e77d7d2f8fd54fa5ef4554ff4a56/librt-0.8.1-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:e96baa6820280077a78244b2e06e416480ed859bbd8e5d641cf5742919d8beb4", size = 240629, upload-time = "2026-02-17T16:12:40.889Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/fb/c1/55bfe1ee3542eba055616f9098eaf6eddb966efb0ca0f44eaa4aba327307/librt-0.8.1-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:31362dbfe297b23590530007062c32c6f6176f6099646bb2c95ab1b00a57c382", size = 239615, upload-time = "2026-02-17T16:12:42.446Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2b/39/191d3d28abc26c9099b19852e6c99f7f6d400b82fa5a4e80291bd3803e19/librt-0.8.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:cc3656283d11540ab0ea01978378e73e10002145117055e03722417aeab30994", size = 263001, upload-time = "2026-02-17T16:12:43.627Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b9/eb/7697f60fbe7042ab4e88f4ee6af496b7f222fffb0a4e3593ef1f29f81652/librt-0.8.1-cp314-cp314t-win32.whl", hash = "sha256:738f08021b3142c2918c03692608baed43bc51144c29e35807682f8070ee2a3a", size = 51328, upload-time = "2026-02-17T16:12:45.148Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7c/72/34bf2eb7a15414a23e5e70ecb9440c1d3179f393d9349338a91e2781c0fb/librt-0.8.1-cp314-cp314t-win_amd64.whl", hash = "sha256:89815a22daf9c51884fb5dbe4f1ef65ee6a146e0b6a8df05f753e2e4a9359bf4", size = 58722, upload-time = "2026-02-17T16:12:46.85Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b2/c8/d148e041732d631fc76036f8b30fae4e77b027a1e95b7a84bb522481a940/librt-0.8.1-cp314-cp314t-win_arm64.whl", hash = "sha256:bf512a71a23504ed08103a13c941f763db13fb11177beb3d9244c98c29fb4a61", size = 48755, upload-time = "2026-02-17T16:12:47.943Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mbstrdecoder"
|
||||
version = "1.1.4"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "chardet" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/31/ab/05ae008357c8bdb6245ebf8a101d99f26c096e0ea20800b318153da23796/mbstrdecoder-1.1.4.tar.gz", hash = "sha256:8105ef9cf6b7d7d69fe7fd6b68a2d8f281ca9b365d7a9b670be376b2e6c81b21", size = 14527, upload-time = "2025-01-18T10:07:31.089Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/30/ac/5ce64a1d4cce00390beab88622a290420401f1cabf05caf2fc0995157c21/mbstrdecoder-1.1.4-py3-none-any.whl", hash = "sha256:03dae4ec50ec0d2ff4743e63fdbd5e0022815857494d35224b60775d3d934a8c", size = 7933, upload-time = "2025-01-18T10:07:29.562Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mpmath"
|
||||
version = "1.3.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/e0/47/dd32fa426cc72114383ac549964eecb20ecfd886d1e5ccf5340b55b02f57/mpmath-1.3.0.tar.gz", hash = "sha256:7a28eb2a9774d00c7bc92411c19a89209d5da7c4c9a9e227be8330a23a25b91f", size = 508106, upload-time = "2023-03-07T16:47:11.061Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/43/e3/7d92a15f894aa0c9c4b49b8ee9ac9850d6e63b03c9c32c0367a13ae62209/mpmath-1.3.0-py3-none-any.whl", hash = "sha256:a0b2b9fe80bbcd81a6647ff13108738cfb482d481d826cc0e02f5b35e5c88d2c", size = 536198, upload-time = "2023-03-07T16:47:09.197Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mypy"
|
||||
version = "1.20.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "librt", marker = "platform_python_implementation != 'PyPy'" },
|
||||
{ name = "mypy-extensions" },
|
||||
{ name = "pathspec" },
|
||||
{ name = "typing-extensions" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/f8/5c/b0089fe7fef0a994ae5ee07029ced0526082c6cfaaa4c10d40a10e33b097/mypy-1.20.0.tar.gz", hash = "sha256:eb96c84efcc33f0b5e0e04beacf00129dd963b67226b01c00b9dfc8affb464c3", size = 3815028, upload-time = "2026-03-31T16:55:14.959Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/4e/0e/6ca4a84cbed9e62384bc0b2974c90395ece5ed672393e553996501625fc5/mypy-1.20.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:0f42dfaab7ec1baff3b383ad7af562ab0de573c5f6edb44b2dab016082b89948", size = 14483331, upload-time = "2026-03-31T16:52:57.999Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7d/c5/5fe9d8a729dd9605064691816243ae6c49fde0bd28f6e5e17f6a24203c43/mypy-1.20.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:31b5dbb55293c1bd27c0fc813a0d2bb5ceef9d65ac5afa2e58f829dab7921fd5", size = 13342047, upload-time = "2026-03-31T16:54:21.555Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4c/33/e18bcfa338ca4e6b2771c85d4c5203e627d0c69d9de5c1a2cf2ba13320ba/mypy-1.20.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:49d11c6f573a5a08f77fad13faff2139f6d0730ebed2cfa9b3d2702671dd7188", size = 13719585, upload-time = "2026-03-31T16:51:53.89Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6b/8d/93491ff7b79419edc7eabf95cb3b3f7490e2e574b2855c7c7e7394ff933f/mypy-1.20.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7d3243c406773185144527f83be0e0aefc7bf4601b0b2b956665608bf7c98a83", size = 14685075, upload-time = "2026-03-31T16:54:04.464Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b5/9d/d924b38a4923f8d164bf2b4ec98bf13beaf6e10a5348b4b137eadae40a6e/mypy-1.20.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:a79c1eba7ac4209f2d850f0edd0a2f8bba88cbfdfefe6fb76a19e9d4fe5e71a2", size = 14919141, upload-time = "2026-03-31T16:54:51.785Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/59/98/1da9977016678c0b99d43afe52ed00bb3c1a0c4c995d3e6acca1a6ebb9b4/mypy-1.20.0-cp314-cp314-win_amd64.whl", hash = "sha256:00e047c74d3ec6e71a2eb88e9ea551a2edb90c21f993aefa9e0d2a898e0bb732", size = 11050925, upload-time = "2026-03-31T16:51:30.758Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/5e/e3/ba0b7a3143e49a9c4f5967dde6ea4bf8e0b10ecbbcca69af84027160ee89/mypy-1.20.0-cp314-cp314-win_arm64.whl", hash = "sha256:931a7630bba591593dcf6e97224a21ff80fb357e7982628d25e3c618e7f598ef", size = 10001089, upload-time = "2026-03-31T16:49:43.632Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/12/28/e617e67b3be9d213cda7277913269c874eb26472489f95d09d89765ce2d8/mypy-1.20.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:26c8b52627b6552f47ff11adb4e1509605f094e29815323e487fc0053ebe93d1", size = 15534710, upload-time = "2026-03-31T16:52:12.506Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6e/0c/3b5f2d3e45dc7169b811adce8451679d9430399d03b168f9b0489f43adaa/mypy-1.20.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:39362cdb4ba5f916e7976fccecaab1ba3a83e35f60fa68b64e9a70e221bb2436", size = 14393013, upload-time = "2026-03-31T16:54:41.186Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a3/49/edc8b0aa145cc09c1c74f7ce2858eead9329931dcbbb26e2ad40906daa4e/mypy-1.20.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:34506397dbf40c15dc567635d18a21d33827e9ab29014fb83d292a8f4f8953b6", size = 15047240, upload-time = "2026-03-31T16:54:31.955Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/42/37/a946bb416e37a57fa752b3100fd5ede0e28df94f92366d1716555d47c454/mypy-1.20.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:555493c44a4f5a1b58d611a43333e71a9981c6dbe26270377b6f8174126a0526", size = 15858565, upload-time = "2026-03-31T16:53:36.997Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2f/99/7690b5b5b552db1bd4ff362e4c0eb3107b98d680835e65823fbe888c8b78/mypy-1.20.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:2721f0ce49cb74a38f00c50da67cb7d36317b5eda38877a49614dc018e91c787", size = 16087874, upload-time = "2026-03-31T16:52:48.313Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/aa/76/53e893a498138066acd28192b77495c9357e5a58cc4be753182846b43315/mypy-1.20.0-cp314-cp314t-win_amd64.whl", hash = "sha256:47781555a7aa5fedcc2d16bcd72e0dc83eb272c10dd657f9fb3f9cc08e2e6abb", size = 12572380, upload-time = "2026-03-31T16:49:52.454Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/76/9c/6dbdae21f01b7aacddc2c0bbf3c5557aa547827fdf271770fe1e521e7093/mypy-1.20.0-cp314-cp314t-win_arm64.whl", hash = "sha256:c70380fe5d64010f79fb863b9081c7004dd65225d2277333c219d93a10dad4dd", size = 10381174, upload-time = "2026-03-31T16:51:20.179Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/21/66/4d734961ce167f0fd8380769b3b7c06dbdd6ff54c2190f3f2ecd22528158/mypy-1.20.0-py3-none-any.whl", hash = "sha256:a6e0641147cbfa7e4e94efdb95c2dab1aff8cfc159ded13e07f308ddccc8c48e", size = 2636365, upload-time = "2026-03-31T16:51:44.911Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mypy-extensions"
|
||||
version = "1.1.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/a2/6e/371856a3fb9d31ca8dac321cda606860fa4548858c0cc45d9d1d4ca2628b/mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558", size = 6343, upload-time = "2025-04-22T14:54:24.164Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/79/7b/2c79738432f5c924bef5071f933bcc9efd0473bac3b4aa584a6f7c1c8df8/mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", size = 4963, upload-time = "2025-04-22T14:54:22.983Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nodeenv"
|
||||
version = "1.10.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/24/bf/d1bda4f6168e0b2e9e5958945e01910052158313224ada5ce1fb2e1113b8/nodeenv-1.10.0.tar.gz", hash = "sha256:996c191ad80897d076bdfba80a41994c2b47c68e224c542b48feba42ba00f8bb", size = 55611, upload-time = "2025-12-20T14:08:54.006Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/88/b2/d0896bdcdc8d28a7fc5717c305f1a861c26e18c05047949fb371034d98bd/nodeenv-1.10.0-py2.py3-none-any.whl", hash = "sha256:5bb13e3eed2923615535339b3c620e76779af4cb4c6a90deccc9e36b274d3827", size = 23438, upload-time = "2025-12-20T14:08:52.782Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "packaging"
|
||||
version = "26.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/65/ee/299d360cdc32edc7d2cf530f3accf79c4fca01e96ffc950d8a52213bd8e4/packaging-26.0.tar.gz", hash = "sha256:00243ae351a257117b6a241061796684b084ed1c516a08c48a3f7e147a9d80b4", size = 143416, upload-time = "2026-01-21T20:50:39.064Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/b7/b9/c538f279a4e237a006a2c98387d081e9eb060d203d8ed34467cc0f0b9b53/packaging-26.0-py3-none-any.whl", hash = "sha256:b36f1fef9334a5588b4166f8bcd26a14e521f2b55e6b9de3aaa80d3ff7a37529", size = 74366, upload-time = "2026-01-21T20:50:37.788Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "path"
|
||||
version = "16.16.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/96/1c/3950c87aa25437af5f1663cc8627d44ff26f8c5117a5053c9fc3f641027c/path-16.16.0.tar.gz", hash = "sha256:a6a6d916c910dc17e0ddc883358756c5a33d1b6dbdf5d6de86554f399053af58", size = 50905, upload-time = "2024-07-27T09:37:45.926Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/fb/0f/ddd60b4794cc8a8c086150e13ffbff438dbf306b2739918e65ddb706208f/path-16.16.0-py3-none-any.whl", hash = "sha256:d981989cf87598adc9f5b71ec5192d314a384836e81b4b1f34197138dc4ae659", size = 25531, upload-time = "2024-07-27T09:37:44.312Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pathspec"
|
||||
version = "1.0.4"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/fa/36/e27608899f9b8d4dff0617b2d9ab17ca5608956ca44461ac14ac48b44015/pathspec-1.0.4.tar.gz", hash = "sha256:0210e2ae8a21a9137c0d470578cb0e595af87edaa6ebf12ff176f14a02e0e645", size = 131200, upload-time = "2026-01-27T03:59:46.938Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/ef/3c/2c197d226f9ea224a9ab8d197933f9da0ae0aac5b6e0f884e2b8d9c8e9f7/pathspec-1.0.4-py3-none-any.whl", hash = "sha256:fb6ae2fd4e7c921a165808a552060e722767cfa526f99ca5156ed2ce45a5c723", size = 55206, upload-time = "2026-01-27T03:59:45.137Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pathvalidate"
|
||||
version = "2.5.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/60/f7/ff244fdd8ed98e98d4f9acecfe74a890e5e3245ce55253ef88db51e94652/pathvalidate-2.5.2.tar.gz", hash = "sha256:5ff57d0fabe5ecb7a4f1e4957bfeb5ad8ab5ab4c0fa71f79c6bbc24bd9b7d14d", size = 26715, upload-time = "2022-08-20T16:30:17.395Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/9b/62/925646456f0d72356cbef5549ff85e9b538c55ff44eb74046e37541b344a/pathvalidate-2.5.2-py3-none-any.whl", hash = "sha256:e39a4dfacdba70e3a96d3e4c6ff617a39e991cf242e6e1f2017f1f67c3408d33", size = 20296, upload-time = "2022-08-20T16:30:14.316Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "platformdirs"
|
||||
version = "4.9.4"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/19/56/8d4c30c8a1d07013911a8fdbd8f89440ef9f08d07a1b50ab8ca8be5a20f9/platformdirs-4.9.4.tar.gz", hash = "sha256:1ec356301b7dc906d83f371c8f487070e99d3ccf9e501686456394622a01a934", size = 28737, upload-time = "2026-03-05T18:34:13.271Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/63/d7/97f7e3a6abb67d8080dd406fd4df842c2be0efaf712d1c899c32a075027c/platformdirs-4.9.4-py3-none-any.whl", hash = "sha256:68a9a4619a666ea6439f2ff250c12a853cd1cbd5158d258bd824a7df6be2f868", size = 21216, upload-time = "2026-03-05T18:34:12.172Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pre-commit"
|
||||
version = "4.5.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "cfgv" },
|
||||
{ name = "identify" },
|
||||
{ name = "nodeenv" },
|
||||
{ name = "pyyaml" },
|
||||
{ name = "virtualenv" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/40/f1/6d86a29246dfd2e9b6237f0b5823717f60cad94d47ddc26afa916d21f525/pre_commit-4.5.1.tar.gz", hash = "sha256:eb545fcff725875197837263e977ea257a402056661f09dae08e4b149b030a61", size = 198232, upload-time = "2025-12-16T21:14:33.552Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/5d/19/fd3ef348460c80af7bb4669ea7926651d1f95c23ff2df18b9d24bab4f3fa/pre_commit-4.5.1-py2.py3-none-any.whl", hash = "sha256:3b3afd891e97337708c1674210f8eba659b52a38ea5f822ff142d10786221f77", size = 226437, upload-time = "2025-12-16T21:14:32.409Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "project-euler"
|
||||
version = "0.1.0"
|
||||
source = { editable = "." }
|
||||
dependencies = [
|
||||
{ name = "pytablereader" },
|
||||
{ name = "pytablewriter" },
|
||||
{ name = "sympy" },
|
||||
]
|
||||
|
||||
[package.dev-dependencies]
|
||||
dev = [
|
||||
{ name = "mypy" },
|
||||
{ name = "pre-commit" },
|
||||
{ name = "ruff" },
|
||||
]
|
||||
|
||||
[package.metadata]
|
||||
requires-dist = [
|
||||
{ name = "pytablereader", specifier = ">=0.30.0,<0.35.0" },
|
||||
{ name = "pytablewriter", specifier = ">=0.64.1,<0.65.0" },
|
||||
{ name = "sympy", specifier = ">=1.12,<2.0" },
|
||||
]
|
||||
|
||||
[package.metadata.requires-dev]
|
||||
dev = [
|
||||
{ name = "mypy", specifier = ">=1.11.0,<2.0.0" },
|
||||
{ name = "pre-commit", specifier = ">=4.0.0,<5.0.0" },
|
||||
{ name = "ruff", specifier = ">=0.6.0,<1.0.0" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pytablereader"
|
||||
version = "0.31.4"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "beautifulsoup4" },
|
||||
{ name = "dataproperty" },
|
||||
{ name = "jsonschema" },
|
||||
{ name = "mbstrdecoder" },
|
||||
{ name = "path" },
|
||||
{ name = "pathvalidate" },
|
||||
{ name = "setuptools" },
|
||||
{ name = "tabledata" },
|
||||
{ name = "typepy" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/0a/44/e42c24df7b6f1c880b5bf614112e2009ac088fee79b6bc4d1fa43789c460/pytablereader-0.31.4.tar.gz", hash = "sha256:ad97308308525cafe0eaa4b6a80a02499e0b4c6c979efb17452d302ad78bd5b1", size = 72143, upload-time = "2023-06-25T04:15:45.468Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/41/e9/eeffa7b8ce57ecfa711f1f173012705bb8b082cb547c2d68a951845ad289/pytablereader-0.31.4-py3-none-any.whl", hash = "sha256:2ce0e81b1035ba6b345cc1edbf5734780ed089fdead05c1fd12869a09cc0c3ce", size = 48446, upload-time = "2023-06-25T04:15:42.758Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pytablewriter"
|
||||
version = "0.64.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "dataproperty" },
|
||||
{ name = "mbstrdecoder" },
|
||||
{ name = "pathvalidate" },
|
||||
{ name = "setuptools" },
|
||||
{ name = "tabledata" },
|
||||
{ name = "tcolorpy" },
|
||||
{ name = "typepy", extra = ["datetime"] },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/a6/e1/50c1cd9734a9edc1386913b178f9e4757c1bc37665c1855a6596c25957d6/pytablewriter-0.64.2.tar.gz", hash = "sha256:99409d401d6ef5f06d1bc40f265a8e3053afe4cbfbaf709f71124076afb40dbb", size = 196928, upload-time = "2022-03-21T07:53:12.297Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/d0/82/093f5d0729c43c81c4bb54054f9523a75eafb855f6c4d44fe6978cec6695/pytablewriter-0.64.2-py3-none-any.whl", hash = "sha256:c46d1ddc40ef4d084213a86f8626cee33b3aa0119535aa8555da64cb5b65e382", size = 106611, upload-time = "2022-03-21T07:53:07.524Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "python-dateutil"
|
||||
version = "2.9.0.post0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "six" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/66/c0/0c8b6ad9f17a802ee498c46e004a0eb49bc148f2fd230864601a86dcf6db/python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3", size = 342432, upload-time = "2024-03-01T18:36:20.211Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892, upload-time = "2024-03-01T18:36:18.57Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "python-discovery"
|
||||
version = "1.2.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "filelock" },
|
||||
{ name = "platformdirs" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/b9/88/815e53084c5079a59df912825a279f41dd2e0df82281770eadc732f5352c/python_discovery-1.2.1.tar.gz", hash = "sha256:180c4d114bff1c32462537eac5d6a332b768242b76b69c0259c7d14b1b680c9e", size = 58457, upload-time = "2026-03-26T22:30:44.496Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/67/0f/019d3949a40280f6193b62bc010177d4ce702d0fce424322286488569cd3/python_discovery-1.2.1-py3-none-any.whl", hash = "sha256:b6a957b24c1cd79252484d3566d1b49527581d46e789aaf43181005e56201502", size = 31674, upload-time = "2026-03-26T22:30:43.396Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pytz"
|
||||
version = "2026.1.post1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/56/db/b8721d71d945e6a8ac63c0fc900b2067181dbb50805958d4d4661cf7d277/pytz-2026.1.post1.tar.gz", hash = "sha256:3378dde6a0c3d26719182142c56e60c7f9af7e968076f31aae569d72a0358ee1", size = 321088, upload-time = "2026-03-03T07:47:50.683Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/10/99/781fe0c827be2742bcc775efefccb3b048a3a9c6ce9aec0cbf4a101677e5/pytz-2026.1.post1-py2.py3-none-any.whl", hash = "sha256:f2fd16142fda348286a75e1a524be810bb05d444e5a081f37f7affc635035f7a", size = 510489, upload-time = "2026-03-03T07:47:49.167Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pyyaml"
|
||||
version = "6.0.3"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f", size = 130960, upload-time = "2025-09-25T21:33:16.546Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/9d/8c/f4bd7f6465179953d3ac9bc44ac1a8a3e6122cf8ada906b4f96c60172d43/pyyaml-6.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:8d1fab6bb153a416f9aeb4b8763bc0f22a5586065f86f7664fc23339fc1c1fac", size = 181814, upload-time = "2025-09-25T21:32:35.712Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/bd/9c/4d95bb87eb2063d20db7b60faa3840c1b18025517ae857371c4dd55a6b3a/pyyaml-6.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:34d5fcd24b8445fadc33f9cf348c1047101756fd760b4dacb5c3e99755703310", size = 173809, upload-time = "2025-09-25T21:32:36.789Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/92/b5/47e807c2623074914e29dabd16cbbdd4bf5e9b2db9f8090fa64411fc5382/pyyaml-6.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:501a031947e3a9025ed4405a168e6ef5ae3126c59f90ce0cd6f2bfc477be31b7", size = 766454, upload-time = "2025-09-25T21:32:37.966Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/02/9e/e5e9b168be58564121efb3de6859c452fccde0ab093d8438905899a3a483/pyyaml-6.0.3-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:b3bc83488de33889877a0f2543ade9f70c67d66d9ebb4ac959502e12de895788", size = 836355, upload-time = "2025-09-25T21:32:39.178Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/88/f9/16491d7ed2a919954993e48aa941b200f38040928474c9e85ea9e64222c3/pyyaml-6.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c458b6d084f9b935061bc36216e8a69a7e293a2f1e68bf956dcd9e6cbcd143f5", size = 794175, upload-time = "2025-09-25T21:32:40.865Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/dd/3f/5989debef34dc6397317802b527dbbafb2b4760878a53d4166579111411e/pyyaml-6.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7c6610def4f163542a622a73fb39f534f8c101d690126992300bf3207eab9764", size = 755228, upload-time = "2025-09-25T21:32:42.084Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d7/ce/af88a49043cd2e265be63d083fc75b27b6ed062f5f9fd6cdc223ad62f03e/pyyaml-6.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:5190d403f121660ce8d1d2c1bb2ef1bd05b5f68533fc5c2ea899bd15f4399b35", size = 789194, upload-time = "2025-09-25T21:32:43.362Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/23/20/bb6982b26a40bb43951265ba29d4c246ef0ff59c9fdcdf0ed04e0687de4d/pyyaml-6.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:4a2e8cebe2ff6ab7d1050ecd59c25d4c8bd7e6f400f5f82b96557ac0abafd0ac", size = 156429, upload-time = "2025-09-25T21:32:57.844Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f4/f4/a4541072bb9422c8a883ab55255f918fa378ecf083f5b85e87fc2b4eda1b/pyyaml-6.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:93dda82c9c22deb0a405ea4dc5f2d0cda384168e466364dec6255b293923b2f3", size = 143912, upload-time = "2025-09-25T21:32:59.247Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7c/f9/07dd09ae774e4616edf6cda684ee78f97777bdd15847253637a6f052a62f/pyyaml-6.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:02893d100e99e03eda1c8fd5c441d8c60103fd175728e23e431db1b589cf5ab3", size = 189108, upload-time = "2025-09-25T21:32:44.377Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4e/78/8d08c9fb7ce09ad8c38ad533c1191cf27f7ae1effe5bb9400a46d9437fcf/pyyaml-6.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c1ff362665ae507275af2853520967820d9124984e0f7466736aea23d8611fba", size = 183641, upload-time = "2025-09-25T21:32:45.407Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7b/5b/3babb19104a46945cf816d047db2788bcaf8c94527a805610b0289a01c6b/pyyaml-6.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6adc77889b628398debc7b65c073bcb99c4a0237b248cacaf3fe8a557563ef6c", size = 831901, upload-time = "2025-09-25T21:32:48.83Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8b/cc/dff0684d8dc44da4d22a13f35f073d558c268780ce3c6ba1b87055bb0b87/pyyaml-6.0.3-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a80cb027f6b349846a3bf6d73b5e95e782175e52f22108cfa17876aaeff93702", size = 861132, upload-time = "2025-09-25T21:32:50.149Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b1/5e/f77dc6b9036943e285ba76b49e118d9ea929885becb0a29ba8a7c75e29fe/pyyaml-6.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:00c4bdeba853cc34e7dd471f16b4114f4162dc03e6b7afcc2128711f0eca823c", size = 839261, upload-time = "2025-09-25T21:32:51.808Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ce/88/a9db1376aa2a228197c58b37302f284b5617f56a5d959fd1763fb1675ce6/pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:66e1674c3ef6f541c35191caae2d429b967b99e02040f5ba928632d9a7f0f065", size = 805272, upload-time = "2025-09-25T21:32:52.941Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/da/92/1446574745d74df0c92e6aa4a7b0b3130706a4142b2d1a5869f2eaa423c6/pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:16249ee61e95f858e83976573de0f5b2893b3677ba71c9dd36b9cf8be9ac6d65", size = 829923, upload-time = "2025-09-25T21:32:54.537Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f0/7a/1c7270340330e575b92f397352af856a8c06f230aa3e76f86b39d01b416a/pyyaml-6.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4ad1906908f2f5ae4e5a8ddfce73c320c2a1429ec52eafd27138b7f1cbe341c9", size = 174062, upload-time = "2025-09-25T21:32:55.767Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f1/12/de94a39c2ef588c7e6455cfbe7343d3b2dc9d6b6b2f40c4c6565744c873d/pyyaml-6.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:ebc55a14a21cb14062aa4162f906cd962b28e2e9ea38f9b4391244cd8de4ae0b", size = 149341, upload-time = "2025-09-25T21:32:56.828Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "referencing"
|
||||
version = "0.37.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "attrs" },
|
||||
{ name = "rpds-py" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/22/f5/df4e9027acead3ecc63e50fe1e36aca1523e1719559c499951bb4b53188f/referencing-0.37.0.tar.gz", hash = "sha256:44aefc3142c5b842538163acb373e24cce6632bd54bdb01b21ad5863489f50d8", size = 78036, upload-time = "2025-10-13T15:30:48.871Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/2c/58/ca301544e1fa93ed4f80d724bf5b194f6e4b945841c5bfd555878eea9fcb/referencing-0.37.0-py3-none-any.whl", hash = "sha256:381329a9f99628c9069361716891d34ad94af76e461dcb0335825aecc7692231", size = 26766, upload-time = "2025-10-13T15:30:47.625Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rpds-py"
|
||||
version = "0.30.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/20/af/3f2f423103f1113b36230496629986e0ef7e199d2aa8392452b484b38ced/rpds_py-0.30.0.tar.gz", hash = "sha256:dd8ff7cf90014af0c0f787eea34794ebf6415242ee1d6fa91eaba725cc441e84", size = 69469, upload-time = "2025-11-30T20:24:38.837Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/86/81/dad16382ebbd3d0e0328776d8fd7ca94220e4fa0798d1dc5e7da48cb3201/rpds_py-0.30.0-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:68f19c879420aa08f61203801423f6cd5ac5f0ac4ac82a2368a9fcd6a9a075e0", size = 362099, upload-time = "2025-11-30T20:23:27.316Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2b/60/19f7884db5d5603edf3c6bce35408f45ad3e97e10007df0e17dd57af18f8/rpds_py-0.30.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:ec7c4490c672c1a0389d319b3a9cfcd098dcdc4783991553c332a15acf7249be", size = 353192, upload-time = "2025-11-30T20:23:29.151Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/bf/c4/76eb0e1e72d1a9c4703c69607cec123c29028bff28ce41588792417098ac/rpds_py-0.30.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f251c812357a3fed308d684a5079ddfb9d933860fc6de89f2b7ab00da481e65f", size = 384080, upload-time = "2025-11-30T20:23:30.785Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/72/87/87ea665e92f3298d1b26d78814721dc39ed8d2c74b86e83348d6b48a6f31/rpds_py-0.30.0-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ac98b175585ecf4c0348fd7b29c3864bda53b805c773cbf7bfdaffc8070c976f", size = 394841, upload-time = "2025-11-30T20:23:32.209Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/77/ad/7783a89ca0587c15dcbf139b4a8364a872a25f861bdb88ed99f9b0dec985/rpds_py-0.30.0-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3e62880792319dbeb7eb866547f2e35973289e7d5696c6e295476448f5b63c87", size = 516670, upload-time = "2025-11-30T20:23:33.742Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/5b/3c/2882bdac942bd2172f3da574eab16f309ae10a3925644e969536553cb4ee/rpds_py-0.30.0-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4e7fc54e0900ab35d041b0601431b0a0eb495f0851a0639b6ef90f7741b39a18", size = 408005, upload-time = "2025-11-30T20:23:35.253Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ce/81/9a91c0111ce1758c92516a3e44776920b579d9a7c09b2b06b642d4de3f0f/rpds_py-0.30.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47e77dc9822d3ad616c3d5759ea5631a75e5809d5a28707744ef79d7a1bcfcad", size = 382112, upload-time = "2025-11-30T20:23:36.842Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/cf/8e/1da49d4a107027e5fbc64daeab96a0706361a2918da10cb41769244b805d/rpds_py-0.30.0-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:b4dc1a6ff022ff85ecafef7979a2c6eb423430e05f1165d6688234e62ba99a07", size = 399049, upload-time = "2025-11-30T20:23:38.343Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/df/5a/7ee239b1aa48a127570ec03becbb29c9d5a9eb092febbd1699d567cae859/rpds_py-0.30.0-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4559c972db3a360808309e06a74628b95eaccbf961c335c8fe0d590cf587456f", size = 415661, upload-time = "2025-11-30T20:23:40.263Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/70/ea/caa143cf6b772f823bc7929a45da1fa83569ee49b11d18d0ada7f5ee6fd6/rpds_py-0.30.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:0ed177ed9bded28f8deb6ab40c183cd1192aa0de40c12f38be4d59cd33cb5c65", size = 565606, upload-time = "2025-11-30T20:23:42.186Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/64/91/ac20ba2d69303f961ad8cf55bf7dbdb4763f627291ba3d0d7d67333cced9/rpds_py-0.30.0-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:ad1fa8db769b76ea911cb4e10f049d80bf518c104f15b3edb2371cc65375c46f", size = 591126, upload-time = "2025-11-30T20:23:44.086Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/21/20/7ff5f3c8b00c8a95f75985128c26ba44503fb35b8e0259d812766ea966c7/rpds_py-0.30.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:46e83c697b1f1c72b50e5ee5adb4353eef7406fb3f2043d64c33f20ad1c2fc53", size = 553371, upload-time = "2025-11-30T20:23:46.004Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/72/c7/81dadd7b27c8ee391c132a6b192111ca58d866577ce2d9b0ca157552cce0/rpds_py-0.30.0-cp314-cp314-win32.whl", hash = "sha256:ee454b2a007d57363c2dfd5b6ca4a5d7e2c518938f8ed3b706e37e5d470801ed", size = 215298, upload-time = "2025-11-30T20:23:47.696Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3e/d2/1aaac33287e8cfb07aab2e6b8ac1deca62f6f65411344f1433c55e6f3eb8/rpds_py-0.30.0-cp314-cp314-win_amd64.whl", hash = "sha256:95f0802447ac2d10bcc69f6dc28fe95fdf17940367b21d34e34c737870758950", size = 228604, upload-time = "2025-11-30T20:23:49.501Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e8/95/ab005315818cc519ad074cb7784dae60d939163108bd2b394e60dc7b5461/rpds_py-0.30.0-cp314-cp314-win_arm64.whl", hash = "sha256:613aa4771c99f03346e54c3f038e4cc574ac09a3ddfb0e8878487335e96dead6", size = 222391, upload-time = "2025-11-30T20:23:50.96Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9e/68/154fe0194d83b973cdedcdcc88947a2752411165930182ae41d983dcefa6/rpds_py-0.30.0-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:7e6ecfcb62edfd632e56983964e6884851786443739dbfe3582947e87274f7cb", size = 364868, upload-time = "2025-11-30T20:23:52.494Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/83/69/8bbc8b07ec854d92a8b75668c24d2abcb1719ebf890f5604c61c9369a16f/rpds_py-0.30.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:a1d0bc22a7cdc173fedebb73ef81e07faef93692b8c1ad3733b67e31e1b6e1b8", size = 353747, upload-time = "2025-11-30T20:23:54.036Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ab/00/ba2e50183dbd9abcce9497fa5149c62b4ff3e22d338a30d690f9af970561/rpds_py-0.30.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0d08f00679177226c4cb8c5265012eea897c8ca3b93f429e546600c971bcbae7", size = 383795, upload-time = "2025-11-30T20:23:55.556Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/05/6f/86f0272b84926bcb0e4c972262f54223e8ecc556b3224d281e6598fc9268/rpds_py-0.30.0-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5965af57d5848192c13534f90f9dd16464f3c37aaf166cc1da1cae1fd5a34898", size = 393330, upload-time = "2025-11-30T20:23:57.033Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/cb/e9/0e02bb2e6dc63d212641da45df2b0bf29699d01715913e0d0f017ee29438/rpds_py-0.30.0-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9a4e86e34e9ab6b667c27f3211ca48f73dba7cd3d90f8d5b11be56e5dbc3fb4e", size = 518194, upload-time = "2025-11-30T20:23:58.637Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ee/ca/be7bca14cf21513bdf9c0606aba17d1f389ea2b6987035eb4f62bd923f25/rpds_py-0.30.0-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e5d3e6b26f2c785d65cc25ef1e5267ccbe1b069c5c21b8cc724efee290554419", size = 408340, upload-time = "2025-11-30T20:24:00.2Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c2/c7/736e00ebf39ed81d75544c0da6ef7b0998f8201b369acf842f9a90dc8fce/rpds_py-0.30.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:626a7433c34566535b6e56a1b39a7b17ba961e97ce3b80ec62e6f1312c025551", size = 383765, upload-time = "2025-11-30T20:24:01.759Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4a/3f/da50dfde9956aaf365c4adc9533b100008ed31aea635f2b8d7b627e25b49/rpds_py-0.30.0-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:acd7eb3f4471577b9b5a41baf02a978e8bdeb08b4b355273994f8b87032000a8", size = 396834, upload-time = "2025-11-30T20:24:03.687Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4e/00/34bcc2565b6020eab2623349efbdec810676ad571995911f1abdae62a3a0/rpds_py-0.30.0-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:fe5fa731a1fa8a0a56b0977413f8cacac1768dad38d16b3a296712709476fbd5", size = 415470, upload-time = "2025-11-30T20:24:05.232Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/8c/28/882e72b5b3e6f718d5453bd4d0d9cf8df36fddeb4ddbbab17869d5868616/rpds_py-0.30.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:74a3243a411126362712ee1524dfc90c650a503502f135d54d1b352bd01f2404", size = 565630, upload-time = "2025-11-30T20:24:06.878Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3b/97/04a65539c17692de5b85c6e293520fd01317fd878ea1995f0367d4532fb1/rpds_py-0.30.0-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:3e8eeb0544f2eb0d2581774be4c3410356eba189529a6b3e36bbbf9696175856", size = 591148, upload-time = "2025-11-30T20:24:08.445Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/85/70/92482ccffb96f5441aab93e26c4d66489eb599efdcf96fad90c14bbfb976/rpds_py-0.30.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:dbd936cde57abfee19ab3213cf9c26be06d60750e60a8e4dd85d1ab12c8b1f40", size = 556030, upload-time = "2025-11-30T20:24:10.956Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/20/53/7c7e784abfa500a2b6b583b147ee4bb5a2b3747a9166bab52fec4b5b5e7d/rpds_py-0.30.0-cp314-cp314t-win32.whl", hash = "sha256:dc824125c72246d924f7f796b4f63c1e9dc810c7d9e2355864b3c3a73d59ade0", size = 211570, upload-time = "2025-11-30T20:24:12.735Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d0/02/fa464cdfbe6b26e0600b62c528b72d8608f5cc49f96b8d6e38c95d60c676/rpds_py-0.30.0-cp314-cp314t-win_amd64.whl", hash = "sha256:27f4b0e92de5bfbc6f86e43959e6edd1425c33b5e69aab0984a72047f2bcf1e3", size = 226532, upload-time = "2025-11-30T20:24:14.634Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ruff"
|
||||
version = "0.15.9"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/e6/97/e9f1ca355108ef7194e38c812ef40ba98c7208f47b13ad78d023caa583da/ruff-0.15.9.tar.gz", hash = "sha256:29cbb1255a9797903f6dde5ba0188c707907ff44a9006eb273b5a17bfa0739a2", size = 4617361, upload-time = "2026-04-02T18:17:20.829Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/0b/1f/9cdfd0ac4b9d1e5a6cf09bedabdf0b56306ab5e333c85c87281273e7b041/ruff-0.15.9-py3-none-linux_armv6l.whl", hash = "sha256:6efbe303983441c51975c243e26dff328aca11f94b70992f35b093c2e71801e1", size = 10511206, upload-time = "2026-04-02T18:16:41.574Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3d/f6/32bfe3e9c136b35f02e489778d94384118bb80fd92c6d92e7ccd97db12ce/ruff-0.15.9-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:4965bac6ac9ea86772f4e23587746f0b7a395eccabb823eb8bfacc3fa06069f7", size = 10923307, upload-time = "2026-04-02T18:17:08.645Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ca/25/de55f52ab5535d12e7aaba1de37a84be6179fb20bddcbe71ec091b4a3243/ruff-0.15.9-py3-none-macosx_11_0_arm64.whl", hash = "sha256:eaf05aad70ca5b5a0a4b0e080df3a6b699803916d88f006efd1f5b46302daab8", size = 10316722, upload-time = "2026-04-02T18:16:44.206Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/48/11/690d75f3fd6278fe55fff7c9eb429c92d207e14b25d1cae4064a32677029/ruff-0.15.9-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9439a342adb8725f32f92732e2bafb6d5246bd7a5021101166b223d312e8fc59", size = 10623674, upload-time = "2026-04-02T18:16:50.951Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/bd/ec/176f6987be248fc5404199255522f57af1b4a5a1b57727e942479fec98ad/ruff-0.15.9-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9c5e6faf9d97c8edc43877c3f406f47446fc48c40e1442d58cfcdaba2acea745", size = 10351516, upload-time = "2026-04-02T18:16:57.206Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b2/fc/51cffbd2b3f240accc380171d51446a32aa2ea43a40d4a45ada67368fbd2/ruff-0.15.9-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7b34a9766aeec27a222373d0b055722900fbc0582b24f39661aa96f3fe6ad901", size = 11150202, upload-time = "2026-04-02T18:17:06.452Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d6/d4/25292a6dfc125f6b6528fe6af31f5e996e19bf73ca8e3ce6eb7fa5b95885/ruff-0.15.9-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:89dd695bc72ae76ff484ae54b7e8b0f6b50f49046e198355e44ea656e521fef9", size = 11988891, upload-time = "2026-04-02T18:17:18.575Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/13/e1/1eebcb885c10e19f969dcb93d8413dfee8172578709d7ee933640f5e7147/ruff-0.15.9-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ce187224ef1de1bd225bc9a152ac7102a6171107f026e81f317e4257052916d5", size = 11480576, upload-time = "2026-04-02T18:16:52.986Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ff/6b/a1548ac378a78332a4c3dcf4a134c2475a36d2a22ddfa272acd574140b50/ruff-0.15.9-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2b0c7c341f68adb01c488c3b7d4b49aa8ea97409eae6462d860a79cf55f431b6", size = 11254525, upload-time = "2026-04-02T18:17:02.041Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/42/aa/4bb3af8e61acd9b1281db2ab77e8b2c3c5e5599bf2a29d4a942f1c62b8d6/ruff-0.15.9-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:55cc15eee27dc0eebdfcb0d185a6153420efbedc15eb1d38fe5e685657b0f840", size = 11204072, upload-time = "2026-04-02T18:17:13.581Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/69/48/d550dc2aa6e423ea0bcc1d0ff0699325ffe8a811e2dba156bd80750b86dc/ruff-0.15.9-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:a6537f6eed5cda688c81073d46ffdfb962a5f29ecb6f7e770b2dc920598997ed", size = 10594998, upload-time = "2026-04-02T18:16:46.369Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/63/47/321167e17f5344ed5ec6b0aa2cff64efef5f9e985af8f5622cfa6536043f/ruff-0.15.9-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:6d3fcbca7388b066139c523bda744c822258ebdcfbba7d24410c3f454cc9af71", size = 10359769, upload-time = "2026-04-02T18:17:10.994Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/67/5e/074f00b9785d1d2c6f8c22a21e023d0c2c1817838cfca4c8243200a1fa87/ruff-0.15.9-py3-none-musllinux_1_2_i686.whl", hash = "sha256:058d8e99e1bfe79d8a0def0b481c56059ee6716214f7e425d8e737e412d69677", size = 10850236, upload-time = "2026-04-02T18:16:48.749Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/76/37/804c4135a2a2caf042925d30d5f68181bdbd4461fd0d7739da28305df593/ruff-0.15.9-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:8e1ddb11dbd61d5983fa2d7d6370ef3eb210951e443cace19594c01c72abab4c", size = 11358343, upload-time = "2026-04-02T18:16:55.068Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/88/3d/1364fcde8656962782aa9ea93c92d98682b1ecec2f184e625a965ad3b4a6/ruff-0.15.9-py3-none-win32.whl", hash = "sha256:bde6ff36eaf72b700f32b7196088970bf8fdb2b917b7accd8c371bfc0fd573ec", size = 10583382, upload-time = "2026-04-02T18:17:04.261Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4c/56/5c7084299bd2cacaa07ae63a91c6f4ba66edc08bf28f356b24f6b717c799/ruff-0.15.9-py3-none-win_amd64.whl", hash = "sha256:45a70921b80e1c10cf0b734ef09421f71b5aa11d27404edc89d7e8a69505e43d", size = 11744969, upload-time = "2026-04-02T18:16:59.611Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/03/36/76704c4f312257d6dbaae3c959add2a622f63fcca9d864659ce6d8d97d3d/ruff-0.15.9-py3-none-win_arm64.whl", hash = "sha256:0694e601c028fd97dc5c6ee244675bc241aeefced7ef80cd9c6935a871078f53", size = 11005870, upload-time = "2026-04-02T18:17:15.773Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "setuptools"
|
||||
version = "82.0.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/4f/db/cfac1baf10650ab4d1c111714410d2fbb77ac5a616db26775db562c8fab2/setuptools-82.0.1.tar.gz", hash = "sha256:7d872682c5d01cfde07da7bccc7b65469d3dca203318515ada1de5eda35efbf9", size = 1152316, upload-time = "2026-03-09T12:47:17.221Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/9d/76/f789f7a86709c6b087c5a2f52f911838cad707cc613162401badc665acfe/setuptools-82.0.1-py3-none-any.whl", hash = "sha256:a59e362652f08dcd477c78bb6e7bd9d80a7995bc73ce773050228a348ce2e5bb", size = 1006223, upload-time = "2026-03-09T12:47:15.026Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "six"
|
||||
version = "1.17.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/94/e7/b2c673351809dca68a0e064b6af791aa332cf192da575fd474ed7d6f16a2/six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81", size = 34031, upload-time = "2024-12-04T17:35:28.174Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", size = 11050, upload-time = "2024-12-04T17:35:26.475Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "soupsieve"
|
||||
version = "2.8.3"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/7b/ae/2d9c981590ed9999a0d91755b47fc74f74de286b0f5cee14c9269041e6c4/soupsieve-2.8.3.tar.gz", hash = "sha256:3267f1eeea4251fb42728b6dfb746edc9acaffc4a45b27e19450b676586e8349", size = 118627, upload-time = "2026-01-20T04:27:02.457Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/46/2c/1462b1d0a634697ae9e55b3cecdcb64788e8b7d63f54d923fcd0bb140aed/soupsieve-2.8.3-py3-none-any.whl", hash = "sha256:ed64f2ba4eebeab06cc4962affce381647455978ffc1e36bb79a545b91f45a95", size = 37016, upload-time = "2026-01-20T04:27:01.012Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sympy"
|
||||
version = "1.14.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "mpmath" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/83/d3/803453b36afefb7c2bb238361cd4ae6125a569b4db67cd9e79846ba2d68c/sympy-1.14.0.tar.gz", hash = "sha256:d3d3fe8df1e5a0b42f0e7bdf50541697dbe7d23746e894990c030e2b05e72517", size = 7793921, upload-time = "2025-04-27T18:05:01.611Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/a2/09/77d55d46fd61b4a135c444fc97158ef34a095e5681d0a6c10b75bf356191/sympy-1.14.0-py3-none-any.whl", hash = "sha256:e091cc3e99d2141a0ba2847328f5479b05d94a6635cb96148ccb3f34671bd8f5", size = 6299353, upload-time = "2025-04-27T18:04:59.103Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tabledata"
|
||||
version = "1.3.4"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "dataproperty" },
|
||||
{ name = "typepy" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/b2/35/171c8977162f1163368406deddde4c59673b62bd0cb2f34948a02effb075/tabledata-1.3.4.tar.gz", hash = "sha256:e9649cab129d718f3bff4150083b77f8a78c30f6634a30caf692b10fdc60cb97", size = 25074, upload-time = "2024-12-31T14:12:31.198Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/08/64/fa4160151976ee4b2cf0c1217a99443ffaeb991956feddfeac9eee9952f8/tabledata-1.3.4-py3-none-any.whl", hash = "sha256:1f56e433bfdeb89f4487abfa48c4603a3b07c5d3a3c7e05ff73dd018c24bd0d4", size = 11820, upload-time = "2024-12-31T14:12:28.584Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tcolorpy"
|
||||
version = "0.1.7"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/80/cc/44f2d81d8f9093aad81c3467a5bf5718d2b5f786e887b6e4adcfc17ec6b9/tcolorpy-0.1.7.tar.gz", hash = "sha256:0fbf6bf238890bbc2e32662aa25736769a29bf6d880328f310c910a327632614", size = 299437, upload-time = "2024-12-29T15:24:23.847Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/05/a2/ed023f2edd1e011b4d99b6727bce8253842d66c3fbf9ed0a26fc09a92571/tcolorpy-0.1.7-py3-none-any.whl", hash = "sha256:26a59d52027e175a37e0aba72efc99dda43f074db71f55b316d3de37d3251378", size = 8096, upload-time = "2024-12-29T15:24:21.33Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typepy"
|
||||
version = "1.3.4"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "mbstrdecoder" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/79/59/4c39942077d7de285f762a91024dbda731be693591732977358f77d120fb/typepy-1.3.4.tar.gz", hash = "sha256:89c1f66de6c6133209c43a94d23431d320ba03ef5db18f241091ea594035d9de", size = 39558, upload-time = "2024-12-29T09:18:15.774Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/ee/31/e393c3830bdedd01735bd195c85ac3034b6bcaf6c18142bab60a4047ca36/typepy-1.3.4-py3-none-any.whl", hash = "sha256:d5ed3e0c7f49521bff0603dd08cf8d453371cf68d65a29d3d0038552ccc46e2e", size = 31449, upload-time = "2024-12-29T09:18:13.135Z" },
|
||||
]
|
||||
|
||||
[package.optional-dependencies]
|
||||
datetime = [
|
||||
{ name = "packaging" },
|
||||
{ name = "python-dateutil" },
|
||||
{ name = "pytz" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typing-extensions"
|
||||
version = "4.15.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "virtualenv"
|
||||
version = "21.2.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "distlib" },
|
||||
{ name = "filelock" },
|
||||
{ name = "platformdirs" },
|
||||
{ name = "python-discovery" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/aa/92/58199fe10049f9703c2666e809c4f686c54ef0a68b0f6afccf518c0b1eb9/virtualenv-21.2.0.tar.gz", hash = "sha256:1720dc3a62ef5b443092e3f499228599045d7fea4c79199770499df8becf9098", size = 5840618, upload-time = "2026-03-09T17:24:38.013Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/c6/59/7d02447a55b2e55755011a647479041bc92a82e143f96a8195cb33bd0a1c/virtualenv-21.2.0-py3-none-any.whl", hash = "sha256:1bd755b504931164a5a496d217c014d098426cddc79363ad66ac78125f9d908f", size = 5825084, upload-time = "2026-03-09T17:24:35.378Z" },
|
||||
]
|
||||
Reference in New Issue
Block a user