Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A072650
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A072650 Starting from the right (the least significant end) rewrite 0 to 0 and x1 to 1 in the binary expansion of n. +0
2
0, 1, 2, 1, 4, 3, 2, 3, 8, 5, 6, 5, 4, 3, 6, 3, 16, 9, 10, 9, 12, 7, 10, 7, 8, 5, 6, 5, 12, 7, 6, 7, 32, 17, 18, 17, 20, 11, 18, 11, 24, 13, 14, 13, 20, 11, 14, 11, 16, 9, 10, 9, 12, 7, 10, 7, 24, 13, 14, 13, 12, 7, 14, 7, 64, 33, 34, 33, 36, 19, 34, 19, 40, 21, 22, 21, 36, 19, 22, 19 (list; graph; listen)
OFFSET

0,3

EXAMPLE

I.e. 23 is 10111 in binary, which after rewriting is 111, thus a(23) = 7, while 38 is 100110 in binary, which after the rewriting is 10010, i.e. a(38) = 18.

PROGRAM

(MIT Scheme) (define (A072650 n) (let loop ((n n) (s 0) (i 0)) (cond ((zero? n) s) ((even? n) (loop (floor->exact (/ n 2)) s (1+ i))) (else (loop (floor->exact (/ n 4)) (+ s (expt 2 i)) (1+ i))))))

CROSSREFS

Cf. A048679(n) = A072650(A003714(n)).

Sequence in context: A082467 A106407 A023141 this_sequence A082497 A065620 A104895

Adjacent sequences: A072647 A072648 A072649 this_sequence A072651 A072652 A072653

KEYWORD

nonn

AUTHOR

Antti Karttunen Jun 02 2002

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified December 16 17:18 EST 2009. Contains 170825 sequences.


AT&T Labs Research