%I #20 May 28 2026 23:41:00
%S 2,5,8,14,19,25,32,48,54,62,73,83,91,121,142,184,204,216,244,285,299,
%T 323,339,359,389,401,411,423,449,471,479,491,512,532,548,578,622,632,
%U 664,692,710,778,788,800,812,830,844,868,898,920,958,1000,1022,1039,1051
%N Integers k such that p - k = floor(log_2(k)), where p is the smallest prime strictly greater than k.
%e For a(3) = 8: The smallest prime > 8 is 11. The distance to the next prime is 11 - 8 = 3. The base-2 scale is floor(log2(8)) = 3. Because the gap (3) equals the scale (3), 8 is included.
%e For a(7) = 32: The smallest prime > 32 is 37. The distance to the next prime is 37 - 32 = 5. The base-2 scale is floor(log2(32)) = 5. Because the gap (5) equals the scale (5), 32 is included.
%p q:= k-> nextprime(k)-k=ilog2(k):
%p select(q, [$1..1070])[]; # _Alois P. Heinz_, May 23 2026
%t Select[Range[1100], NextPrime[#] == # + Floor[Log2[#]] &] (* _Amiram Eldar_, May 22 2026 *)
%o (Python)
%o import math
%o import sympy
%o def generate_boundary_numbers(limit):
%o # These lines must be indented by 4 spaces
%o boundary_numbers = []
%o n = 2
%o while len(boundary_numbers) < limit:
%o # These lines are inside 'while', so they need 8 spaces
%o next_p = sympy.nextprime(n)
%o gap = next_p - n
%o scale = int(math.log2(n))
%o if gap == scale:
%o # This line is inside 'if', so it needs 12 spaces
%o boundary_numbers.append(n)
%o n += 1
%o return boundary_numbers
%o # This is outside the function, so it has 0 spaces
%o print(generate_boundary_numbers(50))
%o (PARI) isok(k) = nextprime(k+1) - k == log(k)\log(2); \\ _Michel Marcus_, May 21 2026
%Y Cf. A000040 (primes), A000523 (floor(log2)), A151800 (next prime), A396203, A396282.
%K nonn
%O 1,1
%A _Sajid Hussain_, May 21 2026