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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A268726 Index of the toggled bit between n and A268717(n+1): a(n) = A000523(A003987(n, A268717(1+n))). 4
0, 1, 2, 0, 3, 0, 0, 1, 4, 0, 0, 1, 0, 1, 2, 0, 5, 0, 0, 1, 0, 1, 2, 0, 0, 1, 2, 0, 3, 0, 0, 1, 6, 0, 0, 1, 0, 1, 2, 0, 0, 1, 2, 0, 3, 0, 0, 1, 0, 1, 2, 0, 3, 0, 0, 1, 4, 0, 0, 1, 0, 1, 2, 0, 7, 0, 0, 1, 0, 1, 2, 0, 0, 1, 2, 0, 3, 0, 0, 1, 0, 1, 2, 0, 3, 0, 0, 1, 4, 0, 0, 1, 0, 1, 2, 0, 0, 1, 2, 0, 3, 0, 0, 1, 4, 0, 0, 1, 0, 1, 2, 0, 5, 0, 0, 1, 0, 1, 2, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

A fractal sequence, because a permutation of A007814. Removing zeros yields A268727(n) = a(n)+1.

LINKS

Antti Karttunen, Table of n, a(n) for n = 0..16383

Indranil Ghosh, C program to generate the sequence

FORMULA

a(n) = A007814(1 + A006068(n)).

a(n) = A000523(A003987(n, A268717(1+n))).

a(n) = floor(log_2(n XOR A003188(1 + A006068(n)))).

Other identities:

For all n >= 1, a(A003188(n-1)) = A007814(n).

MATHEMATICA

A003188[n_]:=BitXor[n, Floor[n/2]]; A006068[n_]:=If[n<2, n, Block[{m=A006068[Floor[n/2]]}, 2m + Mod[Mod[n, 2] + Mod[m, 2], 2]]]; A268717[n_]:=If[n<1, 0, A003188[1 + A006068[n - 1]]]; a[n_]:= Floor[Log[2, BitXor[n, A268717[n + 1]]]]; Table[a[n], {n, 0, 200}] (* Indranil Ghosh, Apr 02 2017 *)

PROG

(Scheme) (define (A268726 n) (A000523 (A003987bi n (A268717 (+ 1 n))))) ;; A003987bi implements the bitwise-XOR, defined in A003987.

(PARI) A003188(n) = bitxor(n, n\2);

A006068(n) = if(n<2, n, {my(m = A006068(n\2)); 2*m + (n%2 + m%2)%2});

A268717(n) = if(n<1, 0, A003188(1 + A006068(n - 1)));

for(n=0, 200, print1(logint(bitxor(n, A268717(n + 1)), 2), ", "))  \\ Indranil Ghosh, Apr 02 2017

(Python)

def A003188(n): return n^(n/2)

def A006068(n):

....if n<2: return n

....else:

........m=A006068(n/2)

........return 2*m + (n%2 + m%2)%2

def A268717(n): return 0 if n<1 else A003188(1 + A006068(n - 1))

print [int(math.floor(math.log(n^A268717(n + 1), 2))) for n in xrange(0, 201)] # Indranil Ghosh, Apr 02 2017

CROSSREFS

One less than A268727.

Cf. A003188, A006068.

Cf. A000523, A003987, A007814, A101080, A268717.

Cf. also array A268833.

Sequence in context: A234579 A109362 A085246 * A035182 A280720 A245964

Adjacent sequences:  A268723 A268724 A268725 * A268727 A268728 A268729

KEYWORD

nonn,base

AUTHOR

Antti Karttunen, Feb 13 2016

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 26 10:18 EDT 2019. Contains 321491 sequences. (Running on oeis4.)