login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Index of the least significant digit larger than one in the primorial base expansion of n, 0 if no such digit exists.
7

%I #10 Mar 13 2024 01:50:41

%S 0,0,0,0,2,2,0,0,0,0,2,2,3,3,3,3,2,2,3,3,3,3,2,2,3,3,3,3,2,2,0,0,0,0,

%T 2,2,0,0,0,0,2,2,3,3,3,3,2,2,3,3,3,3,2,2,3,3,3,3,2,2,4,4,4,4,2,2,4,4,

%U 4,4,2,2,3,3,3,3,2,2,3,3,3,3,2,2,3,3,3,3,2,2,4,4,4,4,2,2,4,4,4,4,2,2,3,3,3,3

%N Index of the least significant digit larger than one in the primorial base expansion of n, 0 if no such digit exists.

%H Antti Karttunen, <a href="/A328828/b328828.txt">Table of n, a(n) for n = 0..65537</a>

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

%F a(n) = A277885(A276086(n)) = A055396(A328572(n)).

%t a[n_] := Module[{k = n, p = 2, s = {}, r, i}, While[{k, r} = QuotientRemainder[k, p]; k != 0 || r != 0, AppendTo[s, r]; p = NextPrime[p]]; i = FirstPosition[s, _?(# > 1 &)]; If[MissingQ[i], 0, i[[1]]]]; Array[a, 100] (* _Amiram Eldar_, Mar 13 2024 *)

%o (PARI) A328828(n) = { my(i=1, p=2); while(n, if((n%p)>1, return(i)); i++; n = n\p; p = nextprime(1+p)); (0); };

%Y Cf. A049345, A055396, A276086, A277885, A328572.

%K nonn,base

%O 0,5

%A _Antti Karttunen_, Oct 29 2019