25
0
A Cullen Number is any number that is contained in the sequence generated using the formula:
C(n) = (n*2^n)+1.
Your Task:
Write a program or function that receives an input and outputs a truthy/falsy value based on whether the input is a Cullen Number.
Input:
A non-negative integer between 0 and 10^9 (inclusive).
Output:
A truthy/falsy value that indicates whether the input is a Cullen Number.
Test Cases:
Input: Output:
1 ---> truthy
3 ---> truthy
5 ---> falsy
9 ---> truthy
12 ---> falsy
25 ---> truthy
Scoring:
This is code-golf, so the lowest score in bytes wins.
1What's the range of n? In particular, is 1 a Cullen Number? – None – 2017-06-17T20:15:58.903
3
@ais523 according to OEIS, it is.
– steenbergh – 2017-06-17T20:25:16.287n
seems to be 0-based.Fair enough. Just needed to know whether my Jelly answer should have an
Ḷ
orR
in it :-) – None – 2017-06-17T20:25:55.4472Related – James – 2017-06-17T20:36:53.860
Umm, what's with the downvote? – Gryphon – 2017-06-20T13:47:15.620