Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A163575
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A163575 The changepoint a(n) is the first predecessor from n in a binary tree with: a(n) mod 2 <> n mod 2 +0
1
0, 1, 0, 1, 2, 3, 0, 1, 4, 5, 2, 3, 6, 7, 0, 1, 8, 9, 4, 5, 10, 11, 2, 3, 12, 13, 6, 7, 14, 15, 0, 1, 16, 17, 8, 9, 18, 19, 4, 5, 20, 21, 10, 11, 22, 23, 2, 3, 24, 25, 12, 13, 26, 27, 6, 7, 28, 29, 14, 15, 30, 31, 0, 1, 32, 33, 16, 17, 34, 35, 8, 9, 36, 37, 18, 19, 38, 39, 4, 5, 40, 41, 20 (list; graph; listen)
OFFSET

1,5

COMMENT

In a binary tree (node(row,col)=2^(row-1)+(col-1))

__________1________

_____2________3____

____4_5______6_7___

. . . . . . . . . .

has any node 2 successors and one predecessor. a(n) ist the first

predecessor from n (going back, step by step) with another last digit (in binary sight) as n.

the subsequences from a(2^k) to a(2^(k+1) - 1) are permutations from the

natural numbers from 0 to 2^k-1

LINKS

Wikipedia, Calkin Wilf Tree

Wikipedia, Stern Brocot Tree

EXAMPLE

A(7) = A(b111) = b0 = 0

A(17) = A(b10001) = b1000 = 8

A(8) = A(b1000) = b1 = 1

PROGRAM

(Other) FUNCTION CHANGEPOINT

INPUT n

IF EVEN(n)

..WHILE EVEN(n)

....n = n/2

ELSE

..WHILE NOT EVEN(n)

....n = (n-1)/2

OUTPUT n

CROSSREFS

Sequence in context: A143325 A128888 A168068 this_sequence A163465 A004443 A171616

Adjacent sequences: A163572 A163573 A163574 this_sequence A163576 A163577 A163578

KEYWORD

nonn

AUTHOR

Helmut Kreindl (euler(AT)chello.at), Jul 31 2009

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 20 16:54 EST 2009. Contains 171081 sequences.


AT&T Labs Research