Skip to main content
2 of 3
added 6 characters in body
ovs
  • 60.6k
  • 3
  • 47
  • 161

Python 2, 68 bytes

The output is a positive integer for truthy cases and a 0 otherwise.

f=lambda n,b,p=2,m=1:b/m*(n<2or f(*[n/p,n,b,b,p,p+1,m*p][n%p>0::2]))

Try it online!

ovs
  • 60.6k
  • 3
  • 47
  • 161