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.

A020487 Antiharmonic numbers: numbers k such that sigma_1(k) divides sigma_2(k).

Original entry on oeis.org

1, 4, 9, 16, 20, 25, 36, 49, 50, 64, 81, 100, 117, 121, 144, 169, 180, 196, 200, 225, 242, 256, 289, 324, 325, 361, 400, 441, 450, 468, 484, 500, 529, 576, 578, 605, 625, 650, 676, 729, 784, 800, 841, 900, 961, 968, 980, 1024, 1025, 1058, 1089, 1156, 1225, 1280, 1296
Offset: 1

Views

Author

Keywords

Comments

Numbers k such that antiharmonic mean of divisors of k is an integer. Antiharmonic mean of divisors of number m = Product (p_i^e_i) is A001157(m)/A000203(m) = Product ((p_i^(e_i+1)+1)/(p_i+1)). So a(n) = k, for some n, if A001157(k)/A000203(k) is an integer. - Jaroslav Krizek, Mar 09 2009
Squares are antiharmonic, since (p^(2*e+1)+1)/(p+1) = p^(2*e) - p^(2*e-1) + p^(2*e-2) - ... + 1 is an integer. The nonsquare antiharmonic numbers are A227771. They include the primitive antiharmonic numbers A228023, except for its first term. - Jonathan Sondow, Aug 02 2013
Sequence is infinite, see A227771. - Charles R Greathouse IV, Sep 02 2013
The term "antiharmonic" is also known as "contraharmonic". - Pahikkala Jussi, Dec 11 2013

Examples

			a(3) = 9 = 3^2; antiharmonic mean of divisors of 9 is (3^(2+1) + 1)/(3 + 1) = 7; 7 is an integer. - _Jaroslav Krizek_, Mar 09 2009
		

Crossrefs

Programs

  • Haskell
    a020487 n = a020487_list !! (n-1)
    a020487_list = filter (\x -> a001157 x `mod` a000203 x == 0) [1..]
    -- Reinhard Zumkeller, Jan 21 2014
    
  • Magma
    [n: n in [1..1300] | IsZero(DivisorSigma(2,n) mod DivisorSigma(1,n))]; // Bruno Berselli, Apr 10 2013
    
  • Mathematica
    Select[Range[2000], Divisible[DivisorSigma[2, #], DivisorSigma[1, #]]&] (* Jean-François Alcover, Nov 14 2017 *)
  • PARI
    is(n)=sigma(n,2)%sigma(n)==0 \\ Charles R Greathouse IV, Jul 02 2013
    
  • Python
    from sympy import divisor_sigma
    def ok(n): return divisor_sigma(n, 2)%divisor_sigma(n, 1) == 0
    print([k for k in range(1, 1300) if ok(k)]) # Michael S. Branicky, Feb 25 2024
    
  • Python
    # faster for producing initial segment of sequence
    from math import prod
    from sympy import factorint
    def ok(n):
        f = factorint(n)
        sigma1 = prod((p**(  e+1)-1)//(p-1)    for p, e in f.items())
        sigma2 = prod((p**(2*e+2)-1)//(p**2-1) for p, e in f.items())
        return sigma2%sigma1 ==  0
    print([k for k in range(1, 1300) if ok(k)]) # Michael S. Branicky, Feb 25 2024