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.

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

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.

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.

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

A324576 a(n) = A276086(A025487(n)).

Original entry on oeis.org

2, 3, 9, 5, 15, 25, 225, 625, 7, 21, 35, 875, 49, 441, 1225, 1715, 2401, 36015, 1500625, 117649, 2941225, 11, 55, 77, 17325, 67375, 184877, 115548125, 121, 3025, 5929, 124509, 10168235, 456533, 399466375, 14641, 9150625, 717409, 35153041, 15502491081, 1127357, 1381012325, 1771561, 62004635, 208422380089, 4774356895, 214358881
Offset: 1

Views

Author

Antti Karttunen, Mar 09 2019

Keywords

Crossrefs

Cf. A324581 (a subsequence).

Programs

  • 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; };
    A324576(n) = A276086(A025487(n));

Formula

a(n) = A276086(A025487(n)).
A001222(a(n)) = A324387(n).
Showing 1-6 of 6 results.