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-5 of 5 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

A319715 Sum of A276150(d) over divisors d of n, where A276150 gives the sum of digits in primorial base.

Original entry on oeis.org

1, 2, 3, 4, 4, 5, 3, 6, 6, 8, 5, 9, 4, 7, 10, 10, 6, 11, 5, 14, 10, 11, 7, 15, 9, 10, 12, 15, 8, 16, 3, 12, 10, 10, 10, 17, 4, 9, 10, 20, 6, 18, 5, 17, 18, 13, 7, 23, 8, 18, 14, 18, 8, 22, 14, 23, 14, 16, 9, 26, 4, 7, 17, 16, 12, 20, 5, 16, 14, 22, 7, 27, 6, 10, 21, 17, 14, 22, 7, 30, 19, 14, 9, 34, 16, 13, 18, 27, 10, 30, 10, 19, 10
Offset: 1

Views

Author

Antti Karttunen, Oct 02 2018

Keywords

Comments

Inverse Möbius transform of A276150.

Crossrefs

Programs

  • Mathematica
    d[n_] := Module[{k = n, p = 2, s = 0, r}, While[{k, r} = QuotientRemainder[k, p]; k != 0 || r != 0, s += r; p = NextPrime[p]]; s]; a[n_] := DivisorSum[n, d[#] &]; Array[a, 100] (* Amiram Eldar, Mar 05 2024 *)
  • 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); };
    A319715(n) = sumdiv(n,d,A276150(d));

Formula

a(n) = Sum_{d|n} A276150(d).
a(n) = A319713(n) + A276150(n).

A319708 a(n) = Product_{d|n, dA276086(d).

Original entry on oeis.org

1, 2, 2, 6, 2, 36, 2, 54, 12, 108, 2, 1620, 2, 60, 216, 810, 2, 5400, 2, 43740, 120, 540, 2, 607500, 36, 300, 360, 40500, 2, 21870000, 2, 182250, 1080, 2700, 360, 151875000, 2, 1500, 600, 246037500, 2, 101250000, 2, 5467500, 972000, 13500, 2, 85429687500, 20, 6075000, 5400, 5062500, 2, 2531250000, 3240, 3417187500, 3000, 67500, 2
Offset: 1

Views

Author

Antti Karttunen, Oct 03 2018

Keywords

Crossrefs

Cf. A276085, A276086, A319709 (rgs-transform).
Cf. A293214, A293221, A293222, A300834 for similar constructions for other bases.

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; };
    A319708(n) = { my(m=1); fordiv(n, d, if(dA276086(d))); (m); };

Formula

a(n) = Product_{d|n, dA276086(d).
For all n >= 1:
A276085(a(n)) = A001065(n).
A001222(a(n)) = A319713(n).

A319711 Sum of A034968(d) over proper divisors d of n, where A034968 gives the sum of digits in factorial base.

Original entry on oeis.org

0, 1, 1, 2, 1, 4, 1, 4, 3, 5, 1, 7, 1, 4, 6, 6, 1, 8, 1, 10, 5, 6, 1, 11, 4, 5, 6, 9, 1, 15, 1, 10, 7, 7, 6, 15, 1, 6, 6, 16, 1, 15, 1, 13, 13, 8, 1, 16, 3, 10, 8, 9, 1, 14, 8, 14, 7, 6, 1, 25, 1, 5, 13, 13, 7, 18, 1, 13, 9, 18, 1, 21, 1, 6, 12, 12, 7, 15, 1, 25, 9, 8, 1, 26, 9, 7, 7, 20, 1, 29, 6, 16, 6, 9, 8, 21, 1, 10, 14, 19, 1, 18, 1, 15, 22
Offset: 1

Views

Author

Antti Karttunen, Oct 02 2018

Keywords

Crossrefs

Programs

  • Mathematica
    d[n_] := Module[{k = n, m = 2, s = 0, r}, While[{k, r} = QuotientRemainder[k, m]; k != 0 || r != 0, s += r; m++]; s]; a[n_] := DivisorSum[n, d[#] &, # < n &]; Array[a, 100] (* Amiram Eldar, Mar 05 2024 *)
  • PARI
    A034968(n) = { my(s=0, b=2, d); while(n, d = (n%b); s += d; n = (n-d)/b; b++); (s); };
    A319711(n) = sumdiv(n,d,(dA034968(d));

Formula

a(n) = Sum_{d|n, dA034968(d).
a(n) = A319712(n) - A034968(n).

A319709 Filter sequence combining primorial base representations of the proper divisors of n; Restricted growth sequence transform of A319708.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Oct 03 2018

Keywords

Comments

For all i, j:
a(i) = a(j) => A001065(i) = A001065(j),
a(i) = a(j) => A319713(i) = A319713(j).

Crossrefs

Cf. A293215, A293226, A300835 for similar constructions for other bases.

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; };
    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; };
    A319708(n) = { my(m=1); fordiv(n, d, if(dA276086(d))); (m); };
    v319709 = rgs_transform(vector(up_to,n,A319708(n)));
    A319709(n) = v319709[n];
Showing 1-5 of 5 results.