[go: up one dir, main page]

login
A352452
2^k appears in the binary expansion of a(n) iff 2^k appears in the binary expansion of n and k+1 does not divide n.
5
0, 0, 0, 2, 4, 4, 0, 6, 0, 8, 8, 10, 0, 12, 12, 10, 16, 16, 16, 18, 4, 16, 20, 22, 16, 8, 24, 26, 20, 28, 8, 30, 32, 32, 32, 34, 0, 36, 36, 34, 32, 40, 8, 42, 36, 40, 44, 46, 16, 48, 32, 50, 52, 52, 16, 38, 48, 56, 56, 58, 0, 60, 60, 58, 64, 64, 64, 66, 68, 64
OFFSET
0,4
COMMENTS
The idea is to keep the 1's in the binary expansion of a number whose positions are related in some way to that number.
FORMULA
a(n) <= n.
EXAMPLE
For n = 42:
- 42 = 2^5 + 2^3 + 2^1,
- 5+1 divides 42,
- 3+1 does not divide 42,
- 1+1 divides 42,
- so a(42) = 2^3 = 8.
PROG
(PARI) a(n) = { my (v=0, m=n, k); while (m, m-=2^k=valuation(m, 2); if (n%(k+1), v+=2^k)); v }
CROSSREFS
See A352449, A352450, A352451, A352458 for similar sequences.
Sequence in context: A176531 A198362 A197827 * A195479 A112793 A372037
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Mar 16 2022
STATUS
approved