Jelly, (削除) 22 17 (削除ここまで) 177 bytes
-10 bytes by realising I'd implemented convolution - go upvote Luis Mendo's MATL answer too, as that was what made me realise this.
×ばつ€Œd§ṙLC${Ṛðæc/ṫ‘}Ḣ
A dyadic link accepting a list of coefficient lists on the left and the exponent on the right.
Try it online! Try it online! Or see the test suite test suite.
How?
æc/ṫ‘}Ḣ - Link: list of lists, Ps; integer, E
/ - reduce (Ps) by:
æc - convolution
} - use right argument (E) for:
‘ - increment -> E+1
ṫ - tail from (1-indexed) index (E+1)
Ḣ - head (if given an empty list yields 0)
The 17 (without the convolution atom) was:
×ばつ€Œd§ṙLC${Ṛð/ṫ‘}Ḣ
Jelly, (削除) 22 (削除ここまで) 17 bytes
×ばつ€Œd§ṙLC${Ṛð/ṫ‘}Ḣ
A dyadic link accepting a list of coefficient lists on the left and the exponent on the right.
Try it online! Or see the test suite.
Jelly, (削除) 22 17 (削除ここまで) 7 bytes
-10 bytes by realising I'd implemented convolution - go upvote Luis Mendo's MATL answer too, as that was what made me realise this.
æc/ṫ‘}Ḣ
A dyadic link accepting a list of coefficient lists on the left and the exponent on the right.
Try it online! Or see the test suite.
How?
æc/ṫ‘}Ḣ - Link: list of lists, Ps; integer, E
/ - reduce (Ps) by:
æc - convolution
} - use right argument (E) for:
‘ - increment -> E+1
ṫ - tail from (1-indexed) index (E+1)
Ḣ - head (if given an empty list yields 0)
The 17 (without the convolution atom) was:
×ばつ€Œd§ṙLC${Ṛð/ṫ‘}Ḣ
Jelly, 22 (削除) 22 (削除ここまで) 17 bytes
×ばつ€Œd§ṙLC${Ṛð/;0ẋ$}ị@‘ṫ‘}Ḣ
A dyadic link accepting a list of coefficient lists on the left and the exponent on the right.
Try it online! Try it online! Or see the test suite .
Feels too long; 5 bytes used just to handle the higher than maximal coefficient casestest suite.
Jelly, 22 bytes
×ばつ€Œd§ṙLC${Ṛð/;0ẋ$}ị@‘}
A dyadic link accepting a list of coefficient lists on the left and the exponent on the right.
Try it online! Or see the test suite .
Feels too long; 5 bytes used just to handle the higher than maximal coefficient cases.
Jelly, (削除) 22 (削除ここまで) 17 bytes
×ばつ€Œd§ṙLC${Ṛð/ṫ‘}Ḣ
A dyadic link accepting a list of coefficient lists on the left and the exponent on the right.
Try it online! Or see the test suite.
Jelly, 22 bytes
×ばつ€Œd§ṙLC${Ṛð/;0ẋ$}ị@‘}
A dyadic link accepting a list of coefficient lists on the left and the exponent on the right.
Try it online! Or see the test suite .
Feels too long; 5 bytes used just to handle the higher than maximal coefficient cases.
Jelly, 22 bytes
×ばつ€Œd§ṙLC${Ṛð/;0ẋ$}ị@‘}
A dyadic link accepting a list of coefficient lists on the left and the exponent on the right.
Try it online! Or see the test suite .
Feels too long; 5 bytes used just to handle the higher than maximal coefficient cases.