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 11 results. Next

A324343 Lexicographically earliest positive sequence such that a(i) = a(j) => A278222(i) = A278222(j) and A324342(i) = A324342(j), for all i, j >= 0.

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 5, 6, 2, 4, 7, 8, 9, 10, 11, 12, 2, 4, 7, 13, 7, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 2, 4, 7, 13, 25, 14, 18, 22, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 2, 4, 7, 13, 50, 51, 52, 53, 50, 54, 55, 56, 38, 39, 57, 58, 59, 60, 55, 56, 61, 62, 63, 64, 19, 65, 66, 67, 16, 68, 69, 70, 71, 72, 73, 74, 75, 63, 76
Offset: 0

Views

Author

Antti Karttunen, Feb 24 2019

Keywords

Comments

Restricted growth sequence transform of the ordered pair [A278222(n), A324342(n)], or equally, of [A286622(n), A324342(n)].
For all i, j: a(i) = a(j) => A324344(i) = A324344(j).

Crossrefs

Programs

  • PARI
    up_to = 65537;
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    A002110(n) = prod(i=1,n,prime(i));
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t };
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ From A046523
    A278222(n) = A046523(A005940(1+n));
    A030308(n,k) = bittest(n,k);
    A283477(n) = prod(i=0,#binary(n),if(0==A030308(n,i),1,A030308(n,i)*A002110(1+i)));
    A276150(n) = { my(s=0,m); forprime(p=2, , if(!n, return(s)); m = n%p; s += m; n = (n-m)/p); };
    A324342(n) = A276150(A283477(n));
    A324343aux(n) = [A278222(n), A324342(n)];
    v324343 = rgs_transform(vector(1+up_to,n,A324343aux(n-1)));
    A324343(n) = v324343[1+n];

A324344 Lexicographically earliest positive sequence such that a(i) = a(j) => A000120(i) = A000120(j) and A324342(i) = A324342(j), for all i, j >= 0.

Original entry on oeis.org

1, 2, 2, 3, 2, 3, 4, 5, 2, 3, 4, 6, 7, 8, 9, 10, 2, 3, 4, 11, 4, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 2, 3, 4, 11, 22, 11, 15, 19, 14, 23, 24, 25, 26, 13, 10, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 2, 3, 4, 11, 44, 5, 23, 45, 44, 12, 16, 46, 32, 33, 33, 47, 48, 18, 16, 46, 26, 37, 49, 50, 16, 51, 52, 53, 13, 54, 55, 56, 57, 36, 58, 38, 59, 49, 60
Offset: 0

Views

Author

Antti Karttunen, Feb 24 2019

Keywords

Comments

Restricted growth sequence transform of the ordered pair [A000120(n), A324342(n)].

Crossrefs

Cf. also A318310.

Programs

  • PARI
    up_to = 65537;
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    A002110(n) = prod(i=1,n,prime(i));
    A030308(n,k) = bittest(n,k);
    A283477(n) = prod(i=0,#binary(n),if(0==A030308(n,i),1,A030308(n,i)*A002110(1+i)));
    A276150(n) = { my(s=0,m); forprime(p=2, , if(!n, return(s)); m = n%p; s += m; n = (n-m)/p); };
    A324342(n) = A276150(A283477(n));
    A324344aux(n) = [hammingweight(n), A324342(n)];
    v324344 = rgs_transform(vector(1+up_to,n,A324344aux(n-1)));
    A324344(n) = v324344[1+n];

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

A283477 If 2n = 2^e1 + 2^e2 + ... + 2^ek [e1 .. ek distinct], then a(n) = A002110(e1) * A002110(e2) * ... * A002110(ek).

Original entry on oeis.org

1, 2, 6, 12, 30, 60, 180, 360, 210, 420, 1260, 2520, 6300, 12600, 37800, 75600, 2310, 4620, 13860, 27720, 69300, 138600, 415800, 831600, 485100, 970200, 2910600, 5821200, 14553000, 29106000, 87318000, 174636000, 30030, 60060, 180180, 360360, 900900, 1801800, 5405400, 10810800, 6306300, 12612600, 37837800, 75675600
Offset: 0

Views

Author

Antti Karttunen, Mar 16 2017

Keywords

Comments

a(n) = Product of distinct primorials larger than one, obtained as Product_{i} A002110(1+i), where i ranges over the zero-based positions of the 1-bits present in the binary representation of n.
This sequence can be represented as a binary tree. Each child to the left is obtained as A283980(k), and each child to the right is obtained as 2*A283980(k), when their parent contains k:
1
|
...................2....................
6 12
30......../ \........60 180......../ \......360
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
210 420 1260 2520 6300 12600 37800 75600
etc.

Crossrefs

Programs

  • Mathematica
    Table[Times @@ Map[#1^#2 & @@ # &, FactorInteger[#] /. {p_, e_} /; e == 1 :> {Times @@ Prime@ Range@ PrimePi@ p, e}] &[Times @@ Prime@ Flatten@ Position[#, 1] &@ Reverse@ IntegerDigits[n, 2]], {n, 0, 43}] (* Michael De Vlieger, Mar 18 2017 *)
  • PARI
    A283477(n) = prod(i=0,exponent(n),if(bittest(n,i),vecprod(primes(1+i)),1)) \\ Edited by M. F. Hasler, Nov 11 2019
    
  • Python
    from sympy import prime, primerange, factorint
    from operator import mul
    from functools import reduce
    def P(n): return reduce(mul, [i for i in primerange(2, n + 1)])
    def a108951(n):
        f = factorint(n)
        return 1 if n==1 else reduce(mul, [P(i)**f[i] 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')) if n > 0 else 1 # after Chai Wah Wu
    def a(n): return a108951(a019565(n))
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 22 2017
    
  • Python
    from sympy import primorial
    from math import prod
    def A283477(n): return prod(primorial(i) for i, b in enumerate(bin(n)[:1:-1],1) if b =='1') # Chai Wah Wu, Dec 08 2022
  • Scheme
    (define (A283477 n) (A108951 (A019565 n)))
    ;; Recursive "binary tree" implementation, using memoization-macro definec:
    (definec (A283477 n) (cond ((zero? n) 1) ((even? n) (A283980 (A283477 (/ n 2)))) (else (* 2 (A283980 (A283477 (/ (- n 1) 2)))))))
    

Formula

a(0) = 1; a(2n) = A283980(a(n)), a(2n+1) = 2*A283980(a(n)).
Other identities. For all n >= 0 (or for n >= 1):
a(2n+1) = 2*a(2n).
a(n) = A108951(A019565(n)).
A097248(a(n)) = A283475(n).
A007814(a(n)) = A051903(a(n)) = A000120(n).
A001221(a(n)) = A070939(n).
A001222(a(n)) = A029931(n).
A048675(a(n)) = A005187(n).
A248663(a(n)) = A006068(n).
A090880(a(n)) = A283483(n).
A276075(a(n)) = A283984(n).
A276085(a(n)) = A283985(n).
A046660(a(n)) = A124757(n).
A056169(a(n)) = A065120(n). [seems to be]
A005361(a(n)) = A284001(n).
A072411(a(n)) = A284002(n).
A007913(a(n)) = A284003(n).
A000005(a(n)) = A284005(n).
A324286(a(n)) = A324287(n).
A276086(a(n)) = A324289(n).
A267263(a(n)) = A324341(n).
A276150(a(n)) = A324342(n). [subsequences in the latter are converging towards this sequence]
G.f.: Product_{k>=0} (1 + prime(k + 1)# * x^(2^k)), where prime()# = A002110. - Ilya Gutkovskiy, Aug 19 2019

Extensions

More formulas and the binary tree illustration added by Antti Karttunen, Mar 19 2017
Four more linking formulas added by Antti Karttunen, Feb 25 2019

A324382 Minimal number of primorials that add to the n-th highly composite number: a(n) = A276150(A002182(n)).

Original entry on oeis.org

1, 1, 2, 1, 2, 4, 2, 4, 2, 4, 6, 2, 6, 6, 4, 6, 8, 2, 4, 6, 8, 12, 16, 20, 12, 14, 18, 12, 12, 12, 12, 12, 12, 12, 24, 8, 8, 8, 4, 16, 8, 16, 8, 16, 24, 16, 32, 6, 14, 30, 12, 18, 18, 24, 12, 18, 18, 24, 18, 36, 8, 14, 32, 28, 6, 24, 38, 12, 18, 36, 20, 24, 30, 40, 26, 10, 40, 20, 30, 18, 38, 26, 36, 36, 24, 24, 44, 50, 48, 14, 42
Offset: 1

Views

Author

Antti Karttunen, Feb 26 2019

Keywords

Comments

Among the first 10000 highly composite numbers, only in two cases a(n) < A112779(n). This happens on A002182(12) = 240 and A002182(18) = 2520. Note that A112779(n) gives the number of primorials needed when A002182(n) is expressed as a product [not as a sum] of primorials.

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) = 1+1 = 2. (Note that 240 = 30*2*2*2).
For n=18, A002182(18) = 2520 = "110000" in primorial base because 2520 = 1*A002110(5) + 1*A002110(4) = 2310+210, thus a(18) = 1+1 = 2. (Note that 2520 = 210*6*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) = 1+6+7 = 14. (Note that 45360 = 210*6*6*6).
		

Crossrefs

Programs

Formula

a(n) = A276150(A002182(n)).
a(n) >= A324381(n).

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

A342462 Sum of digits when A329886(n) is written in primorial base, where A329886 is the primorial inflation of Doudna-tree.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 15 2021

Keywords

Comments

From David A. Corneth's Feb 27 2019 comment in A276150 follows that the only odd terms in this sequence are 1's occurring at 0 and at two's powers.
Subsequences starting at each n = 2^k are slowly converging towards A329886: 1, 2, 6, 4, 30, 12, 36, 8, 210, 60, 180, 24, etc.. Compare also to the behaviors of A324342 and A342463.

Crossrefs

Programs

Formula

a(n) = A001222(A342456(n)) = A001222(A342457(n)).
a(n) = A276150(A329886(n)) = A324888(A005940(1+n)).
a(n) >= A342461(n).
For n >= 0, a(2^n) = 1.

A324289 a(n) = A276086(A283477(n)).

Original entry on oeis.org

2, 3, 5, 25, 7, 49, 117649, 184877, 11, 121, 1771561, 143, 36226650889, 59797108943, 546826709, 299019449675770681, 13, 169, 4826809, 23298085122481, 8254129, 68130645548641, 17750592470222918406076697669, 406193515012381653451063, 8223741426987700773289, 1553319630709265128413587, 1977089672816762887718980502697827
Offset: 0

Views

Author

Antti Karttunen, Feb 23 2019

Keywords

Comments

All primes are present, and furthermore, each subsequence starting at each n = 2^k is converging towards p^A283477(0), p^A283477(1), p^A283477(2), p^A283477(3), ..., where p = A000040(2+k). For example, for a(2^4) = a(16), the prime is A000040(2+4) = 13, and its powers 13^1, 13^2, 13^6 and 13^12 occur in successive positions from a(16) to a(19). See also comments in A324342.

Crossrefs

Programs

Formula

a(n) = A276086(A283477(n)).
For n >= 0, a(2^n) = A000040(2+n).
A001221(a(n)) = A324341(n).
A001222(a(n)) = A324342(n).

A324341 If 2n = 2^e1 + ... + 2^ek [e1 .. ek distinct], then a(n) is the number of nonzero digits when A002110(e1) * ... * A002110(ek) is written in primorial base.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 3, 3, 1, 1, 1, 1, 2, 2, 2, 3, 2, 3, 3, 3, 4, 2, 2, 3, 1, 1, 1, 1, 2, 2, 2, 3, 2, 3, 3, 3, 3, 3, 3, 4, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 4, 6, 6, 6, 6, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5
Offset: 0

Views

Author

Antti Karttunen, Feb 23 2019

Keywords

Comments

Number of nonzero digits when A283477(n) is represented in primorial base, A049345.
Number of distinct prime factors in A324289(n).

Crossrefs

Programs

Formula

a(n) = A267263(A283477(n)).
a(n) <= A324342(n).
Showing 1-10 of 11 results. Next