cp's OEIS Frontend

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.

Showing 1-2 of 2 results.

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.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 11 2019

Keywords

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.

Examples

			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.
		

Crossrefs

Programs

A324642 Number of iterations of map x -> x + A002110(A235224(x)) required to reach a composite when starting from x = n. Here A002110(A235224(x)) gives the least primorial number > x.

Original entry on oeis.org

2, 1, 1, 0, 4, 0, 2, 0, 0, 0, 3, 0, 2, 0, 0, 0, 3, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 5, 0, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 4, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 5, 0, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 3, 0, 2, 0, 0
Offset: 1

Views

Author

Antti Karttunen, Mar 11 2019

Keywords

Examples

			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 add to that the next larger primorial, which is 6, but now 3+6 = 9 is composite, which we reached in two iteration steps, thus a(1) = 2.
For n = 97, the iteration goes as: 97 -> 307 -> 2617 -> 32647 -> 543157 -> 10242847 -> 233335717 -> 6703028947 -> 207263519077, and only the last term shown is composite, thus a(97) = 8. Written in primorial base (A049345), the terms in that trajectory look as: 3101, 13101, 113101, 1113101, 11113101, 111113101, 1111113101, 11111113101 and 111111113101.
		

Crossrefs

Programs

  • PARI
    A002110(n) = prod(i=1,n,prime(i));
    A235224(n, p=2) = if(nA235224(n\p, nextprime(p+1)));
    A324642(n) = { my(k=0); while((1==n)||isprime(n), n += A002110(A235224(n)); k++); (k); };

Formula

If n is composite, a(n) = 0, and for noncomposite n, a(n) = 1 + a(n+A002110(A235224(n))).
Showing 1-2 of 2 results.