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.
n
seems to be 0-based. \$\endgroup\$Ḷ
orR
in it :-) \$\endgroup\$