Yes, B = {p | p is a program whose length is a prime number} is computable. Just count the number of characters n in p and then test whether n is prime.

By the way, B is nontrivial, but it does not respect equivalence. You can certainly have two equivalent programs, one of whose lengths is a prime number and one whose length is not prime. Just add a character to a comment to change the length without changing what the program does.