%I #155 Jul 26 2022 14:02:02
%S 1,1,0,1,0,2,0,1,1,0,0,2,0,0,2,1,0,1,0,2,0,0,0,2,1,0,0,2,0,2,0,1,0,0,
%T 2,1,0,0,0,2,0,2,0,0,2,0,0,2,1,1,0,0,0,2,0,2,0,0,0,2,0,0,2,1,0,2,0,0,
%U 0,2,0,3,0,0,0,0,2,0,0,2,1,0,0,2,0,0,0,2,0,2,2,0,0,0,0,2,0,1,2,1,0,0,0,2,0
%N Number of middle divisors of n, i.e., divisors in the half-open interval [sqrt(n/2), sqrt(n*2)).
%C Comment from _N. J. A. Sloane_, Jan 03 2021: (Start)
%C Theorem 1: (i) a(n) = (number of odd divisors of n <= sqrt(2*n)) - (number of odd divisors of n > sqrt(2*n)).
%C (ii) Let r(n) = A003056(n). Then a(n) = (number of odd divisors of n <= r(n)) - (number of odd divisors of n > r(n)).
%C (iii) a(n) = Sum_{k=1..r(n)} (-1)^(k+1)*A237048(n,k).
%C (iv) a(n) is odd iff n is a square or twice a square (cf. A053866). Indices of odd terms give A028982. Indices of even terms give A028983.
%C The proofs are straightforward. These results were conjectured by _Omar E. Pol_ in 2017. (End)
%C Theorem 2: a(n) is equal to the difference between the number of partitions of n into an odd number of consecutive parts and the number of partitions of n into an even number of consecutive parts. [Chapman et al., 2001; Hirschhorn and Hirschhorn, 2005]. - _Omar E. Pol_, Feb 06 2017
%C From _Omar E. Pol_, Feb 06 2017: (Start)
%C Conjecture 1: This is the central column of the isosceles triangle of A249351.
%C Conjecture 2: a(n) is also the width of the terrace at the n-th level in the main diagonal of the pyramid described in A245092.
%C Conjecture 3: a(n) is also the number of central subparts of the symmetric representation of sigma(n). For more information see A279387.
%C Conjectures 2 and 3 were proposed after _Michel Marcus_'s conjecture in A237593. (End)
%C Conjectures 1, 2, and 3 are all true. - _N. J. A. Sloane_, Feb 11 2021
%D Robin Chapman, Kimmo Eriksson and Richard Stanley, On the Number of Divisors of n in a Special Interval: Problem 10847, Amer. Math. Monthly 108:1 (Jan 2001), p. 77 (Proposal); 109:1 (Jan 2002), p. 80 (Solution). [Please do not delete this reference. - _N. J. A. Sloane_, Dec 16 2020]
%H Reinhard Zumkeller, <a href="/A067742/b067742.txt">Table of n, a(n) for n = 1..10000</a>
%H Robin Chapman, Kimmo Eriksson and Richard Stanley, <a href="http://www.jstor.org/stable/2695686">On the Number of Divisors of n in a Special Interval: Problem 10847</a>, Amer. Math. Monthly 108, (2001), p. 77; <a href="https://www.jstor.org/stable/2695782">solution</a> by Reiner Martin, Amer. Math. Monthly 109, (2002), p. 80.
%H M. D. Hirschhorn and P. M. Hirschhorn, <a href="http://www.maa.org/sites/default/files/3004420056860.pdf.bannered.pdf">Partitions into Consecutive Parts</a>, Mathematics Magazine 78.5 (2005): 396-396.
%H Christian Kassel and Christophe Reutenauer, <a href="https://arxiv.org/abs/1505.07229v3">The zeta function of the Hilbert scheme of n points on a two-dimensional torus</a>, arXiv:1505.07229v3 [math.AG], 2015, see page 29 Remarks 6.8(b). [Note that a later version of this paper has a different title and different contents, and the number-theoretical part of the paper was moved to the publication which is next in this list.]
%H Christian Kassel and Christophe Reutenauer, <a href="https://arxiv.org/abs/1610.07793">Complete determination of the zeta function of the Hilbert scheme of n points on a two-dimensional torus</a>, arXiv:1610.07793 [math.NT], 2016, see Remark 1.3.
%H Omar E. Pol, <a href="/A067742/a067742.jpg">Illustration of initial terms obtained geometrically</a>
%H J. E. Vatne, <a href="http://arxiv.org/abs/1607.02122">The sequence of middle divisors is unbounded</a>, arXiv:1607.02122 [math.NT], 2016, shows that there is a subsequence diverging to infinity.
%F G.f.: Sum_{k>=1} (-1)^(k-1)*x^(k*(k+1)/2)/(1-x^k). (This g.f. corresponds to the assertion in Theorem 2.)
%F Another g.f., corresponding to the definition: Sum_{k>=1} x^(2*k*(k+1))*(1-x^(6*k^2))/(1-x^(2*k)) + Sum_{k>=0} x^((k+1)*(2*k+1))*(1-x^((2*k+1)*(3*k+2))/(1-x^(2*k+1). - _N. J. A. Sloane_, Jan 04 2021
%F a(A128605(n)) = n and a(m) <> n for m < A128605(n). - _Reinhard Zumkeller_, Mar 14 2007
%F It appears that a(n) = A240542(n) - A240542(n-1), the difference between two adjacent Dyck paths as defined in A237593. - _Hartmut F. W. Hoft_, Feb 06 2017
%F The above conjecture is essentially the same as _Michel Marcus_'s conjecture in A237593. - _Omar E. Pol_, Dec 20 2020
%F Conjecture: a(n) = A082647(n) - A131576(n) = A001227(n) - 2*A131576(n). - _Omar E. Pol_, Feb 06 2017
%F a(n) = A348406(n) - 1. - _Omar E. Pol_, Oct 29 2021
%F a(n) = A000005(n) - A067743(n). - _Omar E. Pol_, Jun 11 2022
%e a(6)=2 because the 2 middle divisors of 6 (2 and 3) are between sqrt(3) and sqrt(12).
%t (* number of middle divisors *)
%t a067742[n_] := Select[Divisors[n], Sqrt[n/2] <= # < Sqrt[2n] &]
%t a067742[115] (* data *)
%t (* _Hartmut F. W. Hoft_, Jul 17 2014 *)
%t a[ n_] := If[ n < 1, 0, DivisorSum[ n, 1 &, n/2 <= #^2 < 2 n &]]; (* _Michael Somos_, Jun 04 2015 *)
%t (* support function a240542[] is defined in A240542 *)
%t b[n_] := a240542[n] - a240542[n-1]
%t Map[b,Range[105]] (* data - _Hartmut F. W. Hoft_, Feb 06 2017 *)
%o (PARI) A067742(n) = {sumdiv(n, d, d2 = d^2; n / 2 < d2 && d2 <= n << 1)} \\ _M. F. Hasler_, May 12 2008
%o (PARI) a(n) = A067742(n) = {my(d = divisors(n), iu = il = #d \ 2); if(#d <= 2, return(n < 3)); while(d[il]^2 > n>>1, il--); while(d[iu]^2 < (n<<1), iu++);
%o iu - il - 1 + issquare(n/2)} \\ _David A. Corneth_, Apr 06 2018
%o (Python)
%o from sympy import divisors
%o def A067742(n): return sum(1 for d in divisors(n,generator=True) if n <= 2*d**2 < 4*n) # _Chai Wah Wu_, Jun 09 2022
%Y Cf. A001227, A003056, A028982, A028983, A053866, A067743, A071090 (sums of middle divisors), A082647, A128605, A131576.
%Y Cf. also A071561 (positions of zeros), A071562 (positions of nonzeros), A299761 (middle divisors of n), A355143 (products of middle divisors).
%Y Relation to Dyck paths: A237048, A237593, A240542 (partial sums), A245092, A249351, A279387, A348406.
%K easy,nonn
%O 1,6
%A _Marc LeBrun_, Jan 29 2002
%E Edited by _N. J. A. Sloane_, Jan 03 2021