Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A063946
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A063946 Write n in binary and complement second bit (from the left), with a(0)=0 and a(1)=1. +0
1
0, 1, 3, 2, 6, 7, 4, 5, 12, 13, 14, 15, 8, 9, 10, 11, 24, 25, 26, 27, 28, 29, 30, 31, 16, 17, 18, 19, 20, 21, 22, 23, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 96, 97, 98, 99, 100, 101, 102 (list; graph; listen)
OFFSET

0,3

FORMULA

If 2*2^k<=n<3*2^k then a(n)=n+2^k; if 3*2^k<=n<4*2^k then a(n)=n-2^k.

a(0)=0, a(1)=1, a(2)=3, a(3) = 2, a(2n) = 2a(n), a(2n+1) = 2a(n) + 1. - Ralf Stephan (ralf(AT)ark.in-berlin.de), Aug 23 2003

EXAMPLE

a(11)=15 since 11 is written in binary as 1011 which changes to 1111 i.e. 15; a(12)=8 since 12 is written as 1100 which changes to 1000 i.e. 8.

PROGRAM

(PARI) a(n)=if(n<2, n>0, 3/2*2^floor(log(n)/log(2))-2^floor(log(4/3*n)/log(2))+n) (from R. Stephan)

CROSSREFS

Cf. A004442, A053645, A054429.

Sequence in context: A125764 A023897 A100527 this_sequence A120231 A083362 A003188

Adjacent sequences: A063943 A063944 A063945 this_sequence A063947 A063948 A063949

KEYWORD

easy,nonn

AUTHOR

Henry Bottomley (se16(AT)btinternet.com), Sep 03 2001

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 July 25 07:41 EDT 2008. Contains 142293 sequences.


AT&T Labs Research