Dyalog APL, 11 bytes
2 bytes saved thanks to @ZacharyT
⊣-⍨⊢*1+∘⌊⍟⍨
Takes n
as left argument and b
as right argument.
Calculates b⌊logbn + 1⌋ - n
.
2 bytes saved thanks to @ZacharyT
⊣-⍨⊢*1+∘⌊⍟⍨
Takes n
as left argument and b
as right argument.
Calculates b⌊logbn + 1⌋ - n
.