Solution:
A tricky 7-tiny polynomial takes the form
(c6x6+…+c1x+c0)(x−4)
For each fixed value of k, ck−4ck+1 should lie in [−7,7], so if we fix ck, there are around 15/4 ways of choosing ck+1. Therefore if we pick c0,…,c6 in this order, there should be around (15/4)7 tricky 7-tiny polynomials.
A 1-tiny polynomial takes the form ε6x7+⋯+ε1x+ε0 with εi∈{−1,0,+1}, so there are 38 1-tiny polynomials.
A nearly tricky 7-tiny polynomial P takes the form Q+T where Q is roughly a tricky 7-tiny polynomial, and T is 1-tiny. Furthermore, there is a unique decomposition Q+T because T(4)=P(4) and each integer n can be written in the form ∑εk4k in at most one way. Therefore the number of nearly tricky 7-tiny is around (15/4)7⋅38≈68420920, which is worth 16 points.
The exact answer can be found by setting up recurrences. Let t(d,ℓ) be the number of polynomials of degree at most i of the form
(ℓxd−1+cd−2xd−2+⋯+c0)(x−4)+(εd−1xd−1+⋯+ε1x+ε0)
which has integer coefficients between −7 and 7 except the leading term ℓxd. It follows that t(0,0)=1, t(0,k)=0 for all k=0, and t(d+1,ℓ) can be computed as follows: for each value of cd−1, there are t(d,cd−1) ways to pick cd−2,…,c0,εd−1,…,ε0, and exactly w(cd−1−4ℓ) ways of picking εd, where w(k)=min(9−∣k∣,3) for ∣k∣≤8 and 0 otherwise. Therefore setting c=cd−1−4ℓ we have
t(d+1,ℓ)=c=−8∑8t(d,c+4ℓ)w(c)
The number of nearly tricky 7-tiny polynomials is simply t(8,0), which can be computed to be 64912347 using the following C code.
```
int w(int a){
if(a<-9 || a > 9) return 0;
else if(a == -8 || a == 8) return 1;
else if(a == -7 || a == 7) return 2;
else return 3;
}
int main()
{
int m=8,n=7,r=4,d,l,c,c4l;
int mid = 2 + n/r;
int b = 2*mid+1;
long int t[500] [500];
for(l=0; l<b; l++){
t[0][l] = (1 == mid) ? 1 : 0;
}
for(d=0; d<m+1; d++){
for(l=0; l<b; l++){
t[d+1][l] = 0;
for(c=-8; c<9; c++){
c4l = c + 4*(l-mid) + mid;
t[d+1][l] += (c4l >= 0 && c4l <= 2*mid) ? t[d][c4l]*w(c) : 0;
}
}
}
printf("%ld",t[8][mid]);
}