login
A(n,k) = T(remainder(n,k), quotient(n,k)), where T(n,k) is sequence A001477 considered as a two-dimensional table, square array read by descending antidiagonals.
13

%I #27 Mar 18 2021 23:43:46

%S 1,2,3,2,1,6,2,5,4,10,2,5,1,3,15,2,5,9,4,7,21,2,5,9,1,8,6,28,2,5,9,14,

%T 4,3,11,36,2,5,9,14,1,8,7,10,45,2,5,9,14,20,4,13,12,16,55,2,5,9,14,20,

%U 1,8,3,6,15,66,2,5,9,14,20,27,4,13,7,11,22,78,2,5,9,14,20,27,1,8,19,12,17,21,91,2,5,9,14,20,27,35,4,13,3,18,10,29,105

%N A(n,k) = T(remainder(n,k), quotient(n,k)), where T(n,k) is sequence A001477 considered as a two-dimensional table, square array read by descending antidiagonals.

%H Antti Karttunen, <a href="/A286156/b286156.txt">Table of n, a(n) for n = 1..10585; the first 145 antidiagonals of array</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PairingFunction.html">Pairing Function</a>

%F A(n,k) = T(remainder(n,k), quotient(n,k)), where T(n,k) is sequence A001477 considered as a two-dimensional table, that is, as a pairing function from [0, 1, 2, 3, ...] x [0, 1, 2, 3, ...] to [0, 1, 2, 3, ...]. This sequence lists only values for indices n >= 1, k >= 1.

%e The top left 15 X 15 corner of the array:

%e 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2

%e 3, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5

%e 6, 4, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9

%e 10, 3, 4, 1, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14

%e 15, 7, 8, 4, 1, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20

%e 21, 6, 3, 8, 4, 1, 27, 27, 27, 27, 27, 27, 27, 27, 27

%e 28, 11, 7, 13, 8, 4, 1, 35, 35, 35, 35, 35, 35, 35, 35

%e 36, 10, 12, 3, 13, 8, 4, 1, 44, 44, 44, 44, 44, 44, 44

%e 45, 16, 6, 7, 19, 13, 8, 4, 1, 54, 54, 54, 54, 54, 54

%e 55, 15, 11, 12, 3, 19, 13, 8, 4, 1, 65, 65, 65, 65, 65

%e 66, 22, 17, 18, 7, 26, 19, 13, 8, 4, 1, 77, 77, 77, 77

%e 78, 21, 10, 6, 12, 3, 26, 19, 13, 8, 4, 1, 90, 90, 90

%e 91, 29, 16, 11, 18, 7, 34, 26, 19, 13, 8, 4, 1, 104, 104

%e 105, 28, 23, 17, 25, 12, 3, 34, 26, 19, 13, 8, 4, 1, 119

%e 120, 37, 15, 24, 6, 18, 7, 43, 34, 26, 19, 13, 8, 4, 1

%t Map[((#1 + #2)^2 + 3 #1 + #2)/2 & @@ # & /@ Reverse@ # &, Table[Function[m, Reverse@ QuotientRemainder[m, k]][n - k + 1], {n, 14}, {k, n}]] // Flatten (* _Michael De Vlieger_, May 20 2017 *)

%o (Scheme)

%o (define (A286156 n) (A286156bi (A002260 n) (A004736 n)))

%o (define (A286156bi row col) (if (zero? col) -1 (let ((a (remainder row col)) (b (quotient row col))) (/ (+ (expt (+ a b) 2) (* 3 a) b) 2))))

%o (Python)

%o def T(a, b): return ((a + b)**2 + 3*a + b)//2

%o def A(n, k): return T(n%k, n//k)

%o for n in range(1, 21): print([A(k, n - k + 1) for k in range(1, n + 1)]) # _Indranil Ghosh_, May 20 2017

%Y Cf. A286157 (transpose), A286158 (lower triangular region), A286159 (lower triangular region transposed).

%Y Cf. A000217 (column 1), A000012 (the main diagonal), A000096 (superdiagonal), A034856.

%Y Cf. A001477, A285722, A286101, A286102.

%K nonn,tabl

%O 1,2

%A _Antti Karttunen_, May 04 2017