login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A268835 Main diagonal of arrays A268833 & A268834: a(n) = A101080(n, A268820(n, 2*n)). 2
0, 1, 2, 1, 2, 3, 2, 3, 2, 3, 4, 5, 2, 1, 4, 3, 2, 3, 4, 5, 4, 3, 6, 5, 2, 3, 2, 1, 4, 5, 4, 3, 2, 3, 4, 5, 4, 3, 6, 5, 4, 5, 4, 3, 6, 7, 6, 5, 2, 3, 4, 3, 2, 3, 2, 3, 4, 5, 6, 5, 4, 3, 4, 3, 2, 3, 4, 5, 4, 3, 6, 5, 4, 5, 4, 3, 6, 7, 6, 5, 4, 5, 6, 5, 4, 5, 4, 5, 6, 7, 8, 7, 6, 5, 6, 5, 2, 3, 4, 3, 4, 5, 4, 5, 2, 3, 4, 5, 2, 1, 4, 3, 4, 5, 6, 5, 6, 5, 6, 5, 4 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

LINKS

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

Indranil Ghosh, C program to generate the sequence

FORMULA

a(n) = A101080(n, A268820(n, 2*n)).

MATHEMATICA

A101080[n_, k_]:= DigitCount[BitXor[n, k], 2, 1]; 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]]]; a[r_, 0]:= 0; a[0, c_]:=c; a[r_, c_]:= A003188[1 + A006068[a[r - 1, c - 1]]]; Flatten@ Table[A101080[n, a[n, 2n]], {n, 0, 300}] (* Indranil Ghosh, Apr 02 2017 *)

PROG

(Scheme)

(define (A268835 n) (A101080bi n (A268820bi n (* 2 n))))

(define (A268835 n) (A268833bi n n)) ;; Code for A268833bi given in A268833.

(PARI)

b(n) = if(n<1, 0, b(n\2) + n%2);

A101080(n, k) = b(bitxor(n, k));

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

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

A268820(r, c) = if(r==0, c, if(c==0, 0, A003188(1 + A006068(A268820(r - 1, c - 1)))));

for(n=0, 300, print1(A101080(n, A268820(n, 2*n)), ", ")) \\ Indranil Ghosh, Apr 02 2017

(Python)

def A101080(n, k): return bin(n^k)[2:].count("1")

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))

def A268820(r, c): return c if r<1 else 0 if c<1 else A003188(1 + A006068(A268820(r - 1, c - 1)))

print [A101080(n, A268820(n, 2*n)) for n in range(0, 301)] # Indranil Ghosh, Apr 02 2017

CROSSREFS

Cf. A101080, A268820, A268833, A268834.

Sequence in context: A258594 A086520 A012265 * A006641 A191408 A115756

Adjacent sequences:  A268832 A268833 A268834 * A268836 A268837 A268838

KEYWORD

nonn

AUTHOR

Antti Karttunen, Feb 15 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 July 5 08:02 EDT 2020. Contains 335464 sequences. (Running on oeis4.)