login

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

a(n) = n-th prime minus (number of bits in binary expansion of n-th prime).
2

%I #14 Dec 18 2016 01:35:48

%S 0,1,2,4,7,9,12,14,18,24,26,31,35,37,41,47,53,55,60,64,66,72,76,82,90,

%T 94,96,100,102,106,120,123,129,131,141,143,149,155,159,165,171,173,

%U 183,185,189,191,203,215,219,221,225,231,233,243,248,254,260,262,268,272

%N a(n) = n-th prime minus (number of bits in binary expansion of n-th prime).

%C Number of bits in binary expansion of n-th prime = A035100.

%H G. C. Greubel, <a href="/A163293/b163293.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = A000040(n) - A035100(n).

%e a(6) = 13 - 4 = 9;

%e a(7) = 17 - 5 = 12.

%p A000040 := proc(n) ithprime(n) ; end: A035100 := proc(n) max(1,ilog2(A000040(n))+1) ; end: A163293 := proc(n) A000040(n)-A035100(n) ; end: seq(A163293(n),n=1..100) ; # _R. J. Mathar_, Jul 26 2009

%t Table[Prime[n] - Length[IntegerDigits[Prime[n], 2]], {n, 100}] (* _G. C. Greubel_, Dec 17 2016 *)

%o (PARI) for(n=1,60, p=prime(n); print1(p-#binary(p),", ")) \\ _Washington Bomfim_ Jan 18 2011

%Y Cf. A000040, A035100.

%K nonn,base,easy

%O 1,3

%A _Juri-Stepan Gerasimov_, Jul 24 2009