login
A162719
A positive integer n is included if n in binary contains as many 0's as the number of 1's in the binary representation of n+1, and if n in binary contains as many 1's as the number of 0's in the binary representation of n+1.
1
4, 9, 18, 19, 20, 24, 37, 39, 41, 49, 70, 74, 75, 76, 79, 82, 83, 84, 88, 98, 99, 100, 104, 112, 141, 149, 151, 153, 159, 165, 167, 169, 177, 197, 199, 201, 209, 225, 270, 278, 282, 283, 284, 294, 298, 299, 300, 303, 306, 307, 308, 312, 319, 326, 330, 331, 332
OFFSET
1,1
LINKS
EXAMPLE
39 in binary is 100111, which has two 0's and four 1's. 39+1 = 40 is 101000 in binary, which contains two 1's and four 0's. Since the number of 0's in binary 39 equals the number of 1's in binary 40, and because the number of 1's in binary 39 equals the number of 0's in binary 40, then 39 is in the sequence.
MAPLE
read("transforms") ; A070939 := proc(n) max(1, ilog2(n)+1) ; end: A023416 := proc(n) A070939(n)-wt(n) ; end: isA162719 := proc(n) RETURN( A023416(n) = wt(n+1) and wt(n) = A023416(n+1)) ; end: for n from 1 to 999 do if isA162719(n) then printf("%d, ", n) ; end if; end do: # R. J. Mathar, Aug 01 2009
MATHEMATICA
Select[Range[400], DigitCount[#, 2, 0]==DigitCount[#+1, 2, 1]&&DigitCount[#, 2, 1]==DigitCount[#+1, 2, 0]&] (* Harvey P. Dale, Nov 02 2024 *)
CROSSREFS
Sequence in context: A088365 A139468 A127081 * A352997 A313357 A313358
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Jul 11 2009
EXTENSIONS
Extended beyond a(8) by R. J. Mathar, Aug 01 2009
STATUS
approved