login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A276088 The least significant nonzero digit in primorial base representation of n: a(n) = A276094(n) / A002110(A276084(n)) (with a(0) = 0). 12

%I #33 Sep 10 2022 07:34:25

%S 0,1,1,1,2,1,1,1,1,1,2,1,2,1,1,1,2,1,3,1,1,1,2,1,4,1,1,1,2,1,1,1,1,1,

%T 2,1,1,1,1,1,2,1,2,1,1,1,2,1,3,1,1,1,2,1,4,1,1,1,2,1,2,1,1,1,2,1,1,1,

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

%N The least significant nonzero digit in primorial base representation of n: a(n) = A276094(n) / A002110(A276084(n)) (with a(0) = 0).

%C For any n >= 1, start from k = n and repeatedly try to divide as many successive primes as possible out of k, iterating as k/2 -> k, k/3 -> k, k/5 -> k, until a nonzero remainder is encountered, which is then the value of a(n). (See the last example).

%C Note that the sequence has been defined so that it will eventually include also "digits" (actually: value holders) > 9 that occur as the least significant nonzero digits in primorial base representation. Thus any eventual decimal corruption of A049345 will not affect these values.

%C The sums of the first 10^k terms (starting from n=1), for k = 1, 2, ..., are 12, 138, 1441, 14565, 145950, 1459992, 14600211, 146002438, 1460025336, 14600254674, ... . Apparently, the asymptotic mean of this sequence is limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 1.460025... . - _Amiram Eldar_, Sep 10 2022

%H Antti Karttunen, <a href="/A276088/b276088.txt">Table of n, a(n) for n = 0..2310</a>

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

%F a(0) = 0, and for n >= 1, a(n) = A276094(n) / A002110(A276084(n)).

%F From _Antti Karttunen_, Oct 29 2019: (Start)

%F a(n) = A067029(A276086(n)).

%F a(A276086(n)) = A328569(n).

%F (End).

%e n A049345 the rightmost nonzero = a(n)

%e ---------------------------------------------------------

%e 0 0 0

%e 1 1 1

%e 2 10 1

%e 3 11 1

%e 4 20 2

%e 5 21 1

%e 6 100 1

%e 7 101 1

%e 8 110 1

%e 9 111 1

%e 10 120 2

%e 11 121 1

%e 12 200 2

%e 13 201 1

%e 14 210 1

%e 15 211 1

%e 16 220 2

%e .

%e For n=48 according to the iteration interpretation, we obtain first 48/2 = 24, and the remainder is zero, so we continue: 24/3 = 8 and here the remainder is zero as well, so we try next 8/5, but this gives the nonzero remainder 3, thus a(48)=3.

%e For n=2100, which could be written "A0000" in primorial base (where A stands for digit "ten", as 2100 = 10*A002110(4)), the least significant nonzero value holder (also the most significant) is thus 10 and a(2100) = 10. (The first point where this sequence attains a value larger than 9).

%t nn = 120; b = MixedRadix[Reverse@ Prime@ Range@ PrimePi[nn + 1]]; Table[Last[IntegerDigits[n, b] /. 0 -> Nothing, 0], {n, 0, nn}] (* Version 11, or *)

%t f[n_] := Block[{a = {{0, n}}}, Do[AppendTo[a, {First@ #, Last@ #} &@ QuotientRemainder[a[[-1, -1]], Times @@ Prime@ Range[# - i]]], {i, 0, #}] &@ NestWhile[# + 1 &, 0, Times @@ Prime@ Range[# + 1] <= n &]; Rest[a][[All, 1]]]; {0}~Join~Table[Last@ DeleteCases[f@ n, d_ /; d == 0], {n, 120}] (* _Michael De Vlieger_, Aug 30 2016 *)

%o (PARI) A276088(n) = { my(e=0, p=2); while(n && !(e=(n%p)), n = n/p; p = nextprime(1+p)); (e); }; \\ _Antti Karttunen_, Oct 29 2019

%o (Scheme, two versions)

%o (define (A276088 n) (if (zero? n) n (let loop ((n n) (i 1)) (let* ((p (A000040 i)) (d (modulo n p))) (if (not (zero? d)) d (loop (/ (- n d) p) (+ 1 i)))))))

%o (define (A276088 n) (if (zero? n) n (/ (A276094 n) (A002110 (A276084 n)))))

%o (Python)

%o from sympy import nextprime, primepi, primorial

%o def a053669(n):

%o p = 2

%o while True:

%o if n%p!=0: return p

%o else: p=nextprime(p)

%o def a257993(n): return primepi(a053669(n))

%o def a002110(n): return 1 if n<1 else primorial(n)

%o def a276094(n): return 0 if n==0 else n%a002110(a257993(n))

%o def a(n): return 0 if n==0 else a276094(n)//a002110(a257993(n) - 1)

%o print([a(n) for n in range(101)]) # _Indranil Ghosh_, Jun 22 2017

%Y Cf. A000040, A002110, A049345, A067029, A276084, A276086, A276094, A328569.

%K nonn,base

%O 0,5

%A _Antti Karttunen_, Aug 22 2016

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 03:15 EDT 2024. Contains 371964 sequences. (Running on oeis4.)