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.

A362931 a(n) = number of pairs (i,j) in [1..n] X [1..n] with integral harmonic mean 2*i*j/(i+j).

This page as a plain text file.
%I A362931 #24 Oct 13 2024 07:06:09
%S A362931 1,2,3,4,5,10,11,12,13,14,15,20,21,22,27,28,29,34,35,40,41,42,43,48,
%T A362931 49,50,51,56,57,66,67,68,69,70,75,80,81,82,83,88,89,98,99,100,109,110,
%U A362931 111,116,117,118,119,120,121,126,127,132,133,134,135,148,149,150,155,156,157,166,167,168,169,174,175,184,185,186,191,192,197,202,203,208
%N A362931 a(n) = number of pairs (i,j) in [1..n] X [1..n] with integral harmonic mean 2*i*j/(i+j).
%H A362931 Alois P. Heinz, <a href="/A362931/b362931.txt">Table of n, a(n) for n = 1..10000</a>
%F A362931 a(n) = n + Sum_{1<=i<j<=n, (i+j)|2*i*j} 2. - _Chai Wah Wu_, Aug 28 2023
%p A362931 a:= proc(n) option remember; `if`(n=0, 0, a(n-1)-1+
%p A362931       2*add(`if`(irem(2*i*n, i+n)=0, 1, 0), i=1..n))
%p A362931     end:
%p A362931 seq(a(n), n=1..80);  # _Alois P. Heinz_, Aug 28 2023
%t A362931 a[n_] := a[n] = If[n == 0, 0, a[n-1] - 1 +
%t A362931    2*Sum[If[Mod[2*i*n, i+n] == 0, 1, 0], {i, 1, n}]];
%t A362931 Table[a[n], {n, 1, 80}] (* _Jean-François Alcover_, Oct 13 2024, after _Alois P. Heinz_ *)
%o A362931 (Python)
%o A362931 def A362931(n): return n+(sum(1 for x in range(1,n+1) for y in range(1,x) if not (x*y<<1)%(x+y))<<1) # _Chai Wah Wu_, Aug 28 2023
%Y A362931 Cf. A000982 (arithmetic mean analog), A132188 (geometric mean analog).
%Y A362931 Cf. also A362932-A362937.
%K A362931 nonn
%O A362931 1,2
%A A362931 _N. J. A. Sloane_, Aug 28 2023