%I #9 Sep 29 2020 04:41:17
%S 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,1,1,1,1,1,3,3,3,4,4,3,3,3,
%T 3,4,5,5,5,8,8,8,8,7,8,8,8,5,6,6,6,6,6,7,8,8,10,10,10,8,8,5,5,7,7,9,9,
%U 7,8,9,9,7,7,7,8,11,11,11,12,9,9,12,12,14,14,14,16,16,16,14,15,15,15,15,15
%N Number of nontrivial arithmetic progressions of primes between n and 2n.
%C Count of subsets of at least 3 primes in range that are arithmetic progressions.
%H Jean-François Alcover, <a href="/A122669/b122669.txt">Table of n, a(n) for n = 1..135</a>
%e a(15)=1 because primes between 15 and 30 are {17, 19, 23, 29} and {17, 23, 29} is an arithmetic progression.
%e a(27)=a(28)=a(29)=3 because {29, 31, 37, 41, 43, 47, 53} includes {29, 41, 53}, {31, 37, 43}, {41, 47, 53}.
%e a(30)=4 because {31, 37, 41, 43, 47, 53, 59} includes {31, 37, 43}, {41, 47, 53}, {47, 53, 59}, {41, 47, 53,
%e 59}.
%t a[n_] := a[n] = Module[{pp, S}, pp = Select[Range[n, 2 n], PrimeQ]; S = Subsets[pp, {3, Length[pp]}]; Select[S, 1 == Length[Union[Differences[#] ]]&] // Length];
%t Reap[For[n = 1, n <= 135, n++, Print[n, " ", a[n]]; Sow[a[n]]]][[2, 1]] (* _Jean-François Alcover_, Sep 29 2020 *)
%K nonn
%O 1,27
%A _Giovanni Teofilatto_, Sep 24 2006
%E Edited and extended by _Ray Chandler_, Sep 26 2006