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!)
A228087 a(n) = largest k which satisfies n = k + bitcount(k), or 0 if no such k exists. Here bitcount(k) (A000120) gives the number of 1's in binary representation of nonnegative integer k. 9
0, 0, 1, 2, 0, 4, 0, 5, 6, 8, 7, 9, 10, 0, 12, 0, 13, 16, 0, 17, 18, 0, 20, 0, 21, 22, 24, 23, 25, 26, 0, 28, 0, 32, 30, 33, 34, 0, 36, 0, 37, 38, 40, 39, 41, 42, 0, 44, 0, 45, 48, 0, 49, 50, 0, 52, 0, 53, 54, 56, 55, 57, 58, 0, 60, 64, 61, 65, 66, 63, 68, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
COMMENTS
A083058(n)+1 gives a lower bound for nonzero terms, n-1 an upper bound.
LINKS
PROG
(Scheme) (define (A228087 n) (let loop ((k n)) (cond ((<= k (A083058 n)) 0) ((= n (A092391 k)) k) (else (loop (- k 1))))))
CROSSREFS
Cf. A228086, A228085. A010061 gives the positions of zeros after a(0). The union of A010061 and A228088 gives the positions where a(n) = A228086(n).
Cf. also A213724, A227643.
Sequence in context: A225437 A065806 A331185 * A320582 A119690 A166260
KEYWORD
nonn
AUTHOR
Antti Karttunen, Aug 09 2013
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 23 22:36 EDT 2024. Contains 371917 sequences. (Running on oeis4.)