Skip to content

Instantly share code, notes, and snippets.

@Radcliffe
Radcliffe / count_knots_with_arf_zero.py
Created January 16, 2023 00:58
Count knots with Arf invariant zero by crossing number
import csv
import requests
from collections import Counter
import json
url = 'https://raw.githubusercontent.com/soehms/database_knotinfo/main/database_knotinfo/csv_data/knotinfo_data_complete.csv'
with requests.Session() as session:
download = session.get(url)
decoded = download.content.decode('utf-8')
@Radcliffe
Radcliffe / euler-conjecture.py
Created June 27, 2023 22:15
Counterexample to Euler's conjecture on sums of powers
"""
In 1769, Euler conjectured that it was impossible to express an nth power as the sum of fewer than
n nth powers of positive integers. For example, the sum of two cubes is not a cube, the sum of three
fourth powers is not a fourth power, and so on.
In 1966, L. J. Lander and T. R. Parkin found a counterexample: 27^5 + 84^5 + 110^5 + 133^5 = 144^5.
They performed a computer search using a CDC 6600. This was a massive computation for its time, but
it's easy for modern computers.
The following Python script searches for positive integer solutions to a^5 + b^5 + c^5 + d^5 = e^5
@Radcliffe
Radcliffe / unit-fractions.py
Created November 1, 2023 17:05
Express a positive rational as a sum of unit fractions
from fractions import Fraction
import sys
"""
Represent a positive rational number as the sum of exactly k unit fractions, distinct or not.
This function returns the first solution in lexicographic order, represented as a list of denominators.
If no solution exists, the function returns None.
We can use the following observation to limit the search space to a finite number of possibilities.
Suppose that r = 1/n_1 + 1/n_2 + ... + 1/n_k, where n_1 ≤ n_2 ≤ ... ≤ n_k.
@Radcliffe
Radcliffe / minnesota-flag-2024.svg
Created December 30, 2023 01:30
New Minnesota flag (2024) in SVG format
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Radcliffe
Radcliffe / ccss.csv
Created January 21, 2024 02:40 — forked from philngo/ccss.csv
Common Core State Standards CSV
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 8 columns, instead of 7 in line 7.
id,content_type,category_id,category_name,grade_id,grade_name,item,description
CCSS.ELA-LITERACY.L.K.1,ELA-LITERACY,L,Language,K,Kindergarten,1,Demonstrate command of the conventions of standard English grammar and usage when writing or speaking.
CCSS.ELA-LITERACY.L.K.1.a,ELA-LITERACY,L,Language,K,Kindergarten,1a,Print many upper- and lowercase letters.
CCSS.ELA-LITERACY.L.K.1.b,ELA-LITERACY,L,Language,K,Kindergarten,1b,Use frequently occurring nouns and verbs.
CCSS.ELA-LITERACY.L.K.1.c,ELA-LITERACY,L,Language,K,Kindergarten,1c,"Form regular plural nouns orally by adding /s/ or /es/ (e.g., dog, dogs; wish, wishes)."
CCSS.ELA-LITERACY.L.K.1.d,ELA-LITERACY,L,Language,K,Kindergarten,1d,"Understand and use question words (interrogatives) (e.g., who, what, where, when, why, how)."
CCSS.ELA-LITERACY.L.K.1.e,ELA-LITERACY,L,Language,K,Kindergarten,1e,"Use the most frequently occurring prepositions (e.g., to, from, in, out, on, off, for, of, by, with)."
CCSS.ELA-LITERACY.L.K.1.f,ELA-LITERACY,L,Language,K,Kindergarten,
@Radcliffe
Radcliffe / k_plus_sigma_k_is_perfect.py
Last active March 10, 2025 18:15
k + sigma(k) is perfect
"""
The number 10 has a special property. When 10 is added to the sum
of its divisors, the result is 28, which is a perfect number.
10 + sigma(10) = 10 + 1 + 2 + 5 + 10 = 28
Are there other perfect numbers that can be expressed as the sum
of a number and the sum of its divisors?