The Cow Problem
Vasiliki Liontou
2017/12/20
We are looking to find all the quadruples such that for the first number “i” of each quadruple, the next three numbers of the quadruple satisfy the following relation:
i-1=i/x+i/y+i/z if our quadraple is denoted as (n,x,y,z). We can also substitute 1 with a more general step “k”.

(*The function Cow needs two integers as inputs. The first integer represents the integer "n" up to what we need to search for quadruples that share the  property and the second integer represents the "step" as we have described above *)
Cow[n_Integer,k_Integer]:=For[i=1,i≤ n,i++,
For[x=1,x≤ i+1,x++,
For[y=x,y≤ i+1,y++,
For[z=y,z≤ i+1,z++,
If[Mod[i,x]==0&&Mod[i,y]==0&&Mod[i,z]==0&&i-k==i/x+i/y+i/z,Print[i-k,"(",x,",",y,",",z,")"] ]]]]]
Cow[100,1]

Cow[100,2]

(*However, when we increase n, the programme is not efficient *)

Cow[200,1]