OFFSET
1,3
COMMENTS
Conjecture: a(n)>0 for all n>1.
EXAMPLE
List of 3-smooth numbers from A003586: 1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, ...
For n=2, the 2nd prime is 3, 3-1=2 is prime. This is the only case. So a(2)=1;
For n=3, the 3rd prime is 5, 5-2=3 and 5-3=2 are prime. So a(3)=2;
...
For n=10, the 10th prime is 29, 29-6=23, 29-12=17, 29-16=13, 29-18=11, 29-24=5, and 29-27=2, 6 valid numbers found, so a(10)=6.
MATHEMATICA
g = {1}; Table[p = Prime[n]; While[l = Length[g]; g[[l]] < p, pos = l + 1; While[pos--; c2 = g[[pos]]*2; c2 > g[[l]]]; c2 = g[[pos + 1]]*2; pos = l + 1; While[pos--; c3 = g[[pos]]*3; c3 > g[[l]]]; c3 = g[[pos + 1]]*3; c = Min[c2, c3]; AppendTo[g, c]]; ct = 0; i = 0; While[i++; cn = g[[i]]; cn < p, If[PrimeQ[p - cn], ct++]]; ct, {n, 1, 82}]
PROG
(PARI) is_a003586(n) = n<5||vecmax(factor(n, 5)[, 1])<5;
a(n) = my(p=prime(n)); sum(k=1, p, is_a003586(k) && isprime(p-k)); \\ Michel Marcus, Jul 03 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Lei Zhou, Jun 25 2018
STATUS
approved