#################################################################### # addstr - solves Schronce's Postulate for any whole number # Schronce's Postulate: "The sum of any series of # consecutive whole numbers, starting with 1, is equal to # the largest number multiplied by 1/2 the largest number # plus 1/2 the largest number." # # Example: 1 +2 +3 +4 +5 +6 +7 +8 + 9 +10 = 55 # Using Schronce's Postulate: (10 * 5) + 5 = 55 # # J. David Schronce #################################################################### if [[ $1 = "" ]]; then echo "\nUSAGE: $0 \n" exit fi echo "(($1 * ($1 * .5)) + ($1 * .5))" | bc