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.

A003958 If n = Product p(k)^e(k) then a(n) = Product (p(k)-1)^e(k).

Original entry on oeis.org

1, 1, 2, 1, 4, 2, 6, 1, 4, 4, 10, 2, 12, 6, 8, 1, 16, 4, 18, 4, 12, 10, 22, 2, 16, 12, 8, 6, 28, 8, 30, 1, 20, 16, 24, 4, 36, 18, 24, 4, 40, 12, 42, 10, 16, 22, 46, 2, 36, 16, 32, 12, 52, 8, 40, 6, 36, 28, 58, 8, 60, 30, 24, 1, 48, 20, 66, 16, 44, 24, 70, 4, 72, 36, 32, 18, 60, 24, 78, 4, 16
Offset: 1

Views

Author

Keywords

Comments

Completely multiplicative.
Dirichlet inverse of A097945. - R. J. Mathar, Aug 29 2011

Crossrefs

Programs

  • Haskell
    a003958 1 = 1
    a003958 n = product $ map (subtract 1) $ a027746_row n
    -- Reinhard Zumkeller, Apr 09 2012, Mar 02 2012
    
  • Maple
    a:= n-> mul((i[1]-1)^i[2], i=ifactors(n)[2]):
    seq(a(n), n=1..80);  # Alois P. Heinz, Sep 13 2017
  • Mathematica
    DirichletInverse[f_][1] = 1/f[1]; DirichletInverse[f_][n_] := DirichletInverse[f][n] = -1/f[1]*Sum[ f[n/d]*DirichletInverse[f][d], {d, Most[ Divisors[n]]}]; muphi[n_] := MoebiusMu[n]*EulerPhi[n]; Table[ DirichletInverse[ muphi][n], {n, 1, 81}] (* Jean-François Alcover, Dec 12 2011, after R. J. Mathar *)
    a[1] = 1; a[n_] := (fi = FactorInteger[n]; Times @@ ((fi[[All, 1]] - 1)^fi[[All, 2]])); Table[a[n], {n, 1, 50}] (* G. C. Greubel, Jun 10 2016 *)
  • PARI
    a(n)=if(n<1,0,direuler(p=2,n,1/(1-p*X+X))[n]) /* Ralf Stephan */
    
  • Python
    from math import prod
    from sympy import factorint
    def a(n): return prod((p-1)**e for p, e in factorint(n).items())
    print([a(n) for n in range(1, 82)]) # Michael S. Branicky, Feb 27 2022

Formula

Multiplicative with a(p^e) = (p-1)^e. - David W. Wilson, Aug 01 2001
a(n) = A000010(n) iff n is squarefree (see A005117). - Reinhard Zumkeller, Nov 05 2004
a(n) = abs(A125131(n)). - Tom Edgar, May 26 2014
Sum_{k=1..n} a(k) ~ c * n^2, where c = Pi^4 / (315 * zeta(3)) = 1/(2*A082695) = 0.25725505075419... - Vaclav Kotesovec, Jun 14 2020
Dirichlet g.f.: Product_{p prime} 1 / (1 - p^(1-s) + p^(-s)). - Ilya Gutkovskiy, Feb 27 2022
Dirichlet g.f.: zeta(s-1) * zeta(s) * Product_{primes p} (1 + (p^(1-s) - 2) / (1 - p + p^s)), (with a product that converges for s=2). - Vaclav Kotesovec, Feb 11 2023

Extensions

Definition reedited (from formula) by Daniel Forgues, Nov 17 2009

A003959 If n = Product p(k)^e(k) then a(n) = Product (p(k)+1)^e(k), a(1) = 1.

Original entry on oeis.org

1, 3, 4, 9, 6, 12, 8, 27, 16, 18, 12, 36, 14, 24, 24, 81, 18, 48, 20, 54, 32, 36, 24, 108, 36, 42, 64, 72, 30, 72, 32, 243, 48, 54, 48, 144, 38, 60, 56, 162, 42, 96, 44, 108, 96, 72, 48, 324, 64, 108, 72, 126, 54, 192, 72, 216, 80, 90, 60, 216, 62, 96, 128, 729, 84, 144, 68
Offset: 1

Views

Author

Keywords

Comments

Completely multiplicative.
Sum of divisors of n with multiplicity. If n = p^m, the number of ways to make p^k as a divisor of n is C(m,k); and sum(C(m,k)*p^k) = (p+1)^k. The rest follows because the function is multiplicative. - Franklin T. Adams-Watters, Jan 25 2010

Crossrefs

Programs

  • Haskell
    a003959 1 = 1
    a003959 n = product $ map (+ 1) $ a027746_row n
    -- Reinhard Zumkeller, Apr 09 2012
  • Maple
    a:= n-> mul((i[1]+1)^i[2], i=ifactors(n)[2]):
    seq(a(n), n=1..80);  # Alois P. Heinz, Sep 13 2017
  • Mathematica
    a[1] = 1; a[n_] := (fi = FactorInteger[n]; Times @@ ((fi[[All, 1]]+1)^fi[[All, 2]])); a /@ Range[67] (* Jean-François Alcover, Apr 22 2011 *)
  • PARI
    a(n)=if(n<1,0,direuler(p=2,n,1/(1-X-p*X))[n]) /* Ralf Stephan */
    

Formula

Multiplicative with a(p^e) = (p+1)^e. - David W. Wilson, Aug 01 2001
Sum_{n>0} a(n)/n^s = Product_{p prime} 1/(1-p^(-s)-p^(1-s)) (conjectured). - Ralf Stephan, Jul 07 2013
This follows from the absolute convergence of the sum (compare with a(n) = n^2) and the Euler product for completely multiplicative functions. Convergence occurs for at least Re(s)>3. - Thomas Anton, Jul 15 2021
Sum_{k=1..n} a(k) ~ c * n^2, where c = A065488/2 = 1/(2*A005596) = 1.3370563627850107544802059152227440187511993141988459926... - Vaclav Kotesovec, Jul 17 2021
From Thomas Scheuerle, Jul 19 2021: (Start)
a(n) = gcd(A166642(n), A166643(n)).
a(n) = A166642(n)/A061142(n).
a(n) = A166643(n)/A165824(n).
a(n) = A166644(n)/A165825(n).
a(n) = A166645(n)/A165826(n).
a(n) = A166646(n)/A165827(n).
a(n) = A166647(n)/A165828(n).
a(n) = A166649(n)/A165830(n).
a(n) = A166650(n)/A165831(n).
a(n) = A167351(n)/A166590(n). (End)
Dirichlet g.f.: zeta(s-1) * Product_{primes p} (1 + 1/(p^s - p - 1)). - Vaclav Kotesovec, Aug 22 2021

Extensions

Definition reedited (with formula) by Daniel Forgues, Nov 17 2009

A322582 a(n) = n - A003958(n), where A003958 is fully multiplicative with a(p) = (p-1).

Original entry on oeis.org

0, 1, 1, 3, 1, 4, 1, 7, 5, 6, 1, 10, 1, 8, 7, 15, 1, 14, 1, 16, 9, 12, 1, 22, 9, 14, 19, 22, 1, 22, 1, 31, 13, 18, 11, 32, 1, 20, 15, 36, 1, 30, 1, 34, 29, 24, 1, 46, 13, 34, 19, 40, 1, 46, 15, 50, 21, 30, 1, 52, 1, 32, 39, 63, 17, 46, 1, 52, 25, 46, 1, 68, 1, 38, 43, 58, 17, 54, 1, 76, 65, 42, 1, 72, 21, 44, 31, 78, 1
Offset: 1

Views

Author

Antti Karttunen, Dec 17 2018

Keywords

Comments

a(p*(n/p)) - (n/p) = (p-1)*a(n/p) holds for all prime divisors p of n, which can be seen by expanding the left hand side as p*(n/p) - A003958(p*(n/p)) - (n/p) = (p-1)*(n/p) - (p-1)*A003958(n/p) = (p-1)*((n/p) - A003958(n/p)) = (p-1)*a(n/p). This shows that this sequence gives a lower limit for arithmetic derivative (A003415) in the same way as A348507 gives an upper limit for it. - Antti Karttunen, Nov 07 2021
With n = Product_{i=1..k} p_i the prime factorization of n, if one constructs for each i a test with a probability of success equal to 1/p_i, and if the tests are independent, then a(n)/n is the probability that at least one of the k tests succeeds. - Luc Rousseau, Jan 14 2023

Crossrefs

Cf. A003415, A003958, A322581, A348507, A348928 [= gcd(n,a(n))], A348975 (difference from the arithmetic derivative).
Cf. A349139, A348980, A348981, A348982, A348983 (Dirichlet convolutions with other sequences).
Cf. A168065 (gives the arithmetic mean of this and A348507), A168066.

Programs

  • Mathematica
    a[1] = 0; a[n_] := n - Times @@ ((First[#] - 1)^Last[#] & /@ FactorInteger[n]); Array[a, 60] (* Amiram Eldar, Dec 17 2018 *)
  • PARI
    A003958(n) = { my(f = factor(n)); for(i=1, #f~, f[i, 1]--); factorback(f); };
    A322582(n) = (n-A003958(n));
    
  • PARI
    A020639(n) = if(1==n, n, (factor(n)[1, 1]));
    A322582(n) = { my(s=0, m=1, spf); while(n>1, spf = A020639(n); n /= spf; s += m*n; m *= (spf-1)); (s); }; \\ (Compare to the similar programs given in A003415 and A348507) - Antti Karttunen, Nov 07 2021

Formula

a(n) = n - A003958(n).
From Antti Karttunen, Nov 07 2021: (Start)
a(n) = A003415(n) - A348975(n).
For all n >= 1, a(n) <= A003415(n) <= A348507(n).
For n > 1, a(n) = a(A032742(n))*(A020639(n)-1) + A032742(n). [See the comment above and compare with Reinhard Zumkeller's May 09 2011 formula for A003415]
(End)

A348507 a(n) = A003959(n) - n, where A003959 is multiplicative with a(p^e) = (p+1)^e.

Original entry on oeis.org

0, 1, 1, 5, 1, 6, 1, 19, 7, 8, 1, 24, 1, 10, 9, 65, 1, 30, 1, 34, 11, 14, 1, 84, 11, 16, 37, 44, 1, 42, 1, 211, 15, 20, 13, 108, 1, 22, 17, 122, 1, 54, 1, 64, 51, 26, 1, 276, 15, 58, 21, 74, 1, 138, 17, 160, 23, 32, 1, 156, 1, 34, 65, 665, 19, 78, 1, 94, 27, 74, 1, 360, 1, 40, 69, 104, 19, 90, 1, 406, 175, 44, 1, 204
Offset: 1

Views

Author

Antti Karttunen, Oct 30 2021

Keywords

Comments

a(p*(n/p)) - (n/p) = (p+1)*a(n/p) holds for all prime divisors p of n, which can be seen by expanding the left hand side as (A003959(p*(n/p)) - (p*(n/p))) - (n/p) = (p+1)*A003959(n/p)-((p+1)*(n/p)) = (p+1)*(A003959(n/p)-(n/p)) = (p+1)*a(n/p). This implies that a(n) >= A003415(n) for all n. (See also comments in A348970). - Antti Karttunen, Nov 06 2021

Crossrefs

Cf. A348971 (Möbius transform) and A349139, A349140, A349141, A349142, A349143 (other Dirichlet convolutions).
Cf. also A168065 (the arithmetic mean of this and A322582), A168066.

Programs

  • Mathematica
    f[p_, e_] := (p + 1)^e; a[1] = 0; a[n_] := Times @@ f @@@ FactorInteger[n] - n; Array[a, 100] (* Amiram Eldar, Oct 30 2021 *)
  • PARI
    A003959(n) = { my(f = factor(n)); for(i=1, #f~, f[i, 1]++); factorback(f); };
    A348507(n) = (A003959(n) - n);
    
  • PARI
    A020639(n) = if(1==n,n,(factor(n)[1, 1]));
    A348507(n) = { my(s=0, m=1, spf); while(n>1, spf = A020639(n); n /= spf; s += m*n; m *= (1+spf)); (s); }; \\ (Compare this with similar programs given in A003415 and in A322582) - Antti Karttunen, Nov 06 2021

Formula

a(n) = A003959(n) - n.
a(n) = A348508(n) + n.
a(n) = A001065(n) + A348029(n).
From Antti Karttunen, Nov 06 2021: (Start)
a(n) = Sum_{d|n} A348971(d).
a(n) = A003415(n) + A348970(n).
For all n >= 1, A322582(n) <= A003415(n) <= a(n).
For n > 1, a(n) = a(A032742(n))*(1+A020639(n)) + A032742(n). [See the comments above, and compare this with Reinhard Zumkeller's May 09 2011 recursive formula for A003415] (End)
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = A065488 - 1. - Amiram Eldar, Jun 01 2025

A168065 If n = Product p(k)^e(k) then a(n) = (Product (p(k)+1)^e(k) + Product (p(k)-1)^e(k))/2, a(1) = 1.

Original entry on oeis.org

1, 2, 3, 5, 5, 7, 7, 14, 10, 11, 11, 19, 13, 15, 16, 41, 17, 26, 19, 29, 22, 23, 23, 55, 26, 27, 36, 39, 29, 40, 31, 122, 34, 35, 36, 74, 37, 39, 40, 83, 41, 54, 43, 59, 56, 47, 47, 163, 50, 62, 52, 69, 53, 100, 56, 111, 58, 59, 59, 112, 61, 63, 76, 365, 66, 82, 67, 89, 70, 84, 71
Offset: 1

Views

Author

Daniel Forgues, Nov 18 2009

Keywords

Comments

a(n) = n iff n is 1 or a prime;
a(n) = n+1 iff n is a biprime, i.e., n = p*q, p <= q primes;
a(n) = n+(p+q+r) iff n is a triprime, i.e., n = p*q*r, p <= q <= r primes;
a(n) = n + (p*q + p*r + p*s + q*r + q*s + r*s) + 1 iff n is a quadprime, i.e., n = p*q*r*s, p <= q <= r <= s primes;
...

Crossrefs

Programs

  • PARI
    a(n) = {f = factor(n); return ((prod(k=1, #f~, (f[k, 1]+1)^f[k, 2]) + prod(k=1, #f~, (f[k, 1]-1)^f[k, 2]))/2);} \\ Michel Marcus, Jun 13 2013

Formula

a(n) = (A003959(n) + A003958(n))/2.

A349129 a(n) = Sum_{d|n} A003958(d) * A003959(n/d), where A003958 is fully multiplicative with a(p) = (p-1), and A003959 is fully multiplicative with a(p) = (p+1).

Original entry on oeis.org

1, 4, 6, 13, 10, 24, 14, 40, 28, 40, 22, 78, 26, 56, 60, 121, 34, 112, 38, 130, 84, 88, 46, 240, 76, 104, 120, 182, 58, 240, 62, 364, 132, 136, 140, 364, 74, 152, 156, 400, 82, 336, 86, 286, 280, 184, 94, 726, 148, 304, 204, 338, 106, 480, 220, 560, 228, 232, 118, 780, 122, 248, 392, 1093, 260, 528, 134, 442, 276
Offset: 1

Views

Author

Antti Karttunen, Nov 09 2021

Keywords

Comments

Dirichlet convolution of A003958 with A003959.

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := ((p + 1)^(e + 1) - (p - 1)^(e + 1))/2; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Nov 09 2021 *)
  • PARI
    A003958(n) = { my(f = factor(n)); for(i=1, #f~, f[i, 1]--); factorback(f); };
    A003959(n) = { my(f = factor(n)); for(i=1, #f~, f[i, 1]++); factorback(f); };
    A349129(n) = sumdiv(n,d,A003958(d)*A003959(n/d));

Formula

Multiplicative with a(p^e) = ((p+1)^(e+1) - (p-1)^(e+1))/2. - Amiram Eldar, Nov 09 2021
For all n >= 1, A349130(n) <= a(n) <= A349170(n).
Showing 1-6 of 6 results.