login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Number of arithmetic progressions of primes < n-th prime.
0

%I #6 Jan 29 2020 05:46:49

%S 0,1,3,6,11,17,23,31,41,53,67,80,92,108,126,142,163,185,204,225,249,

%T 272,299,327,355,384,414,446,478,510,546,584,625,662,702,742,784,828,

%U 872,918,966,1011,1058,1110,1158,1212,1266,1319,1377,1435,1490,1548,1605,1665,1729

%N Number of arithmetic progressions of primes < n-th prime.

%e The a(4) = 6 arithmetic progressions are:

%e (2), (2,3), (2,5), (3), (3,5), (5).

%e The a(5) = 11 arithmetic progressions are:

%e (2), (2,3), (2,5), (2,7), (3), (3,5), (3,5,7), (3,7), (5), (5,7), (7).

%o (PARI) apc(v)={#v + sum(i=1, #v-1, sum(j=i+1, #v, my(s=v[j]-v[i], t=v[j]+s); while(setsearch(v,t), t+=s); (t-v[j])/s))}

%o a(n)={apc(Set(primes(n-1)))} \\ _Andrew Howroyd_, Jan 29 2020

%K nonn

%O 1,3

%A _Giovanni Teofilatto_, Jan 28 2007

%E a(5) corrected and terms a(7) and beyond from _Andrew Howroyd_, Jan 29 2020