This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A377887 #20 Dec 12 2024 23:33:07 %S A377887 0,1,0,1,2,3,4,3,3,3,1,3,4,4,5,4,5,3,4,4,5,4,4,7,8,6,5,7,4,5,9,5,6,5, %T A377887 9,7,4,5,8,5,8,6,7,5,9,6,5,7,6,4,3,9,6,5,12,8,5,6,7,7,6,9,8,7,13,4,8, %U A377887 4,6,6,7,4,7,11,5,8,8,9,6,7,7,6,12,4,10,11,11,7,8,11 %N A377887 a(n) is the number of ways of writing prime(n) as k-q with q a prime and k a primorial. %C A377887 Except at n=2, the largest k which must be considered is the product of the first n-1 primes, since if k includes p=prime(n) itself then q = k-p is divisible by p and so not prime. %e A377887 For n=4, p = prime(4) = 7 can be written as p = 30 - 23, where 30 is a primorial and 23 is prime, but no other primorials satisfy this condition, so a(3) = 1. %t A377887 a[n_] := Count[FoldList[Times, Prime[Range[n - 1]]] - Prime[n], _?(# > 0 && PrimeQ[#] &)]; a[2] = 1; Array[a, 100] (* _Amiram Eldar_, Nov 14 2024 *) %o A377887 (PARI) a(n)={my(p=prime(n), s=0, t=1); forprime(q=2, p, t*=q; if(t>p && isprime(t-p), s++)); s} \\ _Andrew Howroyd_, Nov 14 2024 %Y A377887 Cf. A002110, A175933. %K A377887 nonn %O A377887 1,5 %A A377887 _Daniel D Gibson_, Nov 10 2024