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

A324390 Lexicographically earliest positive sequence such that a(i) = a(j) => A278219(i) = A278219(j) and A324386(i) = A324386(j), for all i, j >= 0.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 27 2019

Keywords

Comments

Restricted growth sequence transform of the ordered pair [A278219(n), A324386(n)].

Crossrefs

Cf. also A286619, A324343, A324344, A324380 (compare the scatter-plots).

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; };
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t }; \\ From A005940
    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));
    A003188(n) = bitxor(n, n>>1);
    A278219(n) = A278222(A003188(n));
    Aux324390(n) = [A278219(n), A324386(n)]; \\ See code for A324386 in that entry.
    v324390 = rgs_transform(vector(1+up_to,n,Aux324390(n-1)));
    A324390(n) = v324390[1+n];

Formula

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

A324380 Lexicographically earliest positive sequence such that a(i) = a(j) => A069010(i) = A069010(j) and A324386(i) = A324386(j), for all i, j >= 0.

Original entry on oeis.org

1, 2, 3, 2, 3, 4, 3, 2, 5, 6, 6, 4, 3, 7, 8, 2, 3, 6, 9, 6, 6, 10, 11, 4, 12, 7, 13, 7, 14, 13, 12, 2, 5, 6, 7, 4, 9, 10, 9, 6, 7, 15, 16, 17, 18, 19, 18, 4, 12, 18, 6, 7, 20, 21, 22, 7, 23, 24, 25, 7, 26, 24, 26, 2, 8, 9, 9, 6, 11, 15, 7, 9, 11, 16, 27, 28, 25, 29, 25, 6, 18, 30, 21, 15, 31, 32, 19, 15, 33, 34, 16, 15, 35, 29, 33, 4, 36, 20, 24, 20, 37, 30, 24, 11
Offset: 0

Views

Author

Antti Karttunen, Feb 27 2019

Keywords

Comments

Restricted growth sequence transform of the ordered pair [A069010(n), A324386(n)].

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; };
    A069010(n) = ((1 + (hammingweight(bitxor(n, n>>1)))) >> 1); \\ From A069010
    Aux324380(n) = [A069010(n), A324386(n)]; \\ Code for A324386 available in that entry.
    v324380 = rgs_transform(vector(1+up_to,n,Aux324380(n-1)));
    A324380(n) = v324380[1+n];

Formula

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

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

A324888 Minimal number of primorials (A002110) that add to A108951(n).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 30 2019

Keywords

Comments

Sum of digits when A108951(n) is written in primorial base (A049345).

Crossrefs

Cf. A324383, A324386, A324387 (permutations of this sequence).

Programs

  • Mathematica
    With[{b = Reverse@ Prime@ Range@ 120}, Array[Total@ IntegerDigits[#, MixedRadix[b]] &@ Apply[Times, Map[#1^#2 & @@ # &, FactorInteger[#] /. {p_, e_} /; e > 0 :> {Times @@ Prime@ Range@ PrimePi@ p, e}]] &, 105] ] (* Michael De Vlieger, Nov 18 2019 *)
  • PARI
    A034386(n) = prod(i=1, primepi(n), prime(i));
    A108951(n) = { my(f=factor(n)); prod(i=1, #f~, A034386(f[i, 1])^f[i, 2]) };  \\ From A108951
    A276150(n) = { my(s=0,m); forprime(p=2, , if(!n, return(s)); m = n%p; s += m; n = (n-m)/p); };
    A324888(n) = A276150(A108951(n));

Formula

a(n) = A276150(A108951(n)).
a(n) = A001222(A324886(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)).
Showing 1-6 of 6 results.