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!)
A268834 Transpose of array A268833. 3
0, 1, 0, 2, 1, 0, 1, 2, 1, 0, 2, 3, 2, 1, 0, 3, 2, 3, 2, 1, 0, 2, 1, 2, 1, 2, 1, 0, 1, 2, 3, 2, 3, 2, 1, 0, 2, 3, 4, 3, 2, 1, 2, 1, 0, 3, 2, 3, 4, 3, 2, 1, 2, 1, 0, 4, 3, 2, 3, 4, 3, 2, 3, 2, 1, 0, 3, 4, 1, 2, 3, 4, 3, 2, 3, 2, 1, 0, 2, 3, 2, 3, 2, 3, 2, 1, 2, 1, 2, 1, 0, 3, 2, 3, 2, 3, 2, 1, 2, 3, 2, 1, 2, 1, 0, 2, 1, 2, 1, 4, 3, 2, 3, 4, 3, 2, 3, 2, 1, 0 (list; table; graph; refs; listen; history; text; internal format)
OFFSET

0,4

COMMENTS

See comments in A268833.

LINKS

Antti Karttunen, Table of n, a(n) for n = 0..8255; the first 128 antidiagonals of array

EXAMPLE

The top left [0 .. 16] x [0 .. 16] section of the array:

  0, 1, 2, 1, 2, 3, 2, 1, 2, 3, 4, 3, 2, 3, 2, 1, 2

  0, 1, 2, 3, 2, 1, 2, 3, 2, 3, 4, 3, 2, 1, 2, 3, 2

  0, 1, 2, 3, 2, 3, 4, 3, 2, 1, 2, 3, 2, 3, 4, 3, 2

  0, 1, 2, 1, 2, 3, 4, 3, 2, 3, 2, 1, 2, 3, 4, 3, 2

  0, 1, 2, 3, 2, 3, 4, 3, 2, 3, 4, 5, 4, 3, 4, 3, 2

  0, 1, 2, 1, 2, 3, 4, 3, 2, 3, 4, 3, 4, 5, 4, 3, 2

  0, 1, 2, 1, 2, 3, 2, 1, 2, 3, 4, 3, 4, 5, 4, 3, 2

  0, 1, 2, 3, 2, 1, 2, 3, 2, 3, 4, 5, 4, 3, 4, 3, 2

  0, 1, 2, 3, 2, 3, 4, 3, 2, 3, 4, 5, 4, 3, 4, 3, 2

  0, 1, 2, 1, 2, 3, 4, 3, 2, 3, 4, 3, 4, 5, 4, 3, 2

  0, 1, 2, 1, 2, 3, 2, 1, 2, 3, 4, 3, 4, 5, 4, 3, 2

  0, 1, 2, 3, 2, 1, 2, 3, 2, 3, 4, 5, 4, 3, 4, 3, 2

  0, 1, 2, 1, 2, 3, 2, 1, 2, 3, 4, 3, 2, 3, 2, 1, 2

  0, 1, 2, 3, 2, 1, 2, 3, 2, 3, 4, 3, 2, 1, 2, 3, 2

  0, 1, 2, 3, 2, 3, 4, 3, 2, 1, 2, 3, 2, 3, 4, 3, 2

  0, 1, 2, 1, 2, 3, 4, 3, 2, 3, 2, 1, 2, 3, 4, 3, 2

  0, 1, 2, 3, 2, 3, 4, 3, 2, 3, 4, 5, 4, 3, 4, 3, 2

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]]]; A[r_, c_]:=A101080[c, a[r, r + c]]; Table[A[r - c, c], {r, 0, 20}, {c, 0, r}] // Flatten (* Indranil Ghosh, Apr 02 2017 *)

PROG

(Scheme)

(define (A268834 n) (A268833bi (A025581 n) (A002262 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)))));

A(r, c) = A101080(c, A268820(r, r + c));

for(r=0, 20, for(c=0, r, print1(A(r - c, c), ", "); ); print(); ) \\ 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 A268820(r, c): return c if r<1 else 0 if c<1 else A003188(1 + A006068(A268820(r - 1, c - 1)))

def a(r, c): return A101080(c, A268820(r, r + c))

for r in range(0, 21):

....print [a(r - c, c) for c in range(0, r + 1)] # Indranil Ghosh, Apr 02 2017

CROSSREFS

Transpose of A268833.

Sequence in context: A025870 A104276 A216191 * A285914 A096875 A194514

Adjacent sequences:  A268831 A268832 A268833 * A268835 A268836 A268837

KEYWORD

nonn,tabl

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 August 3 07:58 EDT 2021. Contains 346435 sequences. (Running on oeis4.)