Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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!)
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
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
Sequence in context: A337676 A266306 A332117 * A075599 A012500 A220326
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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 18 20:50 EDT 2024. Contains 375284 sequences. (Running on oeis4.)