OFFSET
1,1
COMMENTS
A heuristic argument suggests that, as n tends to infinity, a(n)/n converges to 4. - Stefan Steinerberger, May 17 2007
These numbers may be called primitive evil numbers because every evil number is a power of 2 multiplied by one of these numbers. Note that the difference between consecutive terms is either 2, 4, or 6. - T. D. Noe, Jun 06 2007
If m is in the sequence, then so is 2m-1 because in binary, m is x1 and 2m-1 is x01. Presumably the numbers that generate the whole sequence by application of n -> 2n-1 are the evil numbers times 4 plus 3. - Ralf Stephan, May 25 2013
LINKS
Francisco J. Muñoz, Table of n, a(n) for n = 1..10000 (first 1000 terms from T. D. Noe)
Francisco J. Muñoz and Juan Carlos Nuño, Rule-based Generation of de Bruijn Sequences: Memory and Learning, arXiv:2507.09764 [cs.FL], 2025. See p. 9.
FORMULA
a(n) = 2*A000069(n) + 1. a(n) is 1 plus twice odious numbers.
a(n) = A128309(n) + 1. a(n) is 1 plus odious even numbers.
a(n) = 4n + O(1). - Charles R Greathouse IV, Mar 21 2013
MATHEMATICA
Select[Range[300], OddQ[ # ] && EvenQ[DigitCount[ #, 2, 1]] &] (* Stefan Steinerberger, May 17 2007 *)
Select[Range[300], EvenQ[Plus @@ IntegerDigits[ #, 2]] && OddQ[ # ] &]
PROG
(PARI) is(n)=n%2 && hammingweight(n)%2==0 \\ Charles R Greathouse IV, Mar 21 2013
(PARI) a(n)=4*n-if(hammingweight(n-1)%2, 3, 1) \\ Charles R Greathouse IV, Mar 21 2013
(Python)
def A129771(n): return (((m:=n-1)<<1)+(m.bit_count()&1^1)<<1)+1 # Chai Wah Wu, Mar 09 2023
KEYWORD
nonn,easy,base
AUTHOR
Tanya Khovanova, May 16 2007
EXTENSIONS
More terms from Stefan Steinerberger, May 17 2007
STATUS
approved
