login
a(n) is the number of primes that are equal to prime(n)+q+1, where prime(n) is the n-th prime number, q is a prime less than or equal to prime(n).
1

%I #20 Mar 05 2022 14:18:37

%S 1,1,1,2,3,2,3,3,6,6,3,4,8,4,7,9,11,5,6,9,4,7,13,15,8,11,7,13,10,13,9,

%T 16,15,12,19,9,8,8,20,20,25,11,17,11,18,15,9,13,21,14,25,28,11,27,24,

%U 26,32,13,12,22,14,29,19,27,14,26,14,14,29,24,26,40

%N a(n) is the number of primes that are equal to prime(n)+q+1, where prime(n) is the n-th prime number, q is a prime less than or equal to prime(n).

%H Lei Zhou, <a href="/A305866/b305866.txt">Table of n, a(n) for n = 1..10000</a>

%e For n=1, prime(n)=2, 2+2+1=5 is prime. So a(1)=1;

%e For n=2, prime(n)=3, 3+2+1=6 is not prime, 3+3+1=7 is prime. So a(2)=1;

%e ...

%e For n=5, prime(5)=11, 11+5+1=17, 11+7+1=19, 11+11+1=23: 3 primes found. So a(5)=3.

%t Table[ct = 0; p = Prime[i]; Do[q = Prime[j]; If[PrimeQ[p + q + 1], ct++], {j, 1, i}]; ct, {i, 1, 72}]

%o (PARI) a(n) = sum(k=1, n, isprime(prime(n) + prime(k)+1)); \\ _Michel Marcus_, Jun 12 2018

%Y Cf. A000040.

%K nonn,easy

%O 1,4

%A _Lei Zhou_, Jun 12 2018