Skip to content

Instantly share code, notes, and snippets.

@sblom
Created February 11, 2012 06:47
Show Gist options
  • Save sblom/1797321 to your computer and use it in GitHub Desktop.
Save sblom/1797321 to your computer and use it in GitHub Desktop.
Embedly challenge (in Mathematica)
n = 1; While[Total[IntegerDigits[n!]] != 8001, n = n + 1]; n
article =
Cases[Import["http://apply.embed.ly/static/data/2.html", "XML"] /.
List -> Sequence, XMLElement["article", ___], Infinity];
N[StandardDeviation[
Length /@ Position[article, XMLElement["p", ___]]], 2]
totals = Rest[FoldList[Plus, 0, Table[900/i, {i, 1, 900}]]];
n = 1; While[totals[[n]] < totals[[-1]]/2, n = n + 1]; n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment