[go: up one dir, main page]

login
A256999
a(n)=n for n <= 1; for n >= 2, a(n) = largest number that can be obtained by rotating non-msb bits of binary expansion of n (with A080541 or A080542).
11
0, 1, 2, 3, 4, 6, 6, 7, 8, 12, 12, 14, 12, 14, 14, 15, 16, 24, 24, 28, 24, 26, 28, 30, 24, 28, 26, 30, 28, 30, 30, 31, 32, 48, 48, 56, 48, 52, 56, 60, 48, 52, 52, 58, 56, 58, 60, 62, 48, 56, 52, 60, 52, 58, 58, 62, 56, 60, 58, 62, 60, 62, 62, 63, 64, 96, 96, 112, 96, 104, 112, 120, 96, 100, 104, 114, 112, 116, 120, 124, 96, 104, 100
OFFSET
0,3
LINKS
PROG
(Scheme, two variants)
(define (A256999 n) (let loop ((k (A080541 n)) (m n)) (cond ((= k n) m) (else (loop (A080541 k) (max m k))))))
(define (A256999 n) (let loop ((k (A080542 n)) (m n)) (cond ((= k n) m) (else (loop (A080542 k) (max m k))))))
CROSSREFS
Cf. A257250 (fixed points of this sequence).
Cf. also A163380 (analogous sequence when rotating all bits of binary representation).
Sequence in context: A163380 A233569 A246593 * A331857 A073138 A342179
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, May 16 2015
STATUS
approved