OFFSET

1,2

COMMENTS

The binary code is the same as used by function general-car-cdr of MIT/GNU Scheme: a zero bit represents a cdr operation (taking the right hand side branch in the binary tree), and a one bit represents a car (taking the left hand side branch in the binary tree). The bits are interpreted from LSB to MSB, and the most significant one bit, rather than being interpreted as an operation, signals the end of the binary code.

LINKS

A. Karttunen, Table of n, a(n) for n = 1..1024

MIT/GNU Scheme 9.1. documentation, Function general-car-cdr

FORMULA

EXAMPLE

As we must traverse to 4 in A218778-tree (see the example there) by first taking the left branch (car) from the root, resulting bit 1 as the least significant bit of the code, then by taking the right branch (cdr) from 3 to get to 4, resulting bit 0 as the second rightmost bit of the code, which when capped with an extra termination-one, results binary code 101, 5 in decimal, thus a(4)=5.

PROG

CROSSREFS

KEYWORD

nonn,base

AUTHOR

Antti Karttunen, Nov 16 2012

STATUS

approved