Locally linear graphs can also be constructed from progression-free sets of numbers.
Let <math>p</math> be a prime number, and let <math>A</math> be a subset of the numbers modulo <math>p</math> such that no three members of <math>A</math> form an [[arithmetic progression]] modulo <math>p</math>. (That is, <math>A</math> is a [[Salem–Spencer set]] modulo <math>p</math>.) This set can be used to construct a [[tripartite graph]] with <math>3p</math> vertices and <math>33p\cdot|A|p</math> edges that is locally linear. To construct this graph, make three sets of vertices, each numbered from <math>0</math> to <math>p-1</math>, and construct triangles using one vertex from each of the three sets that connect vertices numbered <math>(x,x+a,x+2a)</math> modulo <math>p</math>, where <math>x</math> is any number in the range from <math>0</math> to <math>p-1</math> and <math>a</math> is any element of <math>A</math>. By construction, every edge of the resulting graph belongs to a triangle, but there can be no other triangles than the ones formed in this way. Any other triangle would have vertices numbered <math>(x,x+a,x+a+b)</math> where <math>a</math>, <math>b</math>, and <math>c=(a+b)/2</math> all belong to <math>A</math>, violating the assumption that there be no arithmetic progressions <math>(a,c,b)</math> in <math>A</math>.{{r|rs}} For example, with <math>p=3</math> and <math>A=\{\pm 1\}</math>, the result of this construction is the nine-vertex Paley graph.