This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
James Tanton @jamestanton asked: | |
Is there a power of three whose digits can be rearranged to form | |
another power of three? | |
(https://twitter.com/jamestanton/status/676773021223272448) | |
The following Python script searches for examples. There is no power | |
of three, less than 3^200000, whose digits can be rearranged to form | |
another power of three. | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Problem: | |
Arrange the numbers from 1 to m*n in an m-by-n grid so that | |
no two consecutive numbers are placed in adjacent cells. | |
In how many ways can this be done? Two squares are considered | |
touching if they share a corner. | |
Example: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import log, sqrt, pi, e | |
from scipy.special import lambertw | |
fomm numpy import real | |
# http://mathforum.org/kb/message.jspa?messageID=342551&tstart=0 | |
def invfactorial(n): | |
""" Approximate inverse factorial""" | |
L = log((x + .036534) / sqrt(2*pi)) | |
return real(L/W(L/e) - .5) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ZIP Code,County | |
55001,Washington County | |
55003,Washington County | |
55005,Anoka County | |
55010,Dakota County | |
55011,Anoka County | |
55014,Anoka County | |
55016,Washington County | |
55020,Scott County | |
55024,Dakota County |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python script to list the titles and running times of the videos | |
# in a YouTube playlist. | |
# Note: Only works for up to 100 videos. TODO: Fix this bug. | |
# The playlist id can be found in the playlist's URL. | |
playlist_id = "PLt5AfwLFPxWLNZRKWlcRmTABh_SExiiCj" | |
from lxml import html | |
import requests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This Python script generates a directed graph with | |
# vertex set V = {0, 1, 2, ..., m-1} and edge set | |
# E = {(n, f(n)) : n in V} where f(n) = n*n + c (mod m). | |
# | |
# Requires the python-igraph package (http://igraph.org/python/) | |
# | |
# Author: David Radcliffe (14 February 2014) | |
# Based on an idea of James Tanton | |
# https://twitter.com/jamestanton/status/549558473868849152 | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Problem: Arrange the consecutive digits {x,x+1,..,y} to form two numbers A and B | |
# so that the product A*B is as large as possible. | |
# | |
# The generator `splitdigits` returns all candidate triples (P, A, B) where P = A * B. | |
def splitdigits(x=1, y=9, base=10): | |
if x == y: | |
yield (0, y, 0) | |
else: | |
for P, A, B in splitdigits(x+1, y, base): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype HTML> | |
<meta charset = 'utf-8'> | |
<html> | |
<head> | |
<link rel='stylesheet' href='//cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.css'> | |
<script src='//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js' type='text/javascript'></script> | |
<script src='//d3js.org/d3.v3.min.js' type='text/javascript'></script> | |
<script src='//cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.js' type='text/javascript'></script> | |
<script src='//nvd3.org/assets/lib/fisheye.js' type='text/javascript'></script> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abatements abettors abrogative absconders acclimation | |
accounter accumulate acknowledge acolytes acquitted | |
acromegaly activates addressing adiabatically adulthood | |
advantaging adverting aerofoils aerometer affectation | |
afghanistan aggresses agrology airdrops alertest | |
alienation alkalinize allottable alpinist alternated | |
ambulating amiableness amortise amphiboles amputees | |
amusedly analysis anchoritic aneurism anginous | |
anglophobia animaters annually answerable anterior | |
anvilling aphrodisia apoplectic apostacy appeasers |