|
|
A122669
|
|
Number of nontrivial arithmetic progressions of primes between n and 2n.
|
|
1
|
|
|
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, 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, 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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,27
|
|
COMMENTS
|
Count of subsets of at least 3 primes in range that are arithmetic progressions.
|
|
LINKS
|
|
|
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
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|