login
Number of distinct integers of the form (n+k)/|(n-k)| for k > 0.
2

%I #14 Dec 08 2019 02:08:29

%S 2,3,5,5,6,7,6,7,9,9,6,10,6,9,12,9,6,13,6,12,13,9,6,14,10,9,13,13,6,

%T 17,6,11,13,9,13,18,6,9,13,16,6,18,6,13,20,9,6,18,10,15,13,13,6,19,14,

%U 16,13,9,6,23,6,9,20,13,14,19,6,13,13,20,6,23,6,9,20,13,14,19,6,20,17,9,6

%N Number of distinct integers of the form (n+k)/|(n-k)| for k > 0.

%C Integers of the form (n+k)/|(n-k)| for integer k are exactly the numbers d-1 and d+1 where d runs through the divisors of 2n. Of those, 0 and 1 do not count because they correspond to nonpositive k. - _Ivan Neretin_, Sep 07 2017

%H Ivan Neretin, <a href="/A111164/b111164.txt">Table of n, a(n) for n = 1..10000</a>

%e For n=14 we have integer values of this form when k={7; 10; 12; 13; 15; 16; 18; 19; 21; 28; 42} and (14+k)/|(14-k)| = {3, 6, 13, 27, 29, 15, 8, 5, 3, 2}. Thus a(14) = 9 because 3 is present twice.

%t f[n_] := Length[ Union[ Select[(n + #)/Abs[n - # ] & /@ Delete[ Range[ Floor[3n]], n], IntegerQ[ # ] &]]]; Array[f, 83] (* _Robert G. Wilson v_, Oct 31 2005 *)

%t Table[d = Divisors[2 n]; Length@Union[Drop[d - 1, 2], d + 1], {n, 83}] (* _Ivan Neretin_, Sep 07 2017 *)

%Y Cf. A111150.

%K easy,nonn

%O 1,1

%A _Paolo P. Lava_ and _Giorgio Balzarotti_, Oct 21 2005

%E Corrected and extended by _Robert G. Wilson v_, Oct 31 2005