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!)
A236459 Regular triangle: T(n, k) Manhattan distance between n and k in a left-aligned triangle with next M natural numbers in row M. 0

%I #11 Dec 09 2014 03:32:59

%S 0,1,0,2,1,0,2,1,2,0,3,2,1,1,0,4,3,2,2,1,0,3,2,3,1,2,3,0,4,3,2,2,1,2,

%T 1,0,5,4,3,3,2,1,2,1,0,6,5,4,4,3,2,3,2,1,0,4,3,4,2,3,4,1,2,3,4,0,5,4,

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

%N Regular triangle: T(n, k) Manhattan distance between n and k in a left-aligned triangle with next M natural numbers in row M.

%C First column is A051162. Right diagonal is all zeros.

%e Triangle where distances are measured begins:

%e 1

%e 2 3

%e 4 5 6

%e 7 8 9 10

%e Distance between 1 and 1 is 0, hence T(1, 1) = 0.

%e Distance between 2 and 1 is 1, and between 2 and 2 is 0. Hence second row of this triangle is 1, 0.

%e Triangle starts:

%e 0;

%e 1, 0;

%e 2, 1, 0;

%e 2, 1, 2, 0;

%e 3, 2, 1, 1, 0;

%o (PARI) getxy(n) = {y = sqrtint(2*n); if (n<=y*(y+1)/2, y--); x = n - y*(y+1)/2; [x, y];}

%o trg(nn) = {i= 1; for (n = 1, nn, v = getxy(n); for (k = 1, n, nv = getxy(k); print1(abs(nv[1]-v[1])+abs(nv[2]-v[2]), ", ");); print(););}

%Y Cf. A236345.

%K nonn,tabl

%O 1,4

%A _Michel Marcus_, Jan 26 2014

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 March 29 11:45 EDT 2024. Contains 371278 sequences. (Running on oeis4.)