#Python 2, 74 bytes
Having already been soundly beaten by @Flp.Tkc I'll just post my 74 byte recursive solution because it works and not because it will win.
def f(a,b,c=1):
print(`c`,"Shaggy")[c%b<1or`b`in`c`]
if c<a:f(a,b,c+1)
#Python 2, 74 bytes
Having already been soundly beaten by @Flp.Tkc I'll just post my 74 byte recursive solution because it works and not because it will win.
def f(a,b,c=1):
print(`c`,"Shaggy")[c%b<1or`b`in`c`]
if c<a:f(a,b,c+1)