Skip to content

Instantly share code, notes, and snippets.

@jld
Created March 6, 2013 18:41
Show Gist options
  • Select an option

  • Save jld/5101869 to your computer and use it in GitHub Desktop.

Select an option

Save jld/5101869 to your computer and use it in GitHub Desktop.
357686312646216567629137
#!/bin/sh
thing() {
local stem=$1 found=false
for d in 1 2 3 4 5 6 7 8 9
do local p=$d$stem
if [ $(factor $p | wc -w) -ne 2 ]
then continue
fi
found=true
thing $p || echo $p
done
$found
}
thing | awk '{print length,$1}' | sort -n | cut -d\ -f2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment