Skip to content

Instantly share code, notes, and snippets.

@greymd
Last active February 19, 2016 12:39
Show Gist options
  • Save greymd/3865f73b3c6159347657 to your computer and use it in GitHub Desktop.
Save greymd/3865f73b3c6159347657 to your computer and use it in GitHub Desktop.
100までの素数分割。ひどいアプローチ。
# Q https://twitter.com/tmnghryk/status/700073381454974976
# A
time while true; do factor {2..100} | awk '$0*=!$3' | xargs | perl -anlE '{for (@F) { $i=int(rand(2)); $su[$i]+=$_; $s[$i].="$_ "} }END{say "$s[0]: $su[0]\n$s[1]: $su[1]"}' | grep -E '530$' && break ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment