login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A153152 Rotated binary incrementing: For n<2 a(n)=n, if n=(2^k)-1, a(n)=(n+1)/2, otherwise a(n)=n+1. 4

%I

%S 0,1,3,2,5,6,7,4,9,10,11,12,13,14,15,8,17,18,19,20,21,22,23,24,25,26,

%T 27,28,29,30,31,16,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,

%U 50,51,52,53,54,55,56,57,58,59,60,61,62,63,32,65,66,67,68,69,70,71,72

%N Rotated binary incrementing: For n<2 a(n)=n, if n=(2^k)-1, a(n)=(n+1)/2, otherwise a(n)=n+1.

%H A. Karttunen, <a href="/A153152/b153152.txt">Table of n, a(n) for n = 0..2047</a>

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>

%o (MIT Scheme:) (define (A153152 n) (cond ((< n 2) n) ((pow2? (1+ n)) (/ (1+ n) 2)) (else (1+ n))))

%o (define (pow2? n) (and (> n 0) (zero? (A004198bi n (- n 1)))))

%Y Inverse: A153151. a(n) = A059893(A153142(A059893(n))) = A059894(A153141(A059894(n))).

%K nonn,base

%O 0,3

%A _Antti Karttunen_, Dec 20 2008

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified May 19 11:46 EDT 2013. Contains 225429 sequences.