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-10 of 21 results. Next

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).

A276086 Primorial base exp-function: digits in primorial base representation of n become the exponents of successive prime factors whose product a(n) is.

Original entry on oeis.org

1, 2, 3, 6, 9, 18, 5, 10, 15, 30, 45, 90, 25, 50, 75, 150, 225, 450, 125, 250, 375, 750, 1125, 2250, 625, 1250, 1875, 3750, 5625, 11250, 7, 14, 21, 42, 63, 126, 35, 70, 105, 210, 315, 630, 175, 350, 525, 1050, 1575, 3150, 875, 1750, 2625, 5250, 7875, 15750, 4375, 8750, 13125, 26250, 39375, 78750, 49, 98, 147, 294, 441, 882, 245, 490, 735, 1470, 2205, 4410, 1225, 2450
Offset: 0

Views

Author

Antti Karttunen, Aug 21 2016

Keywords

Comments

Prime product form of primorial base expansion of n.
Sequence is a permutation of A048103. It maps the smallest prime not dividing n to the smallest prime dividing n, that is, A020639(a(n)) = A053669(n) holds for all n >= 1.
The sequence satisfies the exponential function identity, a(x + y) = a(x) * a(y), whenever A329041(x,y) = 1, that is, when adding x and y together will not generate any carries in the primorial base. Examples of such pairs of x and y are A328841(n) & A328842(n), and also A328770(n) (when added with itself). - Antti Karttunen, Oct 31 2019
From Antti Karttunen, Feb 18 2022: (Start)
The conjecture given in A327969 asks whether applying this function together with the arithmetic derivative (A003415) in some combination or another can eventually transform every positive integer into zero.
Another related open question asks whether there are any other numbers than n=6 such that when starting from that n and by iterating with A003415, one eventually reaches a(n). See comments in A351088.
This sequence is used in A351255 to list the terms of A099308 in a different order, by the increasing exponents of the successive primes in their prime factorization. (End)
From Bill McEachen, Oct 15 2022: (Start)
From inspection, the least significant decimal digits of a(n) terms form continuous chains of 30 as follows. For n == i (mod 30), i=0..5, there are 6 ordered elements of these 8 {1,2,3,6,9,8,7,4}. Then for n == i (mod 30), i=6..29, there are 12 repeated pairs = {5,0}.
Moreover, when the individual elements of any of the possible groups of 6 are transformed via (7*digit) (mod 10), the result matches one of the other 7 groupings (not all 7 may be seen). As example, {1,2,3,6,9,8} transforms to {7,4,1,2,3,6}. (End)
The least significant digit of a(n) in base 4 is given by A353486, and in base 6 by A358840. - Antti Karttunen, Oct 25 2022, Feb 17 2024

Examples

			For n = 24, which has primorial base representation (see A049345) "400" as 24 = 4*A002110(2) + 0*A002110(1) + 0*A002110(0) = 4*6 + 0*2 + 0*1, thus a(24) = prime(3)^4 * prime(2)^0 * prime(1)^0 = 5^4 = 625.
For n = 35 = "1021" as 35 = 1*A002110(3) + 0*A002110(2) + 2*A002110(1) + 1*A002110(0) = 1*30 + 0*6 + 2*2 + 1*1, thus a(35) = prime(4)^1 * prime(2)^2 * prime(1) = 7 * 3*3 * 2 = 126.
		

Crossrefs

Cf. A276085 (a left inverse) and also A276087, A328403.
Cf. A048103 (terms sorted into ascending order), A100716 (natural numbers not present in this sequence).
Cf. A278226 (associated filter-sequence), A286626 (and its rgs-version), A328477.
Cf. A328316 (iterates started from zero).
Cf. A327858, A327859, A327860, A327963, A328097, A328098, A328099, A328110, A328112, A328382 for various combinations with arithmetic derivative (A003415).
Cf. also A327167, A329037.
Cf. A019565 and A054842 for base-2 and base-10 analogs and A276076 for the analogous "factorial base exp-function", from which this differs for the first time at n=24, where a(24)=625 while A276076(24)=7.
Cf. A327969, A351088, A351458 for sequences with conjectures involving this sequence.

Programs

  • Mathematica
    b = MixedRadix[Reverse@ Prime@ Range@ 12]; Table[Function[k, Times @@ Power @@@ # &@ Transpose@ {Prime@ Range@ Length@ k, Reverse@ k}]@ IntegerDigits[n, b], {n, 0, 51}] (* Michael De Vlieger, Aug 23 2016, Version 10.2 *)
    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]]]; Table[Times @@ Flatten@ MapIndexed[Prime[#2]^#1 &, Reverse@ f@ n], {n, 0, 73}] (* Michael De Vlieger, Aug 30 2016, Pre-Version 10 *)
    a[n0_] := Module[{m = 1, i = 1, n = n0, p}, While[n > 0, p = Prime[i]; m *= p^Mod[n, p]; n = Quotient[n, p]; i++]; m];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Dec 01 2021, after Antti Karttunen's Sage code *)
  • PARI
    A276086(n) = { my(i=0,m=1,pr=1,nextpr); while((n>0),i=i+1; nextpr = prime(i)*pr; if((n%nextpr),m*=(prime(i)^((n%nextpr)/pr));n-=(n%nextpr));pr=nextpr); m; }; \\ Antti Karttunen, May 12 2017
    
  • PARI
    A276086(n) = { my(m=1, p=2); while(n, m *= (p^(n%p)); n = n\p; p = nextprime(1+p)); (m); }; \\ (Better than above one, avoids unnecessary construction of primorials). - Antti Karttunen, Oct 14 2019
    
  • Python
    from sympy import prime
    def a(n):
        i=0
        m=pr=1
        while n>0:
            i+=1
            N=prime(i)*pr
            if n%N!=0:
                m*=(prime(i)**((n%N)/pr))
                n-=n%N
            pr=N
        return m # Indranil Ghosh, May 12 2017, after Antti Karttunen's PARI code
    
  • Python
    from sympy import nextprime
    def a(n):
        m, p = 1, 2
        while n > 0:
            n, r = divmod(n, p)
            m *= p**r
            p = nextprime(p)
        return m
    print([a(n) for n in range(74)])  # Peter Luschny, Apr 20 2024
  • Sage
    def A276086(n):
        m=1
        i=1
        while n>0:
            p = sloane.A000040(i)
            m *= (p**(n%p))
            n = floor(n/p)
            i += 1
        return (m)
    # Antti Karttunen, Oct 14 2019, after Indranil Ghosh's Python code above, and my own leaner PARI code from Oct 14 2019. This avoids unnecessary construction of primorials.
    
  • Scheme
    (define (A276086 n) (let loop ((n n) (t 1) (i 1)) (if (zero? n) t (let* ((p (A000040 i)) (d (modulo n p))) (loop (/ (- n d) p) (* t (expt p d)) (+ 1 i))))))
    
  • Scheme
    (definec (A276086 n) (if (zero? n) 1 (* (expt (A053669 n) (A276088 n)) (A276086 (A276093 n))))) ;; Needs macro definec from http://oeis.org/wiki/Memoization#Scheme
    
  • Scheme
    (definec (A276086 n) (if (zero? n) 1 (* (A053669 n) (A276086 (- n (A002110 (A276084 n))))))) ;; Needs macro definec from http://oeis.org/wiki/Memoization#Scheme
    

Formula

a(0) = 1; for n >= 1, a(n) = A053669(n) * a(A276151(n)) = A053669(n) * a(n-A002110(A276084(n))).
a(0) = 1; for n >= 1, a(n) = A053669(n)^A276088(n) * a(A276093(n)).
a(n) = A328841(a(n)) + A328842(a(n)) = A328843(n) + A328844(n).
a(n) = a(A328841(n)) * a(A328842(n)) = A328571(n) * A328572(n).
a(n) = A328475(n) * A328580(n) = A328476(n) + A328580(n).
a(A002110(n)) = A000040(n+1). [Maps primorials to primes]
a(A143293(n)) = A002110(n+1). [Maps partial sums of primorials to primorials]
a(A057588(n)) = A276092(n).
a(A276156(n)) = A019565(n).
a(A283477(n)) = A324289(n).
a(A003415(n)) = A327859(n).
Here the text in brackets shows how the right hand side sequence is a function of the primorial base expansion of n:
A001221(a(n)) = A267263(n). [Number of nonzero digits]
A001222(a(n)) = A276150(n). [Sum of digits]
A067029(a(n)) = A276088(n). [The least significant nonzero digit]
A071178(a(n)) = A276153(n). [The most significant digit]
A061395(a(n)) = A235224(n). [Number of significant digits]
A051903(a(n)) = A328114(n). [Largest digit]
A055396(a(n)) = A257993(n). [Number of trailing zeros + 1]
A257993(a(n)) = A328570(n). [Index of the least significant zero digit]
A079067(a(n)) = A328620(n). [Number of nonleading zeros]
A056169(a(n)) = A328614(n). [Number of 1-digits]
A056170(a(n)) = A328615(n). [Number of digits larger than 1]
A277885(a(n)) = A328828(n). [Index of the least significant digit > 1]
A134193(a(n)) = A329028(n). [The least missing nonzero digit]
A005361(a(n)) = A328581(n). [Product of nonzero digits]
A072411(a(n)) = A328582(n). [LCM of nonzero digits]
A001055(a(n)) = A317836(n). [Number of carry-free partitions of n in primorial base]
Various number theoretical functions applied:
A000005(a(n)) = A324655(n). [Number of divisors of a(n)]
A000203(a(n)) = A324653(n). [Sum of divisors of a(n)]
A000010(a(n)) = A324650(n). [Euler phi applied to a(n)]
A023900(a(n)) = A328583(n). [Dirichlet inverse of Euler phi applied to a(n)]
A069359(a(n)) = A329029(n). [Sum a(n)/p over primes p dividing a(n)]
A003415(a(n)) = A327860(n). [Arithmetic derivative of a(n)]
Other identities:
A276085(a(n)) = n. [A276085 is a left inverse]
A020639(a(n)) = A053669(n). [The smallest prime not dividing n -> the smallest prime dividing n]
A046523(a(n)) = A278226(n). [Least number with the same prime signature as a(n)]
A246277(a(n)) = A329038(n).
A181819(a(n)) = A328835(n).
A053669(a(n)) = A326810(n), A326810(a(n)) = A328579(n).
A257993(a(n)) = A328570(n), A328570(a(n)) = A328578(n).
A328613(a(n)) = A328763(n), A328620(a(n)) = A328766(n).
A328828(a(n)) = A328829(n).
A053589(a(n)) = A328580(n). [Greatest primorial number which divides a(n)]
A276151(a(n)) = A328476(n). [... and that primorial subtracted from a(n)]
A111701(a(n)) = A328475(n).
A328114(a(n)) = A328389(n). [Greatest digit of primorial base expansion of a(n)]
A328389(a(n)) = A328394(n), A328394(a(n)) = A328398(n).
A235224(a(n)) = A328404(n), A328405(a(n)) = A328406(n).
a(A328625(n)) = A328624(n), a(A328626(n)) = A328627(n). ["Twisted" variants]
a(A108951(n)) = A324886(n).
a(n) mod n = A328386(n).
a(a(n)) = A276087(n), a(a(a(n))) = A328403(n). [2- and 3-fold applications]
a(2n+1) = 2 * a(2n). - Antti Karttunen, Feb 17 2022

Extensions

Name edited and new link-formulas added by Antti Karttunen, Oct 29 2019
Name changed again by Antti Karttunen, Feb 05 2022

A276150 Sum of digits when n is written in primorial base (A049345); minimal number of primorials (A002110) that add to n.

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 1, 2, 2, 3, 3, 4, 2, 3, 3, 4, 4, 5, 3, 4, 4, 5, 5, 6, 4, 5, 5, 6, 6, 7, 1, 2, 2, 3, 3, 4, 2, 3, 3, 4, 4, 5, 3, 4, 4, 5, 5, 6, 4, 5, 5, 6, 6, 7, 5, 6, 6, 7, 7, 8, 2, 3, 3, 4, 4, 5, 3, 4, 4, 5, 5, 6, 4, 5, 5, 6, 6, 7, 5, 6, 6, 7, 7, 8, 6, 7, 7, 8, 8, 9, 3, 4, 4, 5, 5, 6, 4, 5, 5, 6, 6, 7, 5, 6, 6, 7, 7, 8, 6, 7, 7, 8, 8, 9, 7, 8, 8, 9, 9, 10, 4
Offset: 0

Views

Author

Antti Karttunen, Aug 22 2016

Keywords

Comments

The sum of digits of n in primorial base is odd if n is 1 or 2 (mod 4) and even if n is 0 or 3 (mod 4). Proof: primorials are 1 or 2 (mod 4) and a(n) can be constructed via the greedy algorithm. So if n = 4k + r where 0 <= r < 4, 4k needs an even number of primorials and r needs hammingweight(r) = A000120(r) primorials. Q.E.D. - David A. Corneth, Feb 27 2019

Examples

			For n=24, which is "400" in primorial base (as 24 = 4*(3*2*1) + 0*(2*1) + 0*1, see A049345), the sum of digits is 4, thus a(24) = 4.
		

Crossrefs

Cf. A333426 [k such that a(k)|k], A339215 [numbers not of the form x+a(x) for any x], A358977 [k such that gcd(k, a(k)) = 1].
Cf. A014601, A042963 (positions of even and odd terms), A343048 (positions of records).
Differs from analogous A034968 for the first time at n=24.

Programs

  • Mathematica
    nn = 120; b = MixedRadix[Reverse@ Prime@ NestWhileList[# + 1 &, 1, Times @@ Prime@ Range[# + 1] <= nn &]]; Table[Total@ IntegerDigits[n, b], {n, 0, nn}] (* Version 10.2, or *)
    nn = 120; 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]]]; Table[Total@ f@ n, {n, 0, 120}] (* Michael De Vlieger, Aug 26 2016 *)
  • PARI
    A276150(n) = { my(s=0, p=2, d); while(n, d = (n%p); s += d; n = (n-d)/p; p = nextprime(1+p)); (s); }; \\ Antti Karttunen, Feb 27 2019
  • Python
    from sympy import prime, primefactors
    def Omega(n): return 0 if n==1 else Omega(n//primefactors(n)[0]) + 1
    def a276086(n):
        i=0
        m=pr=1
        while n>0:
            i+=1
            N=prime(i)*pr
            if n%N!=0:
                m*=(prime(i)**((n%N)/pr))
                n-=n%N
            pr=N
        return m
    def a(n): return Omega(a276086(n))
    print([a(n) for n in range(201)]) # Indranil Ghosh, Jun 23 2017
    

Formula

a(n) = 1 + a(A276151(n)) = 1 + a(n-A002110(A276084(n))), a(0) = 0.
or for n >= 1: a(n) = 1 + a(n-A260188(n)).
Other identities and observations. For all n >= 0:
a(n) = A001222(A276086(n)) = A001222(A278226(n)).
a(n) >= A371091(n) >= A267263(n).
From Antti Karttunen, Feb 27 2019: (Start)
a(n) = A000120(A277022(n)).
a(A283477(n)) = A324342(n).
(End)
a(n) = A373606(n) + A373607(n). - Antti Karttunen, Jun 19 2024

A257993 Least gap in the partition having Heinz number n; index of the least prime not dividing n.

Original entry on oeis.org

1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3
Offset: 1

Views

Author

Emeric Deutsch, May 18 2015

Keywords

Comments

The "least gap" of a partition is the least positive integer that is not a part of the partition. For example, the least gap of the partition [7,4,2,2,1] is 3.
We define the Heinz number of a partition p = [p_1, p_2, ..., p_r] as Product(p_j-th prime, j=1...r) (concept used by Alois P. Heinz in A215366 as an "encoding" of a partition). For example, for the partition [1, 1, 2, 4, 10] we get 2*2*3*7*29 = 2436.
In the Maple program the subprogram B yields the partition with Heinz number n.
Sum of least gaps of all partitions of m = A022567(m).
From Antti Karttunen, Aug 22 2016: (Start)
Index of the least prime not dividing n. (After a formula given by Heinz.)
Least k such that A002110(k) does not divide n.
One more than the number of trailing zeros in primorial base representation of n, A049345.
(End)
The least gap is also called the mex (minimal excludant) of the partition. - Gus Wiseman, Apr 20 2021

Examples

			a(18) = 3 because the partition having Heinz number 18 = 2*3*3 is [1,2,2], having least gap equal to 3.
		

References

  • G. E. Andrews and K. Eriksson, Integer Partitions, Cambridge Univ. Press, 2004, Cambridge.
  • Miklós Bóna, A Walk Through Combinatorics, World Scientific Publishing Co., 2002.

Crossrefs

Positions of 1's are A005408.
Positions of 2's are A047235.
The number of gaps is A079067.
The version for crank is A257989.
The triangle counting partitions by this statistic is A264401.
One more than A276084.
The version for greatest difference is A286469 or A286470.
A maximal instead of minimal version is A339662.
Positions of even terms are A342050.
Positions of odd terms are A342051.
A000070 counts partitions with a selected part.
A006128 counts partitions with a selected position.
A056239 adds up prime indices, row sums of A112798.
A073491 lists numbers with gap-free prime indices.
A238709 counts partitions by sum and least difference.
A333214 lists positions of adjacent unequal prime gaps.
A339737 counts partitions by sum and greatest gap.

Programs

  • Maple
    with(numtheory): a := proc (n) local B, q: B := proc (n) local nn, j, m: nn := op(2, ifactors(n)): for j to nops(nn) do m[j] := op(j, nn) end do: [seq(seq(pi(op(1, m[i])), q = 1 .. op(2, m[i])), i = 1 .. nops(nn))] end proc: for q while member(q, B(n)) = true do  end do: q end proc: seq(a(n), n = 1 .. 150);
    # second Maple program:
    a:= n-> `if`(n=1, 1, (s-> min({$1..(max(s)+1)} minus s))(
            {map(x-> numtheory[pi](x[1]), ifactors(n)[2])[]})):
    seq(a(n), n=1..100);  # Alois P. Heinz, May 09 2016
    # faster:
    A257993 := proc(n) local p, c; c := 1; p := 2;
    while n mod p = 0 do p := nextprime(p); c := c + 1 od: c end:
    seq(A257993(n), n=1..100); # Peter Luschny, Jun 04 2017
  • Mathematica
    A053669[n_] := For[p = 2, True, p = NextPrime[p], If[CoprimeQ[p, n], Return[p]]]; a[n_] := PrimePi[A053669[n]]; Array[a, 100] (* Jean-François Alcover, Nov 28 2016 *)
    Table[k = 1; While[! CoprimeQ[Prime@ k, n], k++]; k, {n, 100}] (* Michael De Vlieger, Jun 22 2017 *)
  • PARI
    a(n) = forprime(p=2,, if (n % p, return(primepi(p)))); \\ Michel Marcus, Jun 22 2017
  • Python
    from sympy import nextprime, primepi
    def a053669(n):
        p = 2
        while True:
            if n%p!=0: return p
            else: p=nextprime(p)
    def a(n): return primepi(a053669(n)) # Indranil Ghosh, May 12 2017
    
  • Scheme
    (define (A257993 n) (let loop ((n n) (i 1)) (let* ((p (A000040 i)) (d (modulo n p))) (if (not (zero? d)) i (loop (/ (- n d) p) (+ 1 i))))))
    ;; Antti Karttunen, Aug 22 2016
    

Formula

a(n) = A000720(A053669(n)). - Alois P. Heinz, May 18 2015
From Antti Karttunen, Aug 22-30 2016: (Start)
a(n) = 1 + A276084(n).
a(n) = A055396(A276086(n)).
A276152(n) = A002110(a(n)).
(End)
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 1 + Sum_{k>=1} 1/A002110(k) = 1.705230... (1 + A064648). - Amiram Eldar, Jul 23 2022
a(n) << log n/log log n. - Charles R Greathouse IV, Dec 03 2022

Extensions

A simpler description added to the name by Antti Karttunen, Aug 22 2016

A276156 Numbers obtained by reinterpreting base-2 representation of n in primorial base: a(0) = 0, a(2n) = A276154(a(n)), a(2n+1) = 1 + A276154(a(n)).

Original entry on oeis.org

0, 1, 2, 3, 6, 7, 8, 9, 30, 31, 32, 33, 36, 37, 38, 39, 210, 211, 212, 213, 216, 217, 218, 219, 240, 241, 242, 243, 246, 247, 248, 249, 2310, 2311, 2312, 2313, 2316, 2317, 2318, 2319, 2340, 2341, 2342, 2343, 2346, 2347, 2348, 2349, 2520, 2521, 2522, 2523, 2526, 2527, 2528, 2529, 2550, 2551, 2552, 2553, 2556, 2557, 2558, 2559, 30030, 30031
Offset: 0

Views

Author

Antti Karttunen, Aug 24 2016

Keywords

Comments

Numbers that are sums of distinct primorial numbers, A002110.
Numbers with no digits larger than one in primorial base, A049345.

Crossrefs

Complement of A177711.
Subsequences: A328233, A328832, A328462 (odd bisection).
Conjectured subsequences: A328110, A380527.
Fixed points of A328841, positions of zeros in A328828, A328842, and A329032, positions of ones in A328581, A328582, and A381032.
Positions of terms < 2 in A328114.
Indices where A327860 and A329029 coincide.
Cf. also table A328464 (and its rows).

Programs

  • Mathematica
    nn = 65; b = MixedRadix[Reverse@ Prime@ Range[IntegerLength[nn, 2] - 1]]; Table[FromDigits[IntegerDigits[n, 2], b], {n, 0, 65}] (* Version 10.2, or *)
    Table[Total[Times @@@ Transpose@ {Map[Times @@ # &, Prime@ Range@ Range[0, Length@ # - 1]], Reverse@ #}] &@ IntegerDigits[n, 2], {n, 0, 65}] (* Michael De Vlieger, Aug 26 2016 *)
  • PARI
    A276156(n) = { my(s=0, p=1, r=1); while(n, if(n%2, s += r); n>>=1; p = nextprime(1+p); r *= p); (s); }; \\ Antti Karttunen, Feb 03 2022
  • Python
    from sympy import prime, primorial, primepi, factorint
    from operator import mul
    def a002110(n): return 1 if n<1 else primorial(n)
    def a276085(n):
        f=factorint(n)
        return sum([f[i]*a002110(primepi(i) - 1) for i in f])
    def a019565(n): return reduce(mul, (prime(i+1) for i, v in enumerate(bin(n)[:1:-1]) if v == '1')) # after Chai Wah Wu
    def a(n): return 0 if n==0 else a276085(a019565(n))
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 23 2017
    

Formula

a(0) = 0, a(2n) = A276154(a(n)), a(2n+1) = 1+A276154(a(n)).
Other identities. For all n >= 0:
a(n) = A276085(A019565(n)).
A049345(a(n)) = A007088(n).
A257993(a(n)) = A001511(n).
A276084(a(n)) = A007814(n).
A051903(a(n)) = A351073(n).

A329900 Primorial deflation of n: starting from x = n, repeatedly divide x by the largest primorial A002110(k) that divides it, until x is an odd number. Then a(n) = Product prime(k_i), for primorial indices k_1 >= k_2 >= ..., encountered in the process.

Original entry on oeis.org

1, 2, 1, 4, 1, 3, 1, 8, 1, 2, 1, 6, 1, 2, 1, 16, 1, 3, 1, 4, 1, 2, 1, 12, 1, 2, 1, 4, 1, 5, 1, 32, 1, 2, 1, 9, 1, 2, 1, 8, 1, 3, 1, 4, 1, 2, 1, 24, 1, 2, 1, 4, 1, 3, 1, 8, 1, 2, 1, 10, 1, 2, 1, 64, 1, 3, 1, 4, 1, 2, 1, 18, 1, 2, 1, 4, 1, 3, 1, 16, 1, 2, 1, 6, 1, 2, 1, 8, 1, 5, 1, 4, 1, 2, 1, 48, 1, 2, 1, 4, 1, 3, 1, 8, 1
Offset: 1

Views

Author

Antti Karttunen, Dec 22 2019

Keywords

Comments

When applied to arbitrary n, the "primorial deflation" (term coined by Matthew Vandermast in A181815) induces the splitting of n to two factors A328478(n)*A328479(n) = n, where we call A328478(n) the non-deflatable component of n (which is essentially discarded), while A328479(n) is the deflatable component. Only if n is in A025487, then the entire n is deflatable, i.e., A328478(n) = 1 and A328479(n) = n.
According to Daniel Suteu, also the ratio (A319626(n) / A319627(n)) can be viewed as a "primorial deflation". That definition coincides with this one when restricted to terms of A025487, as for all k in A025487, A319626(k) = a(k), and A319627(k) = 1. - Antti Karttunen, Dec 29 2019

Crossrefs

Programs

  • Mathematica
    Array[If[OddQ@ #, 1, Times @@ Prime@ # &@ Rest@ NestWhile[Append[#1, {#3, Drop[#, -LengthWhile[Reverse@ #, # == 0 &]] &[#2 - PadRight[ConstantArray[1, #3], Length@ #2]]}] & @@ {#1, #2, LengthWhile[#2, # > 0 &]} & @@ {#, #[[-1, -1]]} &, {{0, TakeWhile[If[# == 1, {0}, Function[f, ReplacePart[Table[0, {PrimePi[f[[-1, 1]]]}], #] &@ Map[PrimePi@ First@ # -> Last@ # &, f]]@ FactorInteger@ #], # > 0 &]}}, And[FreeQ[#[[-1, -1]], 0], Length[#[[-1, -1]] ] != 0] &][[All, 1]] ] &, 105] (* Michael De Vlieger, Dec 28 2019 *)
    Array[Times @@ Prime@(TakeWhile[Reap[FixedPointList[Block[{k = 1}, While[Mod[#, Prime@ k] == 0, k++]; Sow[k - 1]; #/Product[Prime@ i, {i, k - 1}]] &, #]][[-1, 1]], # > 0 &]) &, 105] (* Michael De Vlieger, Jan 11 2020 *)
  • PARI
    A329900(n) = { my(m=1, pp=1); while(1, forprime(p=2, ,if(n%p, if(2==p, return(m), break), n /= p; pp = p)); m *= pp); (m); };
    
  • PARI
    A111701(n) = forprime(p=2, , if(n%p, return(n), n /= p));
    A276084(n) = { for(i=1,oo,if(n%prime(i),return(i-1))); }
    A329900(n) = if(n%2,1,prime(A276084(n))*A329900(A111701(n)));

Formula

For odd n, a(n) = 1, for even n, a(n) = A000040(A276084(n)) * a(A111701(n)).
For even n, a(n) = A000040(A276084(n)) * a(n/A002110(A276084(n))).
A108951(a(n)) = A328479(n), for n >= 1.
a(A108951(n)) = n, for n >= 1.
a(A328479(n)) = a(n), for n >= 1.
a(A328478(n)) = 1, for n >= 1.
a(A002110(n)) = A000040(n), for n >= 1.
a(A000142(n)) = A307035(n), for n >= 0.
a(A283477(n)) = A019565(n), for n >= 0.
a(A329886(n)) = A005940(1+n), for n >= 0.
a(A329887(n)) = A163511(n), for n >= 0.
a(A329602(n)) = A329888(n), for n >= 1.
a(A025487(n)) = A181815(n), for n >= 1.
a(A124859(n)) = A181819(n), for n >= 1.
a(A181817(n)) = A025487(n), for n >= 1.
a(A181821(n)) = A122111(n), for n >= 1.
a(A002182(n)) = A329902(n), for n >= 1.
a(A260633(n)) = A329889(n), for n >= 1.
a(A033833(n)) = A330685(n), for n >= 1.
a(A307866(1+n)) = A330686(n), for n >= 1.
a(A330687(n)) = A330689(n), for n >= 1.

A053589 Greatest primorial number (A002110) which divides n.

Original entry on oeis.org

1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 30, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 30, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 30, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 6
Offset: 1

Views

Author

Frederick Magata (frederick.magata(AT)uni-muenster.de), Jan 19 2000

Keywords

Examples

			a(30) = 30 because 30=2*3*5, a(15) = 1 because 15=3*5.
		

Crossrefs

Programs

  • Maple
    N:= 1000: # to get a(1)..a(N)
    P:= 1: p:= 1:
    A:= Vector(N,1):
    do
      p:= nextprime(p);
      P:= P*p;
      if P > N then break fi;
      A[[seq(i,i=P..N,P)]]:= P;
    od:
    convert(A,list); # Robert Israel, Aug 30 2016
  • Mathematica
    Table[k = 1; While[Divisible[n, Times @@ Prime@ Range@ k], k++]; Times @@ Prime@ Range[k - 1], {n, 120}] (* Michael De Vlieger, Aug 30 2016 *)
  • PARI
    a(n)=my(f=factor(n), r = 1, k = 1, p); while(k<=matsize(f)[1], p=prime(k); if(f[k,1]!=p,return(r));r*=p; k++) ; r
    a(n) = my(r = 1, p = 2); while(n/p==n\p, r*=p; p=nextprime(p+1));r
    \\ list of all terms up to n#.
    lista(n) = my(l = List([1]),k,s=1); forprime(i=2,n, for(j=1,i-1, for(k=1,s, listput(l,l[k]))); l[#l]*=i; s=#l); l \\ David A. Corneth, Aug 30 2016
    
  • PARI
    a(n)=my(s=1); forprime(p=2,, if(n%p, return(s), s *= p)) \\ Charles R Greathouse IV, Sep 07 2016
  • Scheme
    (define (A053589 n) (A002110 (A276084 n))) ;; Antti Karttunen, Aug 30 2016
    

Formula

From Antti Karttunen, Aug 30 2016: (Start)
a(n) = A002110(A276084(n)).
a(n) = n/A111701(n).
A276157(n) = A260188(n)/a(n).
(End)

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Oct 02 2000

A342050 Numbers k which have an odd number of trailing zeros in their primorial base representation A049345(k).

Original entry on oeis.org

2, 4, 8, 10, 14, 16, 20, 22, 26, 28, 30, 32, 34, 38, 40, 44, 46, 50, 52, 56, 58, 60, 62, 64, 68, 70, 74, 76, 80, 82, 86, 88, 90, 92, 94, 98, 100, 104, 106, 110, 112, 116, 118, 120, 122, 124, 128, 130, 134, 136, 140, 142, 146, 148, 150, 152, 154, 158, 160, 164, 166, 170, 172, 176, 178, 180, 182, 184, 188, 190, 194, 196, 200, 202, 206, 208, 212
Offset: 1

Views

Author

Amiram Eldar, Feb 26 2021

Keywords

Comments

Numbers k such that A276084(k) is odd.
All the terms are even since odd numbers have 0 trailing zeros, and 0 is not odd.
The number of terms not exceeding A002110(m) for m>=1 is A002110(m) * Sum_{k=1..m}(-1)^k/A002110(k) = 1, 2, 11, 76, 837, 10880, 184961, ...
The asymptotic density of this sequence is Sum_{k>=1} (-1)^(k+1)/A002110(k) = 0.362306... (A132120).
Also Heinz numbers of partitions with even least gap. The least gap (mex or minimal excludant) of a partition is the least positive integer that is not a part. The Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k), giving a bijective correspondence between positive integers and integer partitions. - Gus Wiseman, Apr 23 2021
Numbers k such that A000720(A053669(k)) is even. Differences from the related A353531 seem to be terms that are multiples of 210, but not all of them, for example primorial 30030 (= 143*210) is in neither sequence. Consider also A038698. - Antti Karttunen, Apr 25 2022

Examples

			2 is a term since A049345(2) = 10 has 1 trailing zero.
4 is a term since A049345(2) = 20 has 1 trailing zero.
30 is a term since A049345(2) = 1000 has 3 trailing zeros.
From _Gus Wiseman_, Apr 23 2021: (Start)
The sequence of terms together with their prime indices begins:
      2: {1}             46: {1,9}             90: {1,2,2,3}
      4: {1,1}           50: {1,3,3}           92: {1,1,9}
      8: {1,1,1}         52: {1,1,6}           94: {1,15}
     10: {1,3}           56: {1,1,1,4}         98: {1,4,4}
     14: {1,4}           58: {1,10}           100: {1,1,3,3}
     16: {1,1,1,1}       60: {1,1,2,3}        104: {1,1,1,6}
     20: {1,1,3}         62: {1,11}           106: {1,16}
     22: {1,5}           64: {1,1,1,1,1,1}    110: {1,3,5}
     26: {1,6}           68: {1,1,7}          112: {1,1,1,1,4}
     28: {1,1,4}         70: {1,3,4}          116: {1,1,10}
     30: {1,2,3}         74: {1,12}           118: {1,17}
     32: {1,1,1,1,1}     76: {1,1,8}          120: {1,1,1,2,3}
     34: {1,7}           80: {1,1,1,1,3}      122: {1,18}
     38: {1,8}           82: {1,13}           124: {1,1,11}
     40: {1,1,1,3}       86: {1,14}           128: {1,1,1,1,1,1,1}
     44: {1,1,5}         88: {1,1,1,5}        130: {1,3,6}
(End)
		

Crossrefs

Complement of A342051.
A099800 is subsequence.
Analogous sequences: A001950 (Zeckendorf representation), A036554 (binary), A145204 (ternary), A217319 (base 4), A232745 (factorial base).
The version for reversed binary expansion is A079523.
Positions of even terms in A257993.
A000070 counts partitions with a selected part.
A056239 adds up prime indices, row sums of A112798.
A073491 lists numbers with gap-free prime indices.
A079067 counts gaps in prime indices.
A238709 counts partitions by sum and least difference.
A333214 lists positions of adjacent unequal prime gaps.
A339662 gives greatest gap in prime indices.
Differs from A353531 for the first time at n=77, where a(77) = 212, as this sequence misses A353531(77) = 210.

Programs

  • Mathematica
    seq[max_] := Module[{bases = Prime@Range[max, 1, -1], nmax}, nmax = Times @@ bases - 1; Select[Range[nmax], OddQ @ LengthWhile[Reverse @ IntegerDigits[#, MixedRadix[bases]], #1 == 0 &] &]]; seq[4]
    Select[Range[100],EvenQ[Min@@Complement[Range[PrimeNu[#]+1],PrimePi/@First/@FactorInteger[#]]]&] (* Gus Wiseman, Apr 23 2021 *)
  • PARI
    A353525(n) = { for(i=1,oo,if(n%prime(i),return((i+1)%2))); }
    isA342050(n) = A353525(n);
    k=0; n=0; while(k<77, n++; if(isA342050(n), k++; print1(n,", "))); \\ Antti Karttunen, Apr 25 2022

Extensions

More terms added (to differentiate from A353531) by Antti Karttunen, Apr 25 2022

A342051 Numbers k which have an even number of trailing zeros in their primorial base representation A049345(k).

Original entry on oeis.org

1, 3, 5, 6, 7, 9, 11, 12, 13, 15, 17, 18, 19, 21, 23, 24, 25, 27, 29, 31, 33, 35, 36, 37, 39, 41, 42, 43, 45, 47, 48, 49, 51, 53, 54, 55, 57, 59, 61, 63, 65, 66, 67, 69, 71, 72, 73, 75, 77, 78, 79, 81, 83, 84, 85, 87, 89, 91, 93, 95, 96, 97, 99, 101, 102, 103
Offset: 1

Views

Author

Amiram Eldar, Feb 26 2021

Keywords

Comments

Numbers k such that A276084(k) is even.
The number of terms not exceeding A002110(m) for m>=1 is A002110(m) * (1 - Sum_{k=1..m}(-1)^k/A002110(k)) = 1, 4, 19, 134, 1473, 19150, 325549 ...
The asymptotic density of this sequence is Sum_{k>=0} (-1)^k/A002110(k) = 0.637693... = 1 - A132120.
Also Heinz numbers of partitions with odd least gap. The least gap (mex or minimal excludant) of a partition is the least positive integer that is not a part. The Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k), giving a bijective correspondence between positive integers and integer partitions. - Gus Wiseman, Apr 23 2021

Examples

			1 is a term since A049345(1) = 1 has 0 trailing zero.
6 is a term since A049345(6) = 100 has 2 trailing zeros.
From _Gus Wiseman_, Apr 23 2021: (Start)
The sequence of terms together with their prime indices begins:
     1: {}           25: {3,3}          51: {2,7}
     3: {2}          27: {2,2,2}        53: {16}
     5: {3}          29: {10}           54: {1,2,2,2}
     6: {1,2}        31: {11}           55: {3,5}
     7: {4}          33: {2,5}          57: {2,8}
     9: {2,2}        35: {3,4}          59: {17}
    11: {5}          36: {1,1,2,2}      61: {18}
    12: {1,1,2}      37: {12}           63: {2,2,4}
    13: {6}          39: {2,6}          65: {3,6}
    15: {2,3}        41: {13}           66: {1,2,5}
    17: {7}          42: {1,2,4}        67: {19}
    18: {1,2,2}      43: {14}           69: {2,9}
    19: {8}          45: {2,2,3}        71: {20}
    21: {2,4}        47: {15}           72: {1,1,1,2,2}
    23: {9}          48: {1,1,1,1,2}    73: {21}
    24: {1,1,1,2}    49: {4,4}          75: {2,3,3}
(End)
		

Crossrefs

Complement of A342050.
A099788 is subsequence.
Analogous sequences: A000201 (Zeckendorf representation), A003159 (binary), A007417 (ternary), A232744 (factorial base).
The version for reversed binary expansion is A121539.
Positions of odd terms in A257993.
A000070 counts partitions with a selected part.
A056239 adds up prime indices, row sums of A112798.
A073491 lists numbers with gap-free prime indices.
A079067 counts gaps in prime indices.
A238709 counts partitions by sum and least difference.
A339662 gives greatest gap in prime indices.

Programs

  • Mathematica
    seq[max_] := Module[{bases = Prime@Range[max, 1, -1], nmax}, nmax = Times @@ bases - 1; Select[Range[nmax], EvenQ @ LengthWhile[Reverse @ IntegerDigits[#, MixedRadix[bases]], #1 == 0 &] &]]; seq[4]
    Select[Range[100],OddQ[Min@@Complement[Range[PrimeNu[#]+1],PrimePi/@First/@FactorInteger[#]]]&] (* Gus Wiseman, Apr 23 2021 *)

A276151 n minus the greatest primorial number (A002110) which divides n: a(n) = n - A053589(n).

Original entry on oeis.org

0, 0, 2, 2, 4, 0, 6, 6, 8, 8, 10, 6, 12, 12, 14, 14, 16, 12, 18, 18, 20, 20, 22, 18, 24, 24, 26, 26, 28, 0, 30, 30, 32, 32, 34, 30, 36, 36, 38, 38, 40, 36, 42, 42, 44, 44, 46, 42, 48, 48, 50, 50, 52, 48, 54, 54, 56, 56, 58, 30, 60, 60, 62, 62, 64, 60, 66, 66, 68, 68, 70, 66, 72, 72, 74, 74, 76, 72, 78, 78, 80, 80, 82, 78, 84, 84, 86, 86, 88, 60, 90, 90, 92
Offset: 1

Views

Author

Antti Karttunen, Aug 23 2016

Keywords

Comments

Subtract one (in primorial base representation A049345) from the least significant nonzero digit of n, then convert back to decimal.

Crossrefs

Cf. A002110 (positions of zeros), A032742, A049345, A053589, A111701, A276084, A276085, A276086.

Programs

  • Mathematica
    Table[If[n == 1, 0, n - Times @@ Prime@ Flatten@ Position[TakeWhile[#, # > 0 &], 1] &@ Function[f, ReplacePart[Table[0, {PrimePi[f[[-1, 1]]]}], #] &@ Map[PrimePi@ First@ # -> 1 &, f]]@ FactorInteger@ n], {n, 93}] (* or *)
    Table[n - If[OddQ@ n, 1, Function[p, Product[Prime@ k, {k, #[[p]]}]][LengthWhile[Differences@ #, # == 1 &] + 1] &@ PrimePi[FactorInteger[n][[All, 1]]]], {n, 93}] (* Michael De Vlieger, Aug 26 2016 *)
  • Python
    from sympy import nextprime, primepi, primorial
    def a002110(n): return 1 if n<1 else primorial(n)
    def a053669(n):
        p = 2
        while True:
            if n%p!=0: return p
            else: p=nextprime(p)
    def a276084(n): return primepi(a053669(n)) - 1
    def a(n): return n - a002110(a276084(n))
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 23 2017
  • Scheme
    (define (A276151 n) (- n (A053589 n)))
    

Formula

a(n) = n - A053589(n) = n - A002110(A276084(n)).
a(n) = A276085(A032742(A276086(n))). - Antti Karttunen, May 11 2017
Showing 1-10 of 21 results. Next