A240301 a(n) is the number of sets of three positive integers p_1 < p_2 < p_3 such that 2*p_2 = p_1 + p_3, where p_i (i=1,2,3) is either 1 or a prime number and p_3 = prime(n).
1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 2, 3, 1, 3, 3, 2, 2, 4, 3, 4, 4, 4, 2, 3, 4, 3, 3, 5, 5, 5, 4, 5, 4, 5, 4, 5, 5, 6, 4, 4, 7, 4, 6, 7, 6, 7, 5, 4, 5, 4, 6, 8, 7, 7, 7, 7, 4, 8, 9, 8, 5, 9, 6, 7, 8, 4, 8, 8, 10, 8, 6, 6, 10, 9, 9, 7, 7, 6, 9, 10, 9, 8, 8, 12, 13
Offset: 2
Examples
For n=2, p_3=prime(2)=3, 2*2=1+3. One instance found, so a(2)=1; ... For n=8, p_3=prime(8)=19, 2*11=3+19, 2*13=7+19. Two instances found, so a(8)=2; ... For n=30, p_3=prime(30)=113, 2*59=5+113, 2*71=29+113, 2*83=53+113, 2*101=89+113, 2*107=101+113. Five instances found, so a(30)=5.
Links
- Lei Zhou, Table of n, a(n) for n = 2..10001
Programs
-
Mathematica
Table[p = Prime[n]; ct = 0; pp = p; While[pp = NextPrime[pp, -1]; diff = p - pp; diff < pp, cp = pp - diff; If[(PrimeQ[cp]) || (cp == 1), ct++]]; ct, {n, 2, 87}]
Comments