login
A324656
a(n) is the number of successive primorials A002110(i) larger than n that need to be tried before sum n + A002110(i) is found to be composite.
4
5, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 4, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 0, 3, 0, 0, 0, 2, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 1, 0, 0
OFFSET
1,1
COMMENTS
a(n) = 0 if n + A002110(A235224(n)), i.e., n plus {the least primorial > n} is composite.
a(n) = 1 if n + A002110(A235224(n)) is prime, but n + A002110(1+A235224(n)) is composite.
a(n) = k if n + A002110(j+A235224(n)) is prime for j=0..k-1, but n + A002110(k+A235224(n)) is composite.
EXAMPLE
For n=1, it is not a composite number, so we add a next larger primorial (A002110) to it, which is 2, and we see that 3 is also noncomposite, thus we try to add (to the original n, which is 1) the next larger primorial, which is 6, and 7 is also prime, as are also 31, 211 and 2311. Only with A002110(6), 30030 + 1 is not a prime, thus a(1) = 5.
For n=3, the next larger primorial is 6, but 3+6 = 9 is composite, thus a(3) = 0.
For n=29, which is prime, we try adding it to four successively larger primorial numbers 30, 210, 2310, 30030, until we find 510510 which gives sum 510539 which is composite, thus a(29) = 4. In primorial base (A049345), 29 is written as 421 and the successive sums tested are: 1421, 10421, 100421, 1000421 and 10000421.
For n=121, which is not prime, but 210+121 = 331 is, while 2310+121 = 2431 is not, a(121) = 1.
PROG
(PARI)
A002110(n) = prod(i=1, n, prime(i));
A235224(n, p=2) = if(!n, n, 1+A235224(n\p, nextprime(p+1)));
A324656(n) = { my(k=0, b=A235224(n)); while(isprime(n+A002110(k+b)), k++); (k); };
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Mar 11 2019
STATUS
approved