[go: up one dir, main page]

login
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.
3
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,1
FORMULA
If n is composite, a(n) = 0, and for noncomposite n, a(n) = 1 + a(n+A002110(A235224(n))).
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 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.
PROG
(PARI)
A002110(n) = prod(i=1, n, prime(i));
A235224(n, p=2) = if(n<p, 1, 1+A235224(n\p, nextprime(p+1)));
A324642(n) = { my(k=0); while((1==n)||isprime(n), n += A002110(A235224(n)); k++); (k); };
CROSSREFS
Cf. also A063377, A324656.
Sequence in context: A325734 A351322 A305736 * A371740 A326757 A147787
KEYWORD
nonn
AUTHOR
Antti Karttunen, Mar 11 2019
STATUS
approved