login
a(n) = Sum_{d1|n, d2|n, d1<d2} (1 - [d1 + 1 = d2]), where [ ] is the Iverson bracket.
2

%I #20 May 13 2023 22:31:14

%S 0,0,1,2,1,4,1,5,3,5,1,12,1,5,6,9,1,13,1,13,6,5,1,25,3,5,6,14,1,25,1,

%T 14,6,5,6,33,1,5,6,26,1,25,1,14,15,5,1,42,3,14,6,14,1,26,6,26,6,5,1,

%U 61,1,5,15,20,6,26,1,14,6,27,1,62,1,5,15,14,6,26,1,43,10,5,1,62

%N a(n) = Sum_{d1|n, d2|n, d1<d2} (1 - [d1 + 1 = d2]), where [ ] is the Iverson bracket.

%C Number of pairs of divisors of n, (d1,d2), with d1 < d2 such that d1 and d2 are nonconsecutive integers. For example, the 4 pairs for a(6) are (1,3), (1,6), (2,6) and (3,6).

%C Also, the number of distinct nonsquare rectangles that can be made using any divisors of n as side lengths and whose length is never one more than its width.

%H Antti Karttunen, <a href="/A337363/b337363.txt">Table of n, a(n) for n = 1..20000</a>

%F a(n) = A337362(n) - A000005(n).

%F a(n) = A066446(n) - A129308(n). - _Ridouane Oudra_, Apr 16 2023

%t Table[Sum[Sum[(1 - KroneckerDelta[i + 1, k]) (1 - Ceiling[n/k] + Floor[n/k]) (1 - Ceiling[n/i] + Floor[n/i]), {i, k - 1}], {k, n}], {n, 100}]

%t Table[Count[Subsets[Divisors[n],{2}],_?(#[[2]]-#[[1]]>1&)],{n,90}] (* _Harvey P. Dale_, Mar 11 2023 *)

%o (PARI) a(n) = sumdiv(n, d1, sumdiv(n, d2, (d1<d2) && (d1 + 1 != d2))); \\ _Michel Marcus_, Aug 25 2020

%Y Cf. A000005, A337362, A066446, A129308.

%K nonn

%O 1,4

%A _Wesley Ivan Hurt_, Aug 24 2020