A340439 a(n) is the number of primes of the form p*q + p*r + q*r where p is the n-th prime and q and r are primes < p.
0, 0, 1, 3, 5, 7, 9, 12, 11, 16, 20, 23, 22, 32, 30, 34, 42, 53, 48, 49, 61, 62, 67, 66, 81, 73, 94, 94, 103, 105, 114, 112, 114, 142, 123, 153, 164, 155, 167, 170, 183, 196, 204, 228, 208, 235, 242, 231, 240, 254, 267, 246, 281, 269, 297, 306, 298, 340, 356, 338, 378, 339, 421, 363, 424, 386
Offset: 1
Keywords
Examples
a(6) = 7 because prime(6) = 13 and there are 7 such primes: 71 = 2*3 + 2*13 + 3*13 101 = 2*5 + 2*13 + 5*13 131 = 2*7 + 2*13 + 7*13 151 = 3*7 + 3*13 + 7*13 191 = 5*7 + 5*13 + 7*13 = 2*11 + 2*13 + 11*13 263 = 5*11 + 5*13 + 11*13 311 = 7*11 + 7*13 + 11*13.
Links
- Robert Israel, Table of n, a(n) for n = 1..1000
Crossrefs
Cf. A340444.
Programs
-
Maple
f:= proc(n) local i,j,t; nops(select(isprime, {seq(seq((ithprime(i)+ithprime(j))*ithprime(n)+ithprime(i)*ithprime(j), i=1..j-1),j=2..n-1)})) end proc: map(f, [$1..100]);
-
Python
from sympy import isprime, prime def aupto(nn): alst, plst = [], [prime(i) for i in range(1, nn+1)] for n in range(1, nn+1): p = plst[n-1] t = ((p, plst[i], plst[j]) for i in range(n-2) for j in range(i+1, n-1)) u = (p*q + p*r + q*r for p, q, r in t) alst.append(len(set(s for s in u if isprime(s)))) return alst print(aupto(66)) # Michael S. Branicky, Jan 07 2021
Comments