The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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
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
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(301)]) # Indranil Ghosh, Apr 02 2017
CROSSREFS
Sequence in context: A086520 A012265 A339765 * A006641 A191408 A115756
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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 13 12:32 EDT 2024. Contains 372519 sequences. (Running on oeis4.)