%I #76 Mar 16 2024 15:20:24
%S 1,4,9,16,20,25,36,49,50,64,81,100,117,121,144,169,180,196,200,225,
%T 242,256,289,324,325,361,400,441,450,468,484,500,529,576,578,605,625,
%U 650,676,729,784,800,841,900,961,968,980,1024,1025,1058,1089,1156,1225,1280,1296
%N Antiharmonic numbers: numbers k such that sigma_1(k) divides sigma_2(k).
%C 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
%C 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
%C Sequence is infinite, see A227771. - _Charles R Greathouse IV_, Sep 02 2013
%C The term "antiharmonic" is also known as "contraharmonic". - _Pahikkala Jussi_, Dec 11 2013
%H Amiram Eldar, <a href="/A020487/b020487.txt">Table of n, a(n) for n = 1..10000</a> (term 1..1000 from Paolo P. Lava)
%H Marco Abrate, Stefano Barbero, Umberto Cerruti, and Nadir Murru, <a href="http://imar.ro/journals/Mathematical_Reports/Pdfs/2016/4/5.pdf">The Biharmonic mean</a>, Mathematical Reports, Vol. 18(68), No. 4 (2016), pp. 483-495, <a href="http://arxiv.org/abs/1601.03081">preprint</a>, arXiv:1601.03081 [math.NT], 2016.
%e a(3) = 9 = 3^2; antiharmonic mean of divisors of 9 is (3^(2+1) + 1)/(3 + 1) = 7; 7 is integer. - _Jaroslav Krizek_, Mar 09 2009
%t Select[Range[2000], Divisible[DivisorSigma[2, #], DivisorSigma[1, #]]&] (* _Jean-François Alcover_, Nov 14 2017 *)
%o (Magma) [n: n in [1..1300] | IsZero(DivisorSigma(2,n) mod DivisorSigma(1,n))]; // _Bruno Berselli_, Apr 10 2013
%o (PARI) is(n)=sigma(n,2)%sigma(n)==0 \\ _Charles R Greathouse IV_, Jul 02 2013
%o (Haskell)
%o a020487 n = a020487_list !! (n-1)
%o a020487_list = filter (\x -> a001157 x `mod` a000203 x == 0) [1..]
%o -- _Reinhard Zumkeller_, Jan 21 2014
%o (Python)
%o from sympy import divisor_sigma
%o def ok(n): return divisor_sigma(n, 2)%divisor_sigma(n, 1) == 0
%o print([k for k in range(1, 1300) if ok(k)]) # _Michael S. Branicky_, Feb 25 2024
%o (Python) # faster for producing initial segment of sequence
%o from math import prod
%o from sympy import factorint
%o def ok(n):
%o f = factorint(n)
%o sigma1 = prod((p**( e+1)-1)//(p-1) for p, e in f.items())
%o sigma2 = prod((p**(2*e+2)-1)//(p**2-1) for p, e in f.items())
%o return sigma2%sigma1 == 0
%o print([k for k in range(1, 1300) if ok(k)]) # _Michael S. Branicky_, Feb 25 2024
%Y Cf. A001157, A000203, A227771, A228023, A228024, A228036.
%K nonn
%O 1,2
%A _David W. Wilson_