OFFSET
0,2
COMMENTS
Index of the least prime not dividing A276086(n), where A276086 converts the primorial base expansion of n into its prime product form.
Starting from x = n, repeatedly divide x by prime(1) (discarding the remainder), and set x to the integer quotient floor(x/prime(1)), then divide x with prime(2) (again discarding the remainder, and setting x to the integer quotient), etc., stopping as soon one of the primes is a divisor of the previous integer quotient (leaving zero remainder). a(n) is then the index of that prime, equal to 1 + the number of iterations done.
LINKS
FORMULA
EXAMPLE
For n = 2, we divide it with A000040(1) = 2, and it leaves zero remainder, so we have finished on the first round (needing no actual iterations), and thus a(2) = 1. Note that 2 in primorial base (A049345) is written as "10", and indeed the first zero from the right occurs at the position 1.
For n = 5, we first divide 5 with prime(1) = 2, and discarding the remainder, we are left with floor(5/2) = 2. Then we divide that 2 with prime(2) = 3, leaving floor(2/3) = 0 and remainder 2. And finally we divide 0 with prime(3) = 5, and that doesn't leave any remainder, thus we are finished on the third round, and a(5) = 3. Note that 5 in primorial base is written as "21", and allowing here a leading zero, written as "021", we see that it is in this case the least significant zero occurring at position 3 from the right.
For n = 43, we first divide it with prime(1) = 2, leaving a remainder 1 and integer quotient 21. Then we divide 21 with prime(2) = 3, which doesn't leave any remainder, thus we are finished on the second round, and a(43) = 2. Note that 43 is written as "1201" in primorial base, with the least significant zero occurring in the position 2.
PROG
(PARI) A328570(n) = { my(i=1, p=2); while(n && (n%p), i++; n = n\p; p = nextprime(1+p)); (i); };
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Oct 20 2019
STATUS
approved