This is modular arithmetic (clock arithmetic).
d = (1+1288*n)/3 where n is a positive integer (not all positive integers!).
In fact the smallest positive integer for n that gives a positive integer for d is n=2, for which d = 859.
$${\mathtt{3}}{\mathtt{\,\times\,}}{\mathtt{859}} = {\mathtt{2\,577}}$$
$${\mathtt{2\,577}} \,{mod}\, {\mathtt{1\,288}} = {\mathtt{1}}$$
Generally, n = 2+3k, where k is 0, 1, 2, ... etc. will result in a value of d that satisfies mod(3d,1288)=1