%I #13 Oct 06 2017 01:05:04
%S 2,14,21,26,33,34,38,44,45,57,62,74,75,81,85,86,93,94,98,104,105,116,
%T 117,118,122,133,134,135,141,142,145,146,147,158,164,165,171,177,188,
%U 189,194,201,202,205,206,213,214,217,218,225,230,231,242,243,244,253
%N Positive integers n such that (d(n+1) - d(n)) * (-1)^n is nonnegative, where d(n) = the number of positive divisors of n.
%F Union of the terms of A138046 and A005237.
%p with(numtheory): a:=proc(n) if 0<=(-1)^n*(tau(n+1)-tau(n)) then n else end if end proc: seq(a(n),n=1..240); # _Emeric Deutsch_, Mar 06 2008
%p A051950 := proc(n) numtheory[tau](n)-numtheory[tau](n+1) ; end: A138047 := proc(n) option remember ; local a; if n = 1 then 2 ; else for a from A138047(n-1)+1 do if (-1)^a*A051950(a+1) >= 0 then RETURN(a) ; fi ; od: fi ; end: seq(A138047(n),n=1..80) ; # _R. J. Mathar_, Mar 31 2008
%t Select[Range[500], (DivisorSigma[0, # + 1] - DivisorSigma[0, # ])*(-1)^# > -1 &] (* _Stefan Steinerberger_, Mar 03 2008 *)
%Y Cf. A138046, A005237.
%K nonn
%O 1,1
%A _Leroy Quet_, Mar 02 2008
%E More terms from _Stefan Steinerberger_ and _Emeric Deutsch_, Mar 03 2008
%E More terms from _R. J. Mathar_, Mar 31 2008