login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A337582 Numbers m such that m AND (m*2^k) is zero or a power of 2 for any k > 0 (where AND denotes the bitwise AND operator). 1
0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 22, 24, 25, 26, 32, 33, 34, 35, 36, 37, 38, 40, 41, 44, 48, 49, 50, 52, 64, 65, 66, 67, 68, 69, 70, 72, 74, 76, 80, 81, 82, 83, 88, 96, 97, 98, 100, 101, 104, 128, 129, 130, 131, 132, 133, 134, 136 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
For any k > 0, there are A308251(k-1) positive terms with k binary digits.
The ones in the binary representation of any term encodes a finite set of nonnegative integers, say S, such that the differences between any two distinct elements of S are all unique.
For any m >= 0, m belongs to the sequence iff 2*m belongs to the sequence.
LINKS
EXAMPLE
Regarding 7:
- 7 AND 14 = 6, which is neither 0 nor a power of 2,
- so 7 does not belong to the sequence.
Regarding 13:
- we have the following values:
k 13 AND (13*2^k)
--- ---------------
1 2^3
2 2^2
3 2^3
>=4 0
- so 13 belongs to the sequence.
PROG
(PARI) is(n) = { my (m=n); while (m>>=1, if (hammingweight(bitand(m, n))>1, return (0))); return (1) }
CROSSREFS
Cf. A308251.
Sequence in context: A247063 A003726 A343110 * A004828 A032895 A032854
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Sep 20 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 01:06 EDT 2024. Contains 371964 sequences. (Running on oeis4.)