To solve a x k + b x k − 1 + ⋯ + n = 0 {\displaystyle ax^{k}+bx^{k-1}+\cdots +n=0} , where a , b , … , n {\displaystyle a,b,\dots ,n} are given integers, use the command
polyroot(c(a,b,...,n))