Skip to main content
4 of 4
deleted 10 characters in body
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

JavaScript (ES6),  53  52 bytes

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

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

Try it online!

Commented

b => // outer function taking b = powersmoothness rank g = ( // recursive inner function taking: n, // n = input integer whose b-powersmoothness is tested i = // i = exponentiation of the current prime divisor, // which must never exceed b d = 1 // d = prime divisor candidate ) => // i > b ? // if i is greater than b: 0 // failure: stop and return 0 : // else: n % ++d ? // increment d; if it's not a divisor of n: d > n // stop and return true if it's greater than n || // otherwise: g( // do a recursive call: n, // pass n unchanged 1 // reset i to 1 while leaving d unchanged ) // end of recursive call : // else (d is a prime divisor of n): g( // do a recursive call: n / d, // divide n by d i * d-- // multiply i by d, decrement d afterwards ) // end of recursive call 
Arnauld
  • 205.5k
  • 21
  • 187
  • 670