A190620 Odd numbers with a single zero in their binary expansion.
5, 11, 13, 23, 27, 29, 47, 55, 59, 61, 95, 111, 119, 123, 125, 191, 223, 239, 247, 251, 253, 383, 447, 479, 495, 503, 507, 509, 767, 895, 959, 991, 1007, 1015, 1019, 1021, 1535, 1791, 1919, 1983, 2015, 2031, 2039, 2043, 2045, 3071, 3583, 3839, 3967, 4031
Offset: 1
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Haskell
import Data.List (elemIndices) a190620 n = a190620_list !! (n-1) a190620_list = filter odd $ elemIndices 1 a023416_list -- A more efficient version, inspired by the Maple program in A190619: a190620_list' = g 8 2 where g m 2 = (m - 3) : g (2*m) (m `div` 2) g m k = (m - k - 1) : g m (k `div` 2)
-
Maple
isA := proc(n) convert(n, base, 2): %[1] = nops(%) - add(%) end: select(isA, [$1..4031]); # Peter Luschny, Oct 27 2022 # Alternatively, using a formula of Bernard Schott and A123578: A190620 := proc(n) A123578(n); 4*2^% - 2^(1 - n + (% + %^2)/2) - 1 end: seq(A190620(n), n = 1..50); # Peter Luschny, Oct 28 2022
-
Mathematica
Select[Range[1,5001,2],DigitCount[#,2,0]==1&] (* Harvey P. Dale, Jul 12 2018 *)
-
Python
from itertools import count, islice def agen(): for d in count(3): b = 1 << d for i in range(2, d): yield b - (b >> i) - 1 print(list(islice(agen(), 50))) # Michael S. Branicky, Oct 13 2022
-
Python
from math import isqrt, comb def A190620(n): return (1<<(a:=(isqrt(n<<3)+1>>1)+1)+1)-(1<
Chai Wah Wu, Dec 18 2024
Formula
A023416(a(n)) = 1.
From Bernard Schott, Oct 21 2022: (Start)
a((n-1)*(n-2)/2 - (i-1)) = 2^n - 2^i - 1 for n >= 3 and 1 <= i <= n-2 (after Robert Israel in A357773).
a(n) = 4*2^k(n) - 2^(1 - n + (k(n) + k(n)^2)/2) - 1, where k is the Kruskal-Macaulay function A123578.
Comments