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.

Previous Showing 11-16 of 16 results.

A094472 a(n) = n*tau(n) - sigma(n) - phi(n), where tau(n) is the number of divisors of n.

Original entry on oeis.org

-1, 0, 0, 3, 0, 10, 0, 13, 8, 18, 0, 40, 0, 26, 28, 41, 0, 63, 0, 70, 40, 42, 0, 124, 24, 50, 50, 100, 0, 160, 0, 113, 64, 66, 68, 221, 0, 74, 76, 214, 0, 228, 0, 160, 168, 90, 0, 340, 48, 187, 100, 190, 0, 294, 108, 304, 112, 114, 0, 536, 0, 122, 238, 289, 128, 364, 0, 250, 136, 392, 0, 645, 0, 146, 286, 280, 152, 432, 0, 582
Offset: 1

Views

Author

Labos Elemer, May 28 2004

Keywords

Comments

If n is prime, then a(n) = 0.
Is the reverse statement true [namely (a(n)=0 -> n=prime)]?
From Bernard Schott, Feb 06 2020: (Start)
The answer to this question is yes: a(n) = 0 iff n is prime (see the reference De Koninck & Mercier, Problème 625). This property comes from the 2 results below:
1) If f and g are multiplicative functions with positive values, then, for n >= 2 Sum_{d|n} f(d)*g(n/d) >= f(n) + g(n) with equality iff n is prime (see reference Problème 624).
2) Sum_{d|n} sigma(d)*phi(n/d) = n * tau(n) (see reference Problème 596).
Together, these 2 results give n * tau(n) >= sigma(n) + phi(n) with equality iff n is prime.
Also a(n) >= 0 for n > 1. (End)

Examples

			As tau(10)= 4, sigma(10) = 18, phi(10) = 4, then a(10) = 10*4-18-4 = 18.  - _Bernard Schott_, Feb 06 2020
		

References

  • Jean-Marie De Koninck and Armel Mercier, 1001 Problèmes en Théorie Classique des Nombres, Problème 625 pp. 82, 281; Problème 596, pp. 80, 275; Problème 624, pp. 82, 281; Ellipses, Paris, 2004.

Crossrefs

Cf. A000005 (tau), A000010 (phi), A000203 (sigma).
Cf. A038040 (n*tau(n)), A094471 (n*tau(n)-sigma(n)), A065387 (phi(n)+sigma(n)).

Programs

  • Mathematica
    Table[w*DivisorSigma[0, w]-DivisorSigma[1, w]-EulerPhi[w], {w, 1, 100}]
  • PARI
    apply( {A094472(n)=n*numdiv(n=factor(n))-sigma(n)-eulerphi(n)}, [1..99]) \\ M. F. Hasler, Feb 07 2020

Formula

a(n) = n*A000005(n) - A000203(n) - A000010(n).
Sum_{k=1..n} a(k) ~ n^2*log(n)/2 + (gamma - 1/4 - Pi^2/12 - 3/Pi^2)*n^2, where gamma is Euler's constant (A001620). - Amiram Eldar, Dec 07 2023

A152215 Numbers k such that sigma_2(k)/(sigma_1(k)*sigma_0(k)) = c, c an integer.

Original entry on oeis.org

1, 4, 25, 100, 121, 256, 289, 484, 529, 841, 1156, 1600, 1681, 2116, 2209, 2809, 3025, 3364, 3481, 5041, 6400, 6724, 6889, 7225, 7921, 8836, 10201, 11236, 11449, 12100, 12769, 13225, 13924, 17161, 18225, 18496, 18769, 20164, 21025, 22201, 27556, 27889, 28900
Offset: 1

Views

Author

Ctibor O. Zizka, Nov 29 2008

Keywords

Comments

k : A001157(k)/(A000203(k)*A000005(k)) = c, c an integer.

Crossrefs

Programs

  • Mathematica
    Select[Range[50000],IntegerQ[DivisorSigma[2,#]/(DivisorSigma[1,#] DivisorSigma[ 0,#])]&] (* Harvey P. Dale, Feb 12 2013 *)
  • PARI
    isok(k) = denominator(sigma(k,2)/(sigma(k, 1)*sigma(k,0))) == 1; \\ Michel Marcus, Jul 15 2019

Extensions

More terms from Harvey P. Dale, Feb 12 2013

A325941 Expansion of Sum_{k>=1} k * x^(2*k) / (1 + x^k)^2.

Original entry on oeis.org

0, 1, -2, 5, -4, 4, -6, 17, -14, 6, -10, 28, -12, 8, -36, 49, -16, 13, -18, 46, -52, 12, -22, 100, -44, 14, -68, 64, -28, 24, -30, 129, -84, 18, -92, 121, -36, 20, -100, 166, -40, 32, -42, 100, -192, 24, -46, 292, -90, 31, -132, 118, -52, 40, -148, 232, -148, 30, -58, 264
Offset: 1

Views

Author

Ilya Gutkovskiy, Sep 09 2019

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 60; CoefficientList[Series[Sum[k x^(2 k)/(1 + x^k)^2, {k, 1, nmax}], {x, 0, nmax}], x] // Rest
    Table[Sum[(-1)^(n/d) (n - d), {d, Divisors[n]}], {n, 1, 60}]
  • PARI
    {a(n) = sumdiv(n, d, (-1)^(n/d)*(n-d))} \\ Seiichi Manyama, Sep 14 2019

Formula

G.f.: Sum_{k>=2} (-1)^k * (k - 1) * x^k / (1 - x^k)^2.
a(n) = Sum_{d|n} (-1)^(n/d) * (n - d).
a(n) = A000593(n) - n * A048272(n).

A362625 a(n) = Sum_{k not divides n - k, 0 <= k < n} k.

Original entry on oeis.org

0, 0, 1, 1, 6, 3, 15, 11, 22, 23, 45, 22, 66, 59, 69, 71, 120, 84, 153, 112, 158, 179, 231, 144, 256, 263, 283, 266, 378, 267, 435, 367, 444, 479, 503, 397, 630, 611, 641, 550, 780, 621, 861, 766, 798, 923, 1035, 772, 1086, 1018, 1143, 1112, 1326, 1119, 1337, 1212, 1448
Offset: 1

Views

Author

Wesley Ivan Hurt, Apr 28 2023

Keywords

Comments

a(n) is the total distance from n to each of its nondivisors. For example, a(6)=3 since the nondivisors of 6 are 4,5 and (6-4)+(6-5) = 2+1 = 3.

Crossrefs

Cf. A000005 (tau), A000203 (sigma), A024816 (antisigma), A049820 (n-d(n)), A094471, A161680.

Programs

  • Maple
    divides := (k, n) -> k = n or (k > 0 and irem(n, k) = 0):
    A362625 := n -> local k; add(`if`(divides(n - k, n), 0, k), k = 0..n - 1):
    seq(A362625(n), n = 1..57);  # Peter Luschny, Nov 14 2023
  • Mathematica
    Table[n (n - 1)/2 - n*DivisorSigma[0, n] + DivisorSigma[1, n], {n, 100}]
    (* Alternative: *)
    a[n_] := Sum[If[Divisible[n, n - k], 0, k], {k, 0, n - 1}]
    Table[a[n], {n, 1, 57}]  (* Peter Luschny, Nov 14 2023 *)
  • PARI
    a(n) = n*(n-1)/2 - n*numdiv(n) + sigma(n); \\ Michel Marcus, Apr 28 2023
    
  • Python
    from math import prod
    from sympy import factorint
    def A362625(n):
        f = factorint(n)
        return (n*(n-1)>>1)-n*prod(e+1 for e in f.values())+prod((p**(e+1)-1)//(p-1) for p, e in f.items()) # Chai Wah Wu, Apr 28 2023
    
  • SageMath
    def A362625(n): return sum(k for k in (0..n-1) if not (n-k).divides(n))
    print([A362625(n) for n in srange(1, 58)])  # Peter Luschny, Nov 14 2023

Formula

a(n) = n*(n-1)/2 - n*tau(n) + sigma(n). [Previous name.]
a(n) = n*(n - tau(n)) - antisigma(n).
a(n) = Sum_{k=1..n} (n - k) * (ceiling(n/k) - floor(n/k)).
a(n) = A161680(n) - A094471(n).
a(p) = (p-1)*(p-2)/2, for primes p.

Extensions

Simpler name by Peter Luschny, Nov 14 2023

A367870 a(n) = Sum_{d|n, d odd} (n-d).

Original entry on oeis.org

0, 1, 2, 3, 4, 8, 6, 7, 14, 14, 10, 20, 12, 20, 36, 15, 16, 41, 18, 34, 52, 32, 22, 44, 44, 38, 68, 48, 28, 96, 30, 31, 84, 50, 92, 95, 36, 56, 100, 74, 40, 136, 42, 76, 192, 68, 46, 92, 90, 119, 132, 90, 52, 176, 148, 104, 148, 86, 58, 216, 60, 92, 274, 63, 176, 216
Offset: 1

Views

Author

Wesley Ivan Hurt, Dec 03 2023

Keywords

Comments

Total distance from n to each odd divisor of n.

Examples

			a(15) = 36. The total distance from 15 to each of its odd divisors is (15-1) + (15-3) + (15-5) + (15-15) = 36.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local x,d;
      x:= n/2^padic:-ordp(n,2);
      add(n-d, d = numtheory:-divisors(x))
    end proc:
    map(f, [$1..100]); # Robert Israel, Dec 04 2023
  • Mathematica
    Table[DivisorSum[n, n-# &, OddQ], {n, 100}] (* Paolo Xausa, Mar 05 2024 *)
  • PARI
    a(n) = sumdiv(n, d, if (d%2, n-d)); \\ Michel Marcus, Dec 04 2023
    
  • Python
    from math import prod
    from sympy import factorint
    def A367870(n):
        f = factorint(n>>(~n&n-1).bit_length())
        return n*prod(e+1 for e in f.values())-prod((p**(e+1)-1)//(p-1) for p,e in f.items()) # Chai Wah Wu, Dec 31 2023

Formula

a(n) = A245579(n) - A000593(n).
a(n) = n*A001227(n) - A000593(n).

A380600 Irregular table T(n, k), n > 0, k = 1..A000005(n) read by rows: the n-th row lists the numbers of the form n * (d-1) / d with d a positive divisor of n.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Feb 02 2025

Keywords

Examples

			Table T(n, k) begins:
  n   n-th row
  --  ------------------
   1  0
   2  0, 1
   3  0, 2
   4  0, 2, 3
   5  0, 4
   6  0, 3, 4, 5
   7  0, 6
   8  0, 4, 6, 7
   9  0, 6, 8
  10  0, 5, 8, 9
  11  0, 10
  12  0, 6, 8, 9, 10, 11
  13  0, 12
  14  0, 7, 12, 13
		

Crossrefs

Programs

  • Mathematica
    Table[Map[n*(# - 1)/# &, Divisors[n]], {n, 23}] // Flatten (* Michael De Vlieger, Feb 03 2025 *)
  • PARI
    row(n) = apply (d -> n*(d-1)/d, divisors(n))

Formula

T(n, k) = n * (A027750(n, k) - 1) / A027750(n, k).
Sum_{k = 1..A000005(n)} T(n, k) = A094471(n).
Product_{k = 2..A000005(n)} T(n, k) = A072513(n).
LCM{k = 2..A000005(n)} T(n, k) = A258324(n).
T(n, 1) = 0.
T(n, 2) = A060681(n) for any n > 1. - Michel Marcus, Feb 03 2025
T(n, A000005(n)-1) = A046666(n) for any n > 1.
T(n, A000005(n)) = n-1.
Previous Showing 11-16 of 16 results.