login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A226598 a(n) = c(n,n-1,...,1), the Cantor tuple function c applied to n-tuple (n,n-1,...,1). 3
0, 1, 7, 172, 159331, 457962302281, 34728196483190756583320206, 10559069708767287358379688495183368797732655643889529662 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

LINKS

Alois P. Heinz, Table of n, a(n) for n = 0..10

Wikipedia, Pairing function

FORMULA

a(n) = c(n,n-1,...,1) 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.

EXAMPLE

a(2) = c(2,1) = 3*4/2+1 = 7.

a(3) = c(3,2,1) = c(c(3,2),1) = c(5*6/2+2,1) = c(17,1) = 18*19/2+1 = 172.

MAPLE

c:= proc() `if`(nargs=0, 0,

           `if`(nargs=1, args,

           `if`(nargs=2, ((n, k)-> (s-> s*(s+1)/2)(n+k)+k)(args),

            c(c(args[1..-2]), args[-1]))))

    end:

a:= n-> c((n-i)$i=0..n-1):

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

MATHEMATICA

c[args_List] := Switch[Length[args], 0, {0}, 1, args, 2, {Function[s, s*(s + 1)/2][#[[1]] + #[[2]]] + #[[2]]&[args]}, _, c[Append[c[args[[1 ;; -2]] ], args[[-1]]]]];

a[n_] := c[Table[(n - i), {i, 0, n - 1}]][[1]];

Table[a[n], {n, 0, 10}] (* Jean-Fran├žois Alcover, May 30 2018, from Maple *)

CROSSREFS

Cf. A226588, A226597.

Sequence in context: A157203 A178019 A266306 * A075599 A012500 A220326

Adjacent sequences:  A226595 A226596 A226597 * A226599 A226600 A226601

KEYWORD

nonn

AUTHOR

Alois P. Heinz, Jun 13 2013

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 18 02:07 EST 2019. Contains 329242 sequences. (Running on oeis4.)