Retina 0.8.2, 63 5959 58 bytes
.+ $* M`^(1+)¶(1+\1)Mr`^\4*(?<!¶\3+(\5\4*(?<=¶\4+)(1+()1+)(?=\2+¶)\2*\3)\1+¶)(1+\5)¶(1+)\2*$$ 0 Try it online!Try it online! Takes line-separated input in the order B,n,B but test suite converts from comma-separated n,B for convenience. Edit: Saved 1 byte thanks to a hint by @Deadcode. Explanation:
.+ $* Convert Bn and nB to unary.
M`^(1+)¶(1+\1)Mr`^\4*(?<!¶\3+(\5\4*(?<=¶\4+)(1+()1+)(?=\2+¶)\2*\3)\1+¶)(1+\5)¶(1+)\2*$$ Try to find (in $2$4) an integer that is greater than b, a power of a prime, and a factor of n. The r flag makes the expression for checkingmatch from the right, so $5 is matched to b first, then $4, then $4 is checked for the power of a prime is taken(taken from @Deadcode's answer to Is it almost-prime? (but reversed naturally because this, matching left-to-right as it is a lookbehindlookahead), then it is checked for a factor of n. Note that theThe previous 63-byte version was faster because it checked for factors before prime powers: Try it online!
0 Check that there wasn't a match.