login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A061579
Reverse one number (0), then two numbers (2,1), then three (5,4,3), then four (9,8,7,6), etc.
20
0, 2, 1, 5, 4, 3, 9, 8, 7, 6, 14, 13, 12, 11, 10, 20, 19, 18, 17, 16, 15, 27, 26, 25, 24, 23, 22, 21, 35, 34, 33, 32, 31, 30, 29, 28, 44, 43, 42, 41, 40, 39, 38, 37, 36, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66
OFFSET
0,2
COMMENTS
A self-inverse permutation of the nonnegative numbers.
a(n) is the smallest nonnegative integer not yet in the sequence such that n + a(n) is one less than a square. - Franklin T. Adams-Watters, Apr 06 2009
From Michel Marcus, Mar 01 2021: (Start)
Array T(n,k) = (n+k)^2/2 + (n+3*k)/2 for n,k >= 0 read by descending antidiagonals.
Array T(n,k) = (n+k)^2/2 + (3*n+k)/2 for n,k >= 0 read by ascending antidiagonals. (End)
FORMULA
a(n) = floor(sqrt(2n+1)-1/2)*floor(sqrt(2n+1)+3/2) - n = A005563(A003056(n)) - n.
Row (or antidiagonal) n = 0, 1, 2, ... contains the integers from A000217(n) to A000217(n+1)-1 in reverse order (for diagonals, "reversed" with respect to the canonical "falling" order, cf. A001477/table). - M. F. Hasler, Nov 09 2021
From Alois P. Heinz, Feb 10 2023: (Start)
T(n,k) = n*(n+3)/2 - k.
Sum_{k=0..n} k * T(n,k) = A002419(n).
Sum_{k=0..n} k^2 * T(n,k) = A119771(n).
Sum_{k=0..n} (-1)^k * T(n,k) = A226725(n). (End)
EXAMPLE
Read as a triangle, the sequence is:
0
2 1
5 4 3
9 8 7 6
14 13 12 11 10
(...)
As an infinite square matrix (cf. the "table" link, 2nd paragraph) it reads:
0 2 5 9 14 20 ...
1 4 8 13 19 22 ...
3 7 12 18 23 30 ...
6 11 17 24 31 39 ...
(...)
MAPLE
T:= (n, k)-> n*(n+3)/2-k:
seq(seq(T(n, k), k=0..n), n=0..12); # Alois P. Heinz, Feb 10 2023
MATHEMATICA
Module[{nn=20}, Reverse/@TakeList[Range[0, (nn(nn+1))/2], Range[nn]]]// Flatten (* Requires Mathematica version 11 or later *) (* Harvey P. Dale, Jul 06 2018 *)
PROG
(PARI) A061579_row(n)=vector(n+=1, j, n*(n+1)\2-j)
A061579_upto(n)=concat([A061579_row(r)|r<-[0..sqrtint(2*n)]]) \\ yields approximately n terms: actual number differs by less than +- sqrt(n). - M. F. Hasler, Nov 09 2021
(Python)
from math import isqrt
def A061579(n): return (r:=isqrt((n<<3)+1)-1>>1)*(r+2)-n # Chai Wah Wu, Feb 10 2023
CROSSREFS
Fixed points are A046092.
Row sums give A027480.
Each reversal involves the numbers from A000217 through to A000096.
Cf. A038722. Transpose of A001477.
Sequence in context: A280513 A185023 A372501 * A094064 A343809 A159930
KEYWORD
nonn,tabl
AUTHOR
Henry Bottomley, May 21 2001
STATUS
approved