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!)
A344839 Square array T(n, k), n, k >= 0, read by antidiagonals; T(n, k) = abs(n * 2^max(0, w(k)-w(n)) - k * 2^max(0, w(n)-w(k))) (where w = A070939). 6

%I #10 May 31 2021 02:11:39

%S 0,1,1,2,0,2,3,0,0,3,4,1,0,1,4,5,0,1,1,0,5,6,1,0,0,0,1,6,7,2,1,2,2,1,

%T 2,7,8,3,2,1,0,1,2,3,8,9,0,3,0,1,1,0,3,0,9,10,1,0,1,2,0,2,1,0,1,10,11,

%U 2,1,4,3,1,1,3,4,1,2,11,12,3,2,3,0,2,0,2,0,3,2,3,12

%N Square array T(n, k), n, k >= 0, read by antidiagonals; T(n, k) = abs(n * 2^max(0, w(k)-w(n)) - k * 2^max(0, w(n)-w(k))) (where w = A070939).

%C In other words, we right pad the binary expansion of the lesser of n and k with zeros (provided it is positive) so that both numbers have the same number of binary digits, and then take the absolute difference.

%H Rémy Sigrist, <a href="/A344839/b344839.txt">Table of n, a(n) for n = 0..10010</a>

%H Rémy Sigrist, <a href="/A344839/a344839_1.png">Colored representation of the table for n, k < 2^10</a>

%F T(n, k) = T(k, n).

%F T(n, n) = 0.

%F T(n, 0) = n.

%F T(n, 1) = A053645(n) for any n > 0.

%e Array T(n, k) begins:

%e n\k| 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

%e ---+-------------------------------------------------------

%e 0| 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

%e 1| 1 0 0 1 0 1 2 3 0 1 2 3 4 5 6 7

%e 2| 2 0 0 1 0 1 2 3 0 1 2 3 4 5 6 7

%e 3| 3 1 1 0 2 1 0 1 4 3 2 1 0 1 2 3

%e 4| 4 0 0 2 0 1 2 3 0 1 2 3 4 5 6 7

%e 5| 5 1 1 1 1 0 1 2 2 1 0 1 2 3 4 5

%e 6| 6 2 2 0 2 1 0 1 4 3 2 1 0 1 2 3

%e 7| 7 3 3 1 3 2 1 0 6 5 4 3 2 1 0 1

%e 8| 8 0 0 4 0 2 4 6 0 1 2 3 4 5 6 7

%e 9| 9 1 1 3 1 1 3 5 1 0 1 2 3 4 5 6

%e 10| 10 2 2 2 2 0 2 4 2 1 0 1 2 3 4 5

%e 11| 11 3 3 1 3 1 1 3 3 2 1 0 1 2 3 4

%e 12| 12 4 4 0 4 2 0 2 4 3 2 1 0 1 2 3

%e 13| 13 5 5 1 5 3 1 1 5 4 3 2 1 0 1 2

%e 14| 14 6 6 2 6 4 2 0 6 5 4 3 2 1 0 1

%e 15| 15 7 7 3 7 5 3 1 7 6 5 4 3 2 1 0

%o (PARI) T(n,k,op=(x,y)->abs(x-y),w=m->#binary(m)) = { op(n*2^max(0, w(k)-w(n)), k*2^max(0, w(n)-w(k))) }

%Y Cf. A049581, A053645, A070939.

%Y Cf. A344834 (AND), A344835 (OR), A344836 (XOR), A344837 (min), A344838 (max).

%K nonn,base,tabl

%O 0,4

%A _Rémy Sigrist_, May 29 2021

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 July 29 03:05 EDT 2024. Contains 374727 sequences. (Running on oeis4.)