Skip to main content
added 11 characters in body
Source Link
pajonk
  • 18.3k
  • 3
  • 25
  • 74

R, 36 3535 33 bytes

\(P,N,r=N^)abs(c(r<-N^(1/P))c(r%/%1,0--r%r)%/%1)^P

Attempt This Online!Attempt This Online!

R, 36 35 bytes

\(P,N,r=N^(1/P))c(r%/%1,0--r%/%1)^P

Attempt This Online!

R, 36 35 33 bytes

\(P,N)abs(c(r<-N^(1/P),-r)%/%1)^P

Attempt This Online!

added 8 characters in body
Source Link
pajonk
  • 18.3k
  • 3
  • 25
  • 74

R, 3636 35 bytes

\(P,N,r=N^(1/P))c(r%/%1,0-(-r%/%1))^P

Attempt This Online!Attempt This Online!

R, 36 bytes

\(P,N,r=N^(1/P))c(r%/%1,-(-r%/%1))^P

Attempt This Online!

R, 36 35 bytes

\(P,N,r=N^(1/P))c(r%/%1,0--r%/%1)^P

Attempt This Online!

Source Link
pajonk
  • 18.3k
  • 3
  • 25
  • 74

R, 36 bytes

\(P,N,r=N^(1/P))c(r%/%1,-(-r%/%1))^P

Attempt This Online!