Skip to main content
-20 bytes
Source Link
matteo_c
  • 7.3k
  • 16
  • 28

Haskell, 100100 80 bytes

-20 bytes thanks to @Laikoni

(k#x)0=x
(k#x)n=k#(f k=[n|n<-[0..k*k^k],let x#0=1>0;x#n|m<-mod n k:x)$divk=notElem nm k
x[]=1>0
xx&&(am:bx)=notElem a b&&x#div b
fn k=filter(x.(k#[]))[0..k*k^k]k,[]#n]

Try it online!Try it online!

Haskell, 100 bytes

(k#x)0=x
(k#x)n=k#(mod n k:x)$div n k
x[]=1>0
x(a:b)=notElem a b&&x b
f k=filter(x.(k#[]))[0..k*k^k]

Try it online!

Haskell, 100 80 bytes

-20 bytes thanks to @Laikoni

f k=[n|n<-[0..k*k^k],let x#0=1>0;x#n|m<-mod n k=notElem m x&&(m:x)#div n k,[]#n]

Try it online!

Source Link
matteo_c
  • 7.3k
  • 16
  • 28

Haskell, 100 bytes

(k#x)0=x
(k#x)n=k#(mod n k:x)$div n k
x[]=1>0
x(a:b)=notElem a b&&x b
f k=filter(x.(k#[]))[0..k*k^k]

Try it online!