login
A359708
a(n) is the greatest divisor d of 2*n such that the binary expansions of d and 2*n have no common 1-bit.
1
1, 2, 1, 4, 5, 3, 1, 8, 9, 10, 1, 6, 1, 2, 1, 16, 17, 18, 1, 20, 21, 2, 1, 12, 5, 2, 9, 7, 1, 3, 1, 32, 33, 34, 1, 36, 37, 19, 1, 40, 41, 42, 1, 4, 5, 2, 1, 24, 1, 25, 17, 4, 1, 18, 1, 14, 1, 2, 1, 6, 1, 2, 1, 64, 65, 66, 1, 68, 69, 35, 1, 72, 73, 74, 1, 38, 1
OFFSET
1,2
COMMENTS
Odd numbers share a 1-bit (2^0) with all their divisors, hence this sequence deals with even numbers.
FORMULA
a(n) = n iff n belongs to A003714.
EXAMPLE
For n = 12:
- we have (with AND denoting the bitwise AND operator):
d d AND 24
-- --------
1 0
2 0
3 0
4 0
6 0
8 8
12 8
24 24
- hence a(12) = 6.
PROG
(PARI) a(n) = fordiv (n, d, if (bitand(n/d, 2*n)==0, return (n/d)))
CROSSREFS
Sequence in context: A125751 A210860 A099492 * A144203 A354699 A239806
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jan 12 2023
STATUS
approved