[THOUGHT]
Let pk=ak+bk+ck. We are given p1=151, p2=10939, and p3=957871.
Let e1=a+b+c, e2=ab+bc+ca, and e3=abc.
We have the following Newton's sums:
p1=e1
p2=e1p1−2e2
p3=e1p2−e2p1+3e3
From the given equations:
e1=p1=151
p2=e1p1−2e2⇒10939=1512−2e2⇒10939=22801−2e2⇒2e2=22801−10939=11862⇒e2=5931
p3=e1p2−e2p1+3e3⇒957871=151(10939)−5931(151)+3e3⇒957871=1651789−895581+3e3⇒957871=756208+3e3⇒3e3=957871−756208=201663⇒e3=67221
Now we want to find a4+b4+c4=p4.
We have the recurrence relation:
p4=e1p3−e2p2+e3p1
p4=151(957871)−5931(10939)+67221(151)
p4=144638521−64897000+10150371
p4=89866521+10150371
p4=100016892
Now we verify the solution.
We have a+b+c=151, ab+bc+ca=5931 and abc=67221.
Then a,b,c are the roots of the cubic equation:
x3−151x2+5931x−67221=0
We can try integer roots. Since abc=67221=3⋅22407=32⋅7469, we can try x=3.
27−151(9)+5931(3)−67221=27−1359+17793−67221=17820−68580=0
Try x=9.
729−151(81)+5931(9)−67221=729−12231+53379−67221=54108−79452=0
Let's try to find the roots numerically. The roots are approximately 13,47,91.
13+47+91=151, 13(47)+47(91)+91(13)=611+4277+1183=6071=5931
Something is wrong.
Let's recalculate e2.
p2=e1p1−2e2⇒10939=(151)(151)−2e2⇒10939=22801−2e2⇒2e2=22801−10939=11862⇒e2=5931
Let's recalculate e3.
p3=e1p2−e2p1+3e3⇒957871=(151)(10939)−(5931)(151)+3e3⇒957871=1651789−895581+3e3⇒957871=756208+3e3⇒3e3=957871−756208=201663⇒e3=67221
Let's recalculate p4.
p4=e1p3−e2p2+e3p1⇒p4=(151)(957871)−(5931)(10939)+(67221)(151)
p4=144638521−64897000+10150371=89866521+10150371=100016892
[PYTHON]
def solve():
p1 = 151
p2 = 10939
p3 = 957871
e1 = p1
e2 = (e1*e1 - p2) / 2
e3 = (p3 - e1*p2 + e2*p1) / 3
p4 = e1 * p3 - e2 * p2 + e3 * p1
print(int(p4))
solve()