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-8 of 8 results.

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

A329902 Primorial deflation of the n-th highly composite number: the unique integer k such that A108951(k) = A002182(n).

Original entry on oeis.org

1, 2, 4, 3, 6, 12, 9, 24, 10, 20, 15, 40, 30, 60, 28, 21, 56, 42, 84, 63, 168, 126, 336, 140, 66, 189, 280, 132, 99, 264, 198, 528, 220, 396, 297, 440, 792, 156, 117, 312, 234, 624, 260, 468, 351, 520, 936, 390, 1040, 1872, 780, 585, 306, 1560, 340, 612, 459, 680, 1224, 510, 1360, 2448, 1020, 765, 342, 2040, 1530, 684, 513
Offset: 1

Views

Author

Antti Karttunen, Dec 22 2019

Keywords

Crossrefs

Programs

  • Mathematica
    Map[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 &]) &, Take[Import["https://oeis.org/b002182.txt", "Data"][[All, -1]], 69] ] (* Michael De Vlieger, Jan 13 2020, imports b-file at A002182 *)

Formula

a(n) = A329900(A002182(n)) = A319626(A002182(n)).
a(n) = A181815(A306802(n)).
A108951(a(n)) = A002182(n). [Highly composite numbers (undeflated)]
A056239(a(n)) = A112778(n). [Number of prime factors, counted with multiplicity]
A001222(a(n)) = A112779(n). [Largest exponent in the prime factorization]
A329605(a(n)) = A002183(n). [Number of divisors]
A329040(a(n)) = A324381(n).
A324888(a(n)) = A324382(n).
a(A330748(n)) = A330743(n).

Extensions

More linking formulas added by Antti Karttunen, Jan 13 2020

A324386 a(n) = A324383(A006068(n)).

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 2, 1, 4, 4, 4, 2, 2, 6, 6, 1, 2, 4, 8, 4, 4, 6, 12, 2, 8, 6, 10, 6, 22, 10, 8, 1, 4, 4, 6, 2, 8, 6, 8, 4, 6, 12, 14, 2, 16, 10, 16, 2, 8, 16, 4, 6, 14, 8, 24, 6, 30, 18, 20, 6, 26, 18, 26, 1, 6, 8, 8, 4, 12, 12, 6, 8, 12, 14, 18, 4, 20, 20, 20, 4, 16, 16, 8, 12, 28, 16, 10, 12, 22, 26, 14, 12, 34, 20, 22, 2, 12
Offset: 0

Views

Author

Antti Karttunen, Feb 27 2019

Keywords

Comments

This is most likely equal to A276150(A086141(n)), apart from the different offset used in A086141.
The same comments about the parity of terms as in A324383 and A324387 apply also here, except here 1's occur at positions given by 2^k - 1.

Crossrefs

Cf. also A324383, A324387 (permutations of this sequence) and A324380, A324390.

Programs

  • PARI
    A006068(n)= { my(s=1, ns); while(1, ns = n >> s; if(0==ns, break()); n = bitxor(n, ns); s <<= 1; ); return (n); } \\ From A006068
    A276150(n) = { my(s=0,m); forprime(p=2, , if(!n, return(s)); m = n%p; s += m; n = (n-m)/p); };
    A322827(n) = if(!n,1,my(bits = Vecrev(binary(n)), rl=1, o = List([])); for(i=2,#bits,if(bits[i]==bits[i-1], rl++, listput(o,rl))); listput(o,rl); my(es=Vecrev(Vec(o)), m=1); for(i=1,#es,m *= prime(i)^es[i]); (m));
    A324383(n) = A276150(A322827(n));
    A324386(n) = A324383(A006068(n));

Formula

a(A000225(n)) = 1 for all n.

A324387 Minimal number of primorials (A002110) that add to the n-th number that is a product of primorials: a(n) = A276150(A025487(n)).

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 4, 4, 1, 2, 2, 4, 2, 4, 4, 4, 4, 6, 8, 6, 8, 1, 2, 2, 6, 6, 6, 10, 2, 4, 4, 6, 8, 6, 10, 4, 8, 6, 8, 12, 6, 10, 6, 8, 12, 10, 8, 12, 12, 10, 16, 12, 20, 1, 2, 6, 8, 10, 6, 10, 8, 10, 16, 14, 20, 2, 4, 12, 10, 10, 14, 10, 16, 12, 20, 6, 6, 10, 8, 10, 12, 20, 4, 8, 14, 14, 20, 14, 10, 16, 14, 24, 6, 12, 12
Offset: 1

Views

Author

Antti Karttunen, Feb 27 2019

Keywords

Comments

A098719 gives the positions of ones in this sequence. See also comments in A324383.

Crossrefs

Cf. A002110, A025487, A098719 (positions of ones), A276150, A324342.
Cf. A324382 for a subsequence, and A324383, A324386 for permutations of this sequence.

Programs

Formula

a(n) = A276150(A025487(n)).

A324383 a(n) is the minimal number of primorials that add to A322827(n).

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 2, 2, 2, 6, 1, 6, 4, 2, 4, 4, 8, 6, 6, 10, 8, 1, 10, 22, 4, 6, 2, 12, 8, 4, 4, 2, 8, 16, 6, 4, 24, 6, 8, 14, 26, 18, 1, 26, 20, 6, 18, 30, 6, 12, 2, 14, 16, 2, 10, 16, 8, 6, 4, 8, 6, 2, 4, 4, 12, 14, 14, 18, 18, 12, 16, 32, 42, 28, 6, 22, 32, 24, 24, 42, 46, 32, 18, 20, 30, 1, 24, 54, 38, 26, 14, 44, 34, 8
Offset: 0

Views

Author

Antti Karttunen, Feb 27 2019

Keywords

Comments

a(n) is odd if and only if n is one of the terms of A000975: 1, 2, 5, 10, 21, 42, 85, ..., in which case A322827(n) will be one of primorials (A002110), and a(n) = 1. This happens because A276150 is even for all multiples of four, and a product of two or more primorials > 1 is always a multiple of 4. Note that the same property does not hold in factorial system: 36 = 3!*3!, but A034968(36) = 3 as 36 = 4!+3!+3!.

Crossrefs

Cf. A000975 (positions of ones), A002110, A003188, A025487, A276150, A322827, A324342, A324382.
Cf. also A324386, A324387 (permutations of this sequence).

Programs

  • PARI
    A276150(n) = { my(s=0,m); forprime(p=2, , if(!n, return(s)); m = n%p; s += m; n = (n-m)/p); };
    A322827(n) = if(!n,1,my(bits = Vecrev(binary(n)), rl=1, o = List([])); for(i=2,#bits,if(bits[i]==bits[i-1], rl++, listput(o,rl))); listput(o,rl); my(es=Vecrev(Vec(o)), m=1); for(i=1,#es,m *= prime(i)^es[i]); (m));
    A324383(n) = A276150(A322827(n));

Formula

a(n) = A276150(A322827(n)).
a(n) = A324386(A003188(n)).

A324582 a(n) = A002182(n) * A324581(n) = A002182(n) * A276086(A002182(n)).

Original entry on oeis.org

2, 6, 36, 30, 300, 15000, 1260, 42000, 2940, 288120, 21176820, 18480, 66555720, 328703760, 12298440, 2232166860, 360122920080, 360360, 103062960, 22107004920, 4215068938080, 129290917072196880, 3525159950945805332160, 90107494796113466546674800, 645822919595173320, 72532204477502449680, 1648012277067163992784800
Offset: 1

Views

Author

Antti Karttunen, Mar 09 2019

Keywords

Comments

Note that gcd(A002182(n), A324581(n)) = A324198(A002182(n)) = 1 for all n because each term of A002182 is a product of primorial numbers (A002110).
See also comments in A324382.

Crossrefs

Programs

  • Mathematica
    Block[{b = MixedRadix[Reverse@ Prime@ Range@ 20], s = DivisorSigma[0, Range[10^5]], t}, t = Map[FirstPosition[s, #][[1]] &, Union@ FoldList[Max, s]]; Array[#1 (Times @@ Power @@@ Transpose@ {Prime@ Range@ Length@ #2, Reverse@ #2}) & @@ {#, IntegerDigits[#, b]} &@ t[[#]] &, Length@ t]] (* Michael De Vlieger, Mar 18 2019 *)
  • PARI
    \\ A002182 assumed to be precomputed
    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; };
    A324582(n) = A002182(n)*A276086(A002182(n));

Formula

a(n) = A002182(n) * A324581(n) = A002182(n) * A276086(A002182(n)).
a(n) = A324580(A002182(n)).

A324381 Number of nonzero digits when the n-th highly composite number is written in primorial base: a(n) = A267263(A002182(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 26 2019

Keywords

Examples

			For n=12, A002182(12) = 240, which is written as "11000" in primorial base (A049345) because 240 = 1*A002110(4) + 1*A002110(3) = 210+30, thus a(12) = 2, as there are two nonzero digits.
For n=18, A002182(18) = 2520 = "110000" in primorial base because 2520 = 1*A002110(5) + 1*A002110(4) = 2310+210, thus a(18) = 2.
For n=26, A002182(26) = 45360 = "1670000" in primorial base because 45360 = 1*A002110(6) + 6*A002110(5) + 7*A002110(4), thus a(26) = 3, as there are three nonzero digits.
		

Crossrefs

Programs

Formula

a(n) = A267263(A002182(n)).
a(n) <= A324382(n).

A324581 a(n) = A276086(A002182(n)).

Original entry on oeis.org

2, 3, 9, 5, 25, 625, 35, 875, 49, 2401, 117649, 77, 184877, 456533, 14641, 1771561, 214358881, 143, 20449, 2924207, 418161601, 8550986578849, 174859124550883201, 3575694237941010577249, 23298085122481, 1599034490244763, 32698656291015158587, 30466726698629, 39841104144361, 52099905419549, 89093921102069, 152355876914189, 260537564663909
Offset: 1

Views

Author

Antti Karttunen, Mar 09 2019

Keywords

Comments

Note that gcd(a(n), A002182(n)) = A324198(A002182(n)) = 1 for all n because each term of A002182 is a product of primorial numbers (A002110).

Crossrefs

Programs

  • Mathematica
    Block[{b = MixedRadix[Reverse@ Prime@ Range@ 20], s = DivisorSigma[0, Range[10^5]], t}, t = Map[FirstPosition[s, #][[1]] &, Union@ FoldList[Max, s]]; Array[Times @@ Power @@@ # &@ Transpose@ {Prime@ Range@ Length@ #, Reverse@ #} &@ IntegerDigits[(*a002182[[#]]*)t[[#]], b] &, Length@ t]] (* Michael De Vlieger, Mar 18 2019 *)
  • PARI
    \\ A002182 assumed to be precomputed
    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; };
    A324581(n) = A276086(A002182(n));

Formula

a(n) = A276086(A002182(n)).
a(n) = A324582(n)/A002182(n).
A001221(a(n)) = A324381(n).
A001222(a(n)) = A324382(n).
Showing 1-8 of 8 results.