cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

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

Original entry on oeis.org

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, 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, 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
Offset: 0

Views

Author

Antti Karttunen, Aug 22 2016

Keywords

Comments

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).
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.
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
The asymptotic density of the occurrences of k = 1, 2, ..., is d(1) = c = A064648 for k = 1, and d(k) = c - Sum_{i = 1..PrimePi(k)} 1/primorial(i) for k >= 2, where primorial(i) = A002110(i). The asymptotic mean of this sequence is Sum_{k>=1} k * d(k) = c + Sum_{i>=1} (prime(i) * gap(i) + t(gap(i)-1)) * (c - Sum_{j = 1..i} 1/primorial(i)) = 1.460025488658067356046281458556..., where t(i) = A000217(i) and gap(i) = A001223(i). - Amiram Eldar, Feb 20 2025

Examples

			   n   A049345  the rightmost nonzero = a(n)
---------------------------------------------------------
   0       0             0
   1       1             1
   2      10             1
   3      11             1
   4      20             2
   5      21             1
   6     100             1
   7     101             1
   8     110             1
   9     111             1
  10     120             2
  11     121             1
  12     200             2
  13     201             1
  14     210             1
  15     211             1
  16     220             2
.
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.
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).
		

Crossrefs

Programs

  • Mathematica
    nn = 120; b = MixedRadix[Reverse@ Prime@ Range@ PrimePi[nn + 1]]; Table[Last[IntegerDigits[n, b] /. 0 -> Nothing, 0], {n, 0, nn}] (* Version 11, or *)
    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 *)
  • 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
    
  • Python
    from sympy import nextprime, primepi, primorial
    def a053669(n):
        p = 2
        while True:
            if n%p!=0: return p
            else: p=nextprime(p)
    def a257993(n): return primepi(a053669(n))
    def a002110(n): return 1 if n<1 else primorial(n)
    def a276094(n): return 0 if n==0 else n%a002110(a257993(n))
    def a(n): return 0 if n==0 else a276094(n)//a002110(a257993(n) - 1)
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 22 2017
  • Scheme
    (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)))))))
    
  • Scheme
    (define (A276088 n) (if (zero? n) n (/ (A276094 n) (A002110 (A276084 n)))))
    

Formula

a(0) = 0, and for n >= 1, a(n) = A276094(n) / A002110(A276084(n)).
From Antti Karttunen, Oct 29 2019: (Start)
a(n) = A067029(A276086(n)).
a(A276086(n)) = A328569(n).
(End).

A328570 Index of the least significant zero digit in the primorial base expansion of n, when the rightmost digit is in the position 1.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Oct 20 2019

Keywords

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.

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.
		

Crossrefs

Programs

  • PARI
    A328570(n) = { my(i=1, p=2); while(n && (n%p), i++; n = n\p; p = nextprime(1+p)); (i); };

Formula

a(n) = A000720(A326810(n)) = A257993(A276086(n)) = A055396(A276087(n)).
For all n >= 0, A002110(a(n)) = A328580(n), a(A276086(n)) = A328578(n).
For all odd n, A000040(a(n)) = A326810(n) > A276088(n).
For all n >= 0, A276086(n)/A002110(a(n)-1) = A328475(n) and A276086(n)-A002110(a(n)-1) = A328476(n).

A328579 a(n) = A053669(A276086(A276086(n))).

Original entry on oeis.org

3, 2, 5, 2, 7, 2, 5, 2, 7, 2, 11, 2, 3, 2, 11, 2, 7, 2, 5, 2, 13, 2, 13, 2, 3, 2, 13, 2, 17, 2, 3, 2, 7, 2, 5, 2, 5, 2, 11, 2, 13, 2, 3, 2, 13, 2, 13, 2, 5, 2, 17, 2, 17, 2, 3, 2, 17, 2, 11, 2, 3, 2, 11, 2, 7, 2, 5, 2, 13, 2, 13, 2, 3, 2, 17, 2, 17, 2, 5, 2, 17, 2, 19, 2, 3, 2, 13, 2, 19, 2, 3, 2, 13, 2, 17, 2, 5, 2, 17, 2, 17, 2, 3, 2, 17, 2
Offset: 0

Views

Author

Antti Karttunen, Oct 20 2019

Keywords

Crossrefs

Programs

Formula

a(n) = A053669(A276087(n)).
a(n) = A326810(A276086(n)).
a(n) = A000040(A328578(n)).
For all even n, a(n) > A328569(n).
Showing 1-3 of 3 results.