A pure word (or perfect word), as defined by me, is a word where the sum of the position in the alphabet of each letter in the word is perfectly divisible by the total length of the word. For example,
abcb is a perfect word because
1 + 2 + 3 + 2 = 8, and
8 / 4 = 2.
Given a word as input, output whether or not it is a perfect word. The word may always be assumed to be lowercase.
This is code-golf, so shortest program in bytes wins.
abcb: truthy ccc: truthy aaa: truthy pure: truthy word: truthy bed: falsy code: falsy bode: falsy
0for truthy and a non-consistent nonzero number for falsy? Any two values? Truthy and falsy swapped? @All: you may want to vote here \$\endgroup\$
falsefor a perfect number and
truefor a non-perfect one allowed? What about
1for a perfect number and any other number otherwise, or positive for perfect and negative for non-perfect? \$\endgroup\$