Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

Pari/GP, 84 bytes

f(p)=[if(q'',[f(q),r],p)|r<-x*divisors(p\x),r''&&p==subst(q=substpol(p,r,x),x,r)][1]

Based on the algorithm described here.

Try it online!

Pari/GP, 84 bytes

f(p)=[if(q'',[f(q),r],p)|r<-x*divisors(p\x),r''&&p==subst(q=substpol(p,r,x),x,r)][1]

Based on the algorithm described here.

Try it online!

Pari/GP, 84 bytes

f(p)=[if(q'',[f(q),r],p)|r<-x*divisors(p\x),r''&&p==subst(q=substpol(p,r,x),x,r)][1]

Based on the algorithm described here.

Try it online!

added 34 characters in body
Source Link
alephalpha
  • 51.9k
  • 7
  • 75
  • 196

Pari/GP, 8984 bytes

f(p)=if=[if(a=[[fq'',[f(q),r]|r<-divisors(r],p)|r<-p%xx*divisors(p\x),r''&&p==subst(q=substpol(p,r,x),x,r)&&q''],a[1],p)][1]

Based on the algorithm described here here.

Try it online! Try it online!

Pari/GP, 89 bytes

f(p)=if(a=[[f(q),r]|r<-divisors(p-p%x),r''&&p==subst(q=substpol(p,r,x),x,r)&&q''],a[1],p)

Based on the algorithm described here.

Try it online!

Pari/GP, 84 bytes

f(p)=[if(q'',[f(q),r],p)|r<-x*divisors(p\x),r''&&p==subst(q=substpol(p,r,x),x,r)][1]

Based on the algorithm described here.

Try it online!

Source Link
alephalpha
  • 51.9k
  • 7
  • 75
  • 196

Pari/GP, 89 bytes

f(p)=if(a=[[f(q),r]|r<-divisors(p-p%x),r''&&p==subst(q=substpol(p,r,x),x,r)&&q''],a[1],p)

Based on the algorithm described here.

Try it online!

AltStyle によって変換されたページ (->オリジナル) /