Skip to main content
1 of 4
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

JavaScript (ES6), 53 bytes

Expects (b)(n). Returns 0 or 1.

b=>g=(n,i=d=1)=>i>b?0:++d>n?1:n%d?g(n,1):g(n/d,i*d--) 

Try it online!

Arnauld
  • 205.5k
  • 21
  • 187
  • 670