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.

A362932 a(n) = A132188(n) - A362931(n).

This page as a plain text file.
%I A362932 #18 Aug 29 2023 09:48:44
%S A362932 0,0,0,2,2,-2,-2,0,4,4,4,2,2,2,-2,4,4,4,4,2,2,2,2,0,8,8,12,10,10,2,2,
%T A362932 8,8,8,4,10,10,10,10,8,8,0,0,2,-2,-2,-2,0,12,20,20,22,22,22,22,20,20,
%U A362932 20,20,10,10,10,10,24,24,16,16,18,18,14,14,16,16,16,20,22,18,14,14,16
%N A362932 a(n) = A132188(n) - A362931(n).
%C A362932 a(n) = (number of pairs (i,j) in [1..n] X [1..n] with integral geometric mean sqrt(i*j)) - (number of pairs (i,j) in [1..n] X [1..n] with integral harmonic mean 2*i*j/(i+j)).
%H A362932 Alois P. Heinz, <a href="/A362932/b362932.txt">Table of n, a(n) for n = 1..10000</a>
%p A362932 a:= proc(n) option remember; `if`(n=0, 0, 2*add(
%p A362932       `if`(irem(2*i*n, i+n)=0, -1, 0)+
%p A362932       `if`(issqr(i*n), 1, 0), i=1..n-1)+a(n-1))
%p A362932     end:
%p A362932 seq(a(n), n=1..80);  # _Alois P. Heinz_, Aug 28 2023
%t A362932 Block[{c, q}, c[n_] := c[n] = Flatten[Table[w^2 - x*y, {w, n}, {x, n}, {y, n}]]; q[n_] := q[n] = Flatten[Table[(2*i*j)/(i + j), {i, n}, {j, n}]]; Table[Count[c[n], 0] - Count[q[n], _?IntegerQ], {n, 80}] ] (* _Michael De Vlieger_, Aug 28 2023 *)
%o A362932 (Python)
%o A362932 from sympy.ntheory.primetest import is_square
%o A362932 def A362932(n): return sum((1 if T else -1) for x in range(1,n+1) for y in range(1,x) if (T:=is_square(x*y))^(not (x*y<<1)%(x+y)))<<1 # _Chai Wah Wu_, Aug 28 2023
%Y A362932 Cf. A132188, A362931.
%K A362932 sign,look
%O A362932 1,4
%A A362932 _N. J. A. Sloane_, Aug 28 2023