You need just three weighings.
Number the balls in odd numbers, and the remaining number is 20, except 13. Then use numbers 0 and 26
So the balls are numbered, 0,1,3,5,7,9,11,15,17,19,20,21,23,25,26 or in base 3,
000, 001, 010, 012, 021, 100, 102, 120, 122, 201, 210, 212, 221,222
454 v 454 v 454 for the odd numbers, and 5,4,5 for this set.
Label the pans 0 and 2, and leave 1 off. Weigh the three digits, and record which pan goes down, or 1 for equal. The number written is the base 3 value of the heavy ball.
This is actually a three-state system, and the trinary numbers give the weighings, The solution is good for 26 balls, numbered in trinary numbers 0 to 27 (222) except 13 (111).
0 = put ball in left pan heavy 0 makes this pan go down
1 = leave ball off heavy 1 makes pans equal
2 = put ball in right pan. heavy 2 makes right pan go down.
Since the heavy ball is comprised of three trinary numbers, the weighings will give up to 26 unique numbers.
The solution as given is a slightly modified version of the problem where one coin is known good, and one of thirteen coins is defective, can be either heavy or light. This has a solution in
M = left pan; 0 = left off; 1 = right pan.
The 13 coins are numbered from 1 to 13, in trinary, with the even numbers in reverse sign, viz 1, -2, 3, -4, ..., -13. In trinary, they look like
001, 0m1, 010, 0mm, 1mm, m10, 1m1, m01, 100, m0m, 11m, mm0, 111.
The known good coin is numbered -7, ie m1m.
You weigh the coins according to first, second, third digit, and get the numbers as m = left pan down, 0 = balance, 1 = right pan down.
If the number is even (ie an odd number of 0's), swap the m and 1's, eg m10 = 1m0,
You have then determined the number of the coin (as the weightings are 9,3,1), and whether it's heavy or light. So 1m0 gives +9-3.1 = +6, coin 6 is defective, and heavy.
But you can't do it with 14 coins in three weighings unless you know the defect is +. In that case, you can do as many as 26 weighings.