login
The OEIS is supported by the many generous donors to the OEIS 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

%I #17 May 09 2021 07:54:52

%S 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,

%T 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,

%U 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

%N Main diagonal of arrays A268833 & A268834: a(n) = A101080(n, A268820(n, 2*n)).

%H Antti Karttunen, <a href="/A268835/b268835.txt">Table of n, a(n) for n = 0..1024</a>

%H Indranil Ghosh, <a href="/A268835/a268835.txt">C program to generate the sequence</a>

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

%t 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 *)

%o (Scheme)

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

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

%o (PARI)

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

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

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

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

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

%o for(n=0, 300, print1(A101080(n, A268820(n, 2*n)),", ")) \\ _Indranil Ghosh_, Apr 02 2017

%o (Python)

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

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

%o def A006068(n):

%o if n<2: return n

%o else:

%o m=A006068(n//2)

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

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

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

%o print([A101080(n, A268820(n, 2*n)) for n in range(301)]) # _Indranil Ghosh_, Apr 02 2017

%Y Cf. A101080, A268820, A268833, A268834.

%K nonn

%O 0,3

%A _Antti Karttunen_, Feb 15 2016

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 13:27 EDT 2024. Contains 371780 sequences. (Running on oeis4.)