login
a(n) = c(1,2,...,n), the Cantor tuple function c applied to n-tuple (1,2,...,n).
3

%I #15 May 30 2018 03:30:23

%S 0,1,8,69,2705,3673410,6746994391242,22760966657776105541085632,

%T 259030801598197790167764376907440725907087677647628

%N a(n) = c(1,2,...,n), the Cantor tuple function c applied to n-tuple (1,2,...,n).

%H Alois P. Heinz, <a href="/A226597/b226597.txt">Table of n, a(n) for n = 0..12</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Pairing_function">Pairing function</a>

%F a(n) = c(1,2,...,n) with c() = 0, c(n) = n, c(n,k) = (n+k)*(n+k+1)/2+k, c(n_1,...,n_{k-1},n_k) = c(c(n_1,...,n_{k-1}),n_k) for k>2.

%F a(n) = (a(n-1)+n)*(a(n-1)+n+1)/2+n for n>1, a(n) = n for n<=1.

%e a(2) = c(1,2) = 3*4/2+2 = 8.

%e a(3) = c(1,2,3) = c(c(1,2),3) = c(8,3) = 11*12/2+3 = 69.

%p a:= proc(n) a(n):= `if`(n<2, n, (g-> g*(g+1)/2)(a(n-1)+n)+n) end:

%p seq(a(n), n=0..10);

%t a[n_] := a[n] = If[n < 2, n, Function[g, g*(g + 1)/2][a[n - 1] + n] + n] ;

%t Table[a[n], {n, 0, 10}] (* _Jean-François Alcover_, May 30 2018, from Maple *)

%Y Cf. A226588, A226598.

%K nonn

%O 0,3

%A _Alois P. Heinz_, Jun 13 2013