A056023
The positive integers written as a triangle, where row n is written from right to left if n is odd and otherwise from left to right.
Original entry on oeis.org
1, 2, 3, 6, 5, 4, 7, 8, 9, 10, 15, 14, 13, 12, 11, 16, 17, 18, 19, 20, 21, 28, 27, 26, 25, 24, 23, 22, 29, 30, 31, 32, 33, 34, 35, 36, 45, 44, 43, 42, 41, 40, 39, 38, 37, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56
Offset: 1
From _Philippe Deléham_, Apr 04 2009 (Start)
Triangle begins:
1;
2, 3;
6, 5, 4;
7, 8, 9, 10;
15, 14, 13, 12, 11;
...
(End)
Enumeration by boustrophedonic ("ox-plowing") diagonal method. - _Boris Putievskiy_, Dec 24 2012
-
(* As a rectangle: *)
r[n_, k_] := n + (k + n - 2) (k + n - 1)/2/; OddQ[n + k];
r[n_, k_] := k + (n + k - 2) (n + k - 1)/2/; EvenQ[n+k];
TableForm[Table[f[n, k], {n, 1, 10}, {k, 1, 15}]]
Table[r[n - k + 1, k], {n, 14}, {k, n, 1, -1}]//Flatten
(* Clark Kimberling, Feb 03 2011 *)
Module[{nn=15},If[OddQ[Length[#]],Reverse[#],#]&/@TakeList[Range[ (nn(nn+1))/2],Range[nn]]]//Flatten (* Harvey P. Dale, Feb 08 2022 *)
A056011
Enumeration of natural numbers by the boustrophedonic diagonal method.
Original entry on oeis.org
1, 3, 2, 4, 5, 6, 10, 9, 8, 7, 11, 12, 13, 14, 15, 21, 20, 19, 18, 17, 16, 22, 23, 24, 25, 26, 27, 28, 36, 35, 34, 33, 32, 31, 30, 29, 37, 38, 39, 40, 41, 42, 43, 44, 45, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66
Offset: 1
The start of the sequence as a table:
1, 3, 4, 10, 11, 21, ...
2, 5, 9, 12, 20, 23, ...
6, 8, 13, 19, 24, 34, ...
7, 14, 18, 25, 33, 40, ...
15, 17, 26, 32, 41, 51, ...
...
Enumeration by boustrophedonic ("ox-plowing") diagonal method. - _Boris Putievskiy_, Dec 24 2012
The start of the sequence as triangle array read by rows:
1;
3, 2;
4, 5, 6;
10, 9, 8, 7;
11, 12, 13, 14, 15;
...
-
a056011 n = a056011_tabl !! (n-1)
a056011_list = concat a056011_tabl
a056011_tabl = ox False a000027_tabl where
ox turn (xs:xss) = (if turn then reverse xs else xs) : ox (not turn) xss
a056011_row n = a056011_tabl !! (n-1)
-- Reinhard Zumkeller, Nov 08 2013
-
A056011 := proc(n,k)
if type(n,'even') then
A131179(n)-k+1 ;
else
A131179(n)+k-1 ;
end if;
end proc: # R. J. Mathar, Sep 05 2012
-
Flatten[If[EvenQ[Length[#]],Reverse[#],#]&/@Table[c=(n(n+1))/2;Range[ c-n+1,c],{n,20}]] (* Harvey P. Dale, Mar 25 2012 *)
With[{nn=20},{#[[1]],Reverse[#[[2]]]}&/@Partition[ TakeList[ Range[ (nn(nn+1))/2],Range[nn]],2]//Flatten] (* Harvey P. Dale, Oct 05 2021 *)
A213927
T(n,k) = (z*(z-1)-(-1+(-1)^(z^2 mod 3))*n+(1+(-1)^(z^2 mod 3))*k)/2, where z=n+k-1; n, k > 0, read by antidiagonals.
Original entry on oeis.org
1, 2, 3, 6, 5, 4, 7, 8, 9, 10, 11, 12, 13, 14, 15, 21, 20, 19, 18, 17, 16, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 45, 44, 43, 42, 41, 40, 39, 38, 37, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 78
Offset: 1
The start of the sequence as table.
The direction of the placement denoted by ">" and "v".
.v.....v v...v v....v
.1.....2...6...7..11...21...22...29...45...
.3.....5...8..12..20...23...30...44...47...
>4.....9..13..19..24...31...43...48...58...
.10...14..18..25..32...42...49...59...75...
.15...17..26..33..41...50...60...74...83...
>16...27..34..40..51...61...73...84...97...
.28...35..39..52..62...72...85...98..114...
.36...38..53..63..71...86...99..113..128...
>37...54..64..70..87..100..112..129..145...
...
The start of the sequence as triangle array read by rows:
1;
2, 3;
6, 5, 4;
7, 8, 9, 10;
11, 12, 13, 14, 15;
21, 20, 19, 18, 17, 16;
22, 23, 24, 25, 26, 27, 28;
29, 30, 31, 32, 33, 34, 35, 36;
45, 44, 43, 42, 41, 40, 39, 38, 37;
...
Row r consists of r consecutive numbers from r*r/2-r/2+1 to r*r/2+r.
If r is not divisible by 3, rows are increasing.
If r is divisible by 3, rows are decreasing.
-
T[n_, k_] := With[{z = n + k - 1}, (z*(z - 1) - (-1 + (-1)^Mod[z^2, 3])*n + (1 + (-1)^Mod[z^2, 3])*k)/2];
Table[T[n - k + 1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Jul 22 2018 *)
-
t=int((math.sqrt(8*n-7) - 1)/ 2)
i=n-t*(t+1)/2
j=(t*t+3*t+4)/2-n
z=i+j-1
result=(z*(z-1)-(-1+(-1)**(z**2%3))*i+(1+(-1)**(z**2%3))*j)/2
Showing 1-3 of 3 results.
Comments