Skip to content

Instantly share code, notes, and snippets.

@flatcap
Created August 23, 2015 23:17
Show Gist options
  • Save flatcap/83fb223b8a18b08d0a04 to your computer and use it in GitHub Desktop.
Save flatcap/83fb223b8a18b08d0a04 to your computer and use it in GitHub Desktop.
Sunday Times Teaser 2761 (2015-08-23)
cards numbered 1-9
laid out in ascending order
cards redealt, no card in original place
last 6 digits form the square of the first three digits
#!/bin/bash
for i in {316..999}; do
echo $i$((i*i))
done \
| grep -v "\(.\).*\1" \
| grep -v -e "^1" -e "^.2" -e "^..3" -e "^...4" -e "^....5" -e "^.....6" -e "^......7" -e "^.......8" -e "^........9" \
| cut -b-3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment