login
Numbers n such that n and n + 1 have exactly the same number of odd divisors.
4

%I #58 Apr 06 2019 10:39:25

%S 1,5,6,10,11,12,13,19,22,23,28,37,40,43,46,47,49,52,54,58,61,65,67,69,

%T 73,77,79,82,84,88,96,103,106,110,112,114,119,129,132,136,140,148,151,

%U 154,155,157,163,166,172,178,182,185,186,191,192,193,203,204,211,215,216,219,220,221

%N Numbers n such that n and n + 1 have exactly the same number of odd divisors.

%C If A001227(n) = A001227(n*2^m) for m >= 0 then:

%C 1) A001227(n) is equal to number of ways to write 2n - 1 as (4*x + 2)*y + 4*x + 1 where x and y are nonnegative integers;

%C 2) A001227(n) is equal to number of distinct values of k if k/(2n-1) + 1 divides (k/(2n - 1))^(k/(2n - 1)) + k, (k/(2n - 1))^k + k/(2n - 1) and k^(k/(2n - 1)) + k/(2n - 1).

%H Robert Israel, <a href="/A273401/b273401.txt">Table of n, a(n) for n = 1..10000</a>

%e 5 and 6 have both two odd divisors: (1 and 5) and (1 and 3) respectively; so 5 is a term in the sequence.

%p A001227:= n -> numtheory:-tau(n)/(1+padic:-ordp(n,2)):

%p R:= map(A001227,[$1..1000]):

%p ListTools:-SearchAll(0,A001227[2..-1]-A001227[1..-2]); # _Robert Israel_, May 27 2016

%t Select[Range@ 221, First@ Differences@ Map[Count[Divisors@ #, _?OddQ] &, {#, # + 1}] == 0 &] (* _Michael De Vlieger_, Jun 26 2016 *)

%t SequencePosition[Table[Count[Divisors[n],_?OddQ],{n,250}],{x_,x_}] [[All, 1]] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Apr 06 2019 *)

%o (PARI) lista(nn) = for (n=1, nn, if (sumdiv(n, d, d%2) == sumdiv(n+1, d, d%2), print1(n, ", "))); \\ _Michel Marcus_, May 27 2016

%o (PARI) is(n)=numdiv(n>>valuation(n,2))==numdiv((n+1)>>valuation(n+1,2)) \\ _Charles R Greathouse IV_, Jul 15 2016

%Y Cf. A001227, A206581 (primes in a(n)).

%K nonn

%O 1,2

%A _Juri-Stepan Gerasimov_, May 26 2016