Skip to content

Instantly share code, notes, and snippets.

@espinz
Created September 13, 2021 18:11
Show Gist options
  • Save espinz/1d6a765b34abc83568dafe45f3f3fe75 to your computer and use it in GitHub Desktop.
Save espinz/1d6a765b34abc83568dafe45f3f3fe75 to your computer and use it in GitHub Desktop.
How many hotdogs for 26 contestants if each eat 2 after the first.
#!/bin/bash
HOTDOGS(){
for i in {1..26};do
a=$((i-1))
b=$((i+a))
let c+='b'
printf %s "$b "
done
}
echo
echo "Hotdogs eaten:"
HOTDOGS
echo
echo
echo "Total hotdogs:"
echo "$c"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment