OFFSET
1,27
COMMENTS
Count of subsets of at least 3 primes in range that are arithmetic progressions.
LINKS
Jean-François Alcover, Table of n, a(n) for n = 1..135
EXAMPLE
a(15)=1 because primes between 15 and 30 are {17, 19, 23, 29} and {17, 23, 29} is an arithmetic progression.
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}.
a(30)=4 because {31, 37, 41, 43, 47, 53, 59} includes {31, 37, 43}, {41, 47, 53}, {47, 53, 59}, {41, 47, 53,
59}.
MATHEMATICA
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];
Reap[For[n = 1, n <= 135, n++, Print[n, " ", a[n]]; Sow[a[n]]]][[2, 1]] (* Jean-François Alcover, Sep 29 2020 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Giovanni Teofilatto, Sep 24 2006
EXTENSIONS
Edited and extended by Ray Chandler, Sep 26 2006
STATUS
approved