The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A209302 Table T(n,k) = max{n+k-1, n+k-1} n, k > 0, read by sides of squares from T(1,n) to T(n,n), then from T(n,n) to T(n,1). 2
1, 2, 3, 2, 3, 4, 5, 4, 3, 4, 5, 6, 7, 6, 5, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 6, 7, 8, 9, 10, 11, 10, 9, 8, 7, 6, 7, 8, 9, 10, 11, 12, 13, 12, 11, 10, 9, 8, 7, 8, 9, 10, 11, 12, 13, 14, 15, 14, 13, 12, 11, 10, 9, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 16, 15, 14 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
Boris Putievskiy, Transformations Integer Sequences And Pairing Functions, arXiv:1212.2732 [math.CO], 2012.
FORMULA
In general, let m be a natural number. Table T(n,k) = max{m*n+k-m, n+m*k-m}. For the general case,
a(n) = (m+1)*sqrt(n-1) + 1 - |n - floor(sqrt(n-1))^2 - floor(sqrt(n-1))|.
For m=1,
a(n) = 2*sqrt(n-1) + 1 - |n - floor(sqrt(n-1))^2 - floor(sqrt(n-1))|.
a(n) = t + |t^2 - n|, where t = floor(sqrt(n)+1/2). - Ridouane Oudra, May 07 2019
EXAMPLE
The start of the sequence as a table for the general case:
1 m+1 2*m+1 3*m+1 4*m+1 5*m+1 6*m+1 ...
m+1 m+2 2*m+2 3*m+2 4*m+2 5*m+2 6*m+2 ...
2*m+1 2*m+2 2*m+3 3*m+3 4*m+3 5*m+3 6*m+3 ...
3*m+1 3*m+2 3*m+3 3*m+4 4*m+4 5*m+4 6*m+4 ...
4*m+1 4*m+2 4*m+3 4*m+4 4*m+5 5*m+5 6*m+5 ...
5*m+1 5*m+2 5*m+3 5*m+4 5*m+5 5*m+6 6*m+6 ...
6*m+1 6*m+2 6*m+3 6*m+4 6*m+5 6*m+6 6*m+7 ...
...
The start of the sequence as a triangular array read by rows for general case:
1;
m+1, m+2, m+1;
2*m+1, 2*m+2, 2*m+3, 2*m+2, 2*m+1;
3*m+1, 3*m+2, 3*m+3, 3*m+4, 3*m+3, 3*m+2, 3*m+1;
4*m+1, 4*m+2, 4*m+3, 4*m+4, 4*m+5, 4*m+4, 4*m+3, 4*m+2, 4*m+1;
...
Row r contains 2*r-1 terms: r*m+1, r*m+2, ... r*m+r, r*m+r+1, r*m+r, ..., r*m+2, r*m+1.
The start of the sequence as triangle array read by rows for m=1:
1;
2, 3, 2;
3, 4, 5, 4, 3;
4, 5, 6, 7, 6, 5, 4;
5, 6, 7, 8, 9, 8, 7, 6, 5;
6, 7, 8, 9, 10, 11, 10, 9, 8, 7, 6;
7, 8, 9, 10, 11, 12, 13, 12, 11, 10, 9, 8, 7;
...
PROG
(Python)
result = 2*int(math.sqrt(n-1)) - abs(n-int(math.sqrt(n-1))**2 - int(math.sqrt(n-1)) -1) +1
CROSSREFS
Cf. A187760.
Sequence in context: A064672 A138554 A063772 * A205122 A174863 A064289
KEYWORD
nonn,tabf
AUTHOR
Boris Putievskiy, Jan 18 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 May 29 08:50 EDT 2024. Contains 372926 sequences. (Running on oeis4.)