Skip to main content
edited body
Source Link
xnor
  • 149.7k
  • 26
  • 287
  • 676

Python 2, 32 bytes

[n<<n|1for n in range(2526)].count 

Try it online!Try it online!

Creates the list of Cullen numbers up to 10^9, then counts how many times the input appears in it. Thanks to Vincent for pointing out n<<n|1 instead of (n<<n)+1, saving 2 bytes.

Python 2, 32 bytes

[n<<n|1for n in range(25)].count 

Try it online!

Creates the list of Cullen numbers up to 10^9, then counts how many times the input appears in it. Thanks to Vincent for pointing out n<<n|1 instead of (n<<n)+1, saving 2 bytes.

Python 2, 32 bytes

[n<<n|1for n in range(26)].count 

Try it online!

Creates the list of Cullen numbers up to 10^9, then counts how many times the input appears in it. Thanks to Vincent for pointing out n<<n|1 instead of (n<<n)+1, saving 2 bytes.

added 82 characters in body
Source Link
xnor
  • 149.7k
  • 26
  • 287
  • 676

Python 2, 3432 bytes

[(n<<n)+1for[n<<n|1for n in range(25)].count 

Try it online!Try it online!

Creates the list of Cullen numbers up to 10^9, then counts how many times the input appears in it. Thanks to Vincent for pointing out n<<n|1 instead of (n<<n)+1, saving 2 bytes.

Python, 34 bytes

[(n<<n)+1for n in range(25)].count 

Try it online!

Creates the list of Cullen numbers up to 10^9, then counts how many times the input appears in it.

Python 2, 32 bytes

[n<<n|1for n in range(25)].count 

Try it online!

Creates the list of Cullen numbers up to 10^9, then counts how many times the input appears in it. Thanks to Vincent for pointing out n<<n|1 instead of (n<<n)+1, saving 2 bytes.

Source Link
xnor
  • 149.7k
  • 26
  • 287
  • 676

Python, 34 bytes

[(n<<n)+1for n in range(25)].count 

Try it online!

Creates the list of Cullen numbers up to 10^9, then counts how many times the input appears in it.