cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A126308 Delete '10'-substrings in the binary expansion of n.

Original entry on oeis.org

0, 1, 0, 3, 0, 1, 1, 7, 0, 1, 0, 3, 2, 3, 3, 15, 0, 1, 0, 3, 0, 1, 1, 7, 4, 5, 1, 7, 6, 7, 7, 31, 0, 1, 0, 3, 0, 1, 1, 7, 0, 1, 0, 3, 2, 3, 3, 15, 8, 9, 2, 11, 2, 3, 3, 15, 12, 13, 3, 15, 14, 15, 15, 63, 0, 1, 0, 3, 0, 1, 1, 7, 0, 1, 0, 3, 2, 3, 3, 15, 0, 1, 0, 3, 0, 1, 1, 7, 4, 5, 1, 7, 6, 7, 7, 31
Offset: 0

Views

Author

Antti Karttunen, Jan 02 2007

Keywords

Examples

			10 is 1010 in binary, thus it is rewritten to empty string, thus a(10)=0. 12 is 1100 in binary, thus it is rewritten to '10', so a(12)=2. 27 is 11011 in binary and when '10' is deleted, results 111, 7 in decimal, thus a(27)=7.
		

Crossrefs

Programs

  • Scheme
    (define (A126308 n) (cond ((zero? n) 0) ((= 2 (modulo n 4)) (A126308 (/ (- n 2) 4))) (else (+ (modulo n 2) (* 2 (A126308 (floor->exact (/ n 2))))))))