login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A295897
Numbers in whose binary expansion there are no 1-runs of odd length followed by a 0 to their right.
2
0, 1, 3, 6, 7, 12, 13, 15, 24, 25, 27, 30, 31, 48, 49, 51, 54, 55, 60, 61, 63, 96, 97, 99, 102, 103, 108, 109, 111, 120, 121, 123, 126, 127, 192, 193, 195, 198, 199, 204, 205, 207, 216, 217, 219, 222, 223, 240, 241, 243, 246, 247, 252, 253, 255, 384, 385, 387, 390, 391, 396, 397, 399, 408, 409, 411, 414, 415, 432
OFFSET
1,3
COMMENTS
No runs of 1-bits of odd length allowed in the binary expansion of n (A007088), except that when n is an odd number, then the rightmost run may have an odd length. Subsequence A277335 does not allow that exception.
A005940(1+a(n)) yields a permutation of A028982, squares and twice squares.
Running maximum without repetition of the decimal equivalent of Gray code for n (A003188). - Frédéric Nouvier, Aug 14 2020
FORMULA
a(n) = A003714(n-1) XOR ( A003714(n-1) >> 1 ). - Frédéric Nouvier, Aug 14 2020
PROG
(Scheme, with Antti Karttunen's IntSeq-library)
(define A295897 (NONZERO-POS 1 0 A295896))
(Rust)
fn main() {
for i in (0..2048)
// Filter to get A003714
.filter(|n| n & (n << 1) == 0)
// Map to produce A295897
.map(|n| n ^ (n >> 1))
{
println!("{}", i);
}
} // Frédéric Nouvier, Aug 14 2020
(Python)
[x ^ (x>>1) for x in range(0, 2048) if (x & (x<<1) == 0)]
# Frédéric Nouvier, Aug 14 2020
CROSSREFS
Subsequence of A004760.
Cf. A277335 (a subsequence).
Cf. A295896 (characteristic function).
Sequence in context: A325430 A104463 A072757 * A032849 A038591 A333794
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Dec 01 2017
STATUS
approved