OFFSET
1,6
EXAMPLE
a(6)=3 because although 13 (the 6th prime) can be expressed as 2*(p1-p2) + 3*p3 in the following ways:
2*(2 - 3) + 3*5
2*(3 - 7) + 3*7
2*(3 - 13) + 3*11
2*(5 - 3) + 3*3
2*(7 - 5) + 3*3
2*(7 - 11) + 3*7
2*(13 - 11) + 3*3
only for the three of them (first, fourth and fifth) p+2*p2 is also a prime (19, 19, 23, respectively).
PROG
(PARI) a(n) = {my(vp = primes(n), nb=0, p=prime(n), p1, p2, p3); for (i=1, #vp, p1 = vp[i]; for (j=1, #vp, p2 = vp[j]; for (k=1, #vp, p3 = vp[k]; if ((2*(p1-p2) + 3*p3 == p) && isprime(p+2*p2), nb++); ); ); ); nb; } \\ Michel Marcus, Jan 26 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Vassilis Papadimitriou, Sep 11 2006
STATUS
approved