A328570 Index of the least significant zero digit in the primorial base expansion of n, when the rightmost digit is in the position 1.
1, 2, 1, 3, 1, 3, 1, 2, 1, 4, 1, 4, 1, 2, 1, 4, 1, 4, 1, 2, 1, 4, 1, 4, 1, 2, 1, 4, 1, 4, 1, 2, 1, 3, 1, 3, 1, 2, 1, 5, 1, 5, 1, 2, 1, 5, 1, 5, 1, 2, 1, 5, 1, 5, 1, 2, 1, 5, 1, 5, 1, 2, 1, 3, 1, 3, 1, 2, 1, 5, 1, 5, 1, 2, 1, 5, 1, 5, 1, 2, 1, 5, 1, 5, 1, 2, 1, 5, 1, 5, 1, 2, 1, 3, 1, 3, 1, 2, 1, 5, 1, 5, 1, 2, 1, 5
Offset: 0
Examples
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.
Links
Crossrefs
Programs
-
PARI
A328570(n) = { my(i=1, p=2); while(n && (n%p), i++; n = n\p; p = nextprime(1+p)); (i); };
Comments