login
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

%I #15 Mar 11 2019 20:47:35

%S 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,

%T 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,

%U 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

%N 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.

%H Antti Karttunen, <a href="/A324642/b324642.txt">Table of n, a(n) for n = 1..100000</a>

%H <a href="/index/Pri#primorialbase">Index entries for sequences related to primorial base</a>

%H <a href="/index/Pri#primorial_numbers">Index entries for sequences related to primorial numbers</a>

%F If n is composite, a(n) = 0, and for noncomposite n, a(n) = 1 + a(n+A002110(A235224(n))).

%e 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.

%e 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.

%o (PARI)

%o A002110(n) = prod(i=1,n,prime(i));

%o A235224(n, p=2) = if(n<p, 1, 1+A235224(n\p, nextprime(p+1)));

%o A324642(n) = { my(k=0); while((1==n)||isprime(n), n += A002110(A235224(n)); k++); (k); };

%Y Cf. A002110, A049345 (A324550), A235224.

%Y Cf. also A063377, A324656.

%K nonn

%O 1,1

%A _Antti Karttunen_, Mar 11 2019