[go: up one dir, main page]

login
A340375
a(n) = 1 if n is of the form 2^i - 2^j with i >= j, and 0 otherwise.
4
1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1
OFFSET
0
FORMULA
a(0) = 1; for n > 1, a(n) = A209229(1+A000265(n)).
PROG
(PARI)
A000265(n) = (n>>valuation(n, 2));
A209229(n) = (n && !bitand(n, n-1));
A340375(n) = if(!n, 1, A209229(1+A000265(n)));
(PARI) A340375(n) = if(n<5, 1, n>>=valuation(n, 2); n++; n>>valuation(n, 2)==1); \\ From standalone function "is" given in A023758
CROSSREFS
Characteristic function of A023758.
Sequence in context: A221641 A144473 A011750 * A010055 A324290 A325964
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jan 06 2021
STATUS
approved