Palindrome programs and a nextPrime rewrite in Ruby