C# (Visual C# Interactive Compiler), (削除) 180 (削除ここまで) (削除) 171 (削除ここまで) 168 bytes
n=>{for(int i=1,p;i<5001;){var j=new Stack<int>();for(p=i;p>0;p/=n)j.Push(p%n);var s=i%~(n/2)<1?"Fizz":"";Print(i++%((n+11)/3)<1?s+"Buzz":s==""?string.Join("-",j):s);}}
Outputs like Arnauld's answer. Thanks to digEmAll for the idea of using a stack to reverse the output.
Saved 3 bytes thanks to ceilingcat
Gymhgy
- 8k
- 12
- 35