kill(all)$

van=facebook.com/LearningCalculus$

       Ihongbe Nelson's Facebook Problem July 22, 2017 at 3:53 PM
"Find triple integer (x,y,z) which satisfy 79x+80y+81z=2016

       I solved this in (r,g,b) as follows.

imin: 2016$ imax: 2017$
jmin:   79$ jmax:   80$
cmin:  -20$ cmax:   20$
sol: create_list(0, i, 1, imax - imin + 1)$

for i: imin thru imax do
    for j: jmin thru jmax do
        for r: cmin thru cmax do
            for g: cmin thru cmax do
                for b: cmin thru cmax do
                (
                    if((j*r+(j+1)*g+(j+2)*b) = i) then
                    (
                        year      :  i - imin  + 1,
                        sol[year] :  sol[year] + 1,
                        printf(true, "        ~3d.~3d ~3d ~3d ~3d ~3d ~%", i,sol[year],j,r,g,b)
                    )
                );