login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) = n+1 minus the greatest number of 1's in the binary representations of primes between 2^n and 2^(n+1).
2

%I #13 Mar 05 2020 22:52:04

%S 0,0,1,0,1,0,1,1,1,1,1,0,1,2,1,0,1,0,1,1,1,2,1,1,1,2,1,1,1,0,1,1,1,1,

%T 1,2,1,2,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,2,1,1,2,1,1,0,1,2,1,1,1,1,1,1,

%U 1,2,1,1,1,1,1,1,1,2,1,1,2,1,1,1,1,1,1,0,1,2,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1

%N a(n) = n+1 minus the greatest number of 1's in the binary representations of primes between 2^n and 2^(n+1).

%C 0's occur only at Mersenne prime exponents (A000043) - 1, twos are in A092112, threes do not appear < 504.

%C a(n) <= 2 for n <= 2000. - _Robert Israel_, Mar 05 2020

%H Robert Israel, <a href="/A092111/b092111.txt">Table of n, a(n) for n = 1..2000</a>

%F a(n) = n+1 - A091937(n).

%p f:= proc(n) local t,j,k;

%p t:= 2^(n+1)-1;

%p if isprime(t) then return 0 fi;

%p for j from 1 to n-1 do if isprime(t-2^j) then return 1 fi od;

%p for j from 1 to n-2 do for k from j+1 to n-1 do

%p if isprime(t-2^j-2^k) then return 2 fi od od;

%p FAIL

%p end proc:

%p map(f, [$1..200]); # _Robert Israel_, Mar 05 2020

%t Compute the second line of the Mathematica code for A091938, then (Table[n + 1, {n, 105}]) - (Count[ IntegerDigits[ #, 2], 1] & /@ Table[ f[n], {n, 105}])

%Y Cf. A091938, A092112.

%K nonn

%O 1,14

%A _Robert G. Wilson v_, Feb 20 2004