cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Previous Showing 11-19 of 19 results.

A163337 Inverse permutation to A163336.

Original entry on oeis.org

0, 2, 5, 8, 4, 1, 3, 7, 12, 18, 25, 33, 26, 19, 13, 9, 14, 20, 27, 35, 44, 53, 43, 34, 42, 52, 63, 74, 62, 51, 61, 73, 86, 99, 85, 72, 60, 49, 39, 31, 40, 50, 41, 32, 24, 17, 11, 6, 10, 16, 23, 30, 22, 15, 21, 29, 38, 47, 37, 28, 36, 46, 57, 69, 82, 96, 83, 70, 58, 48, 59, 71
Offset: 0

Views

Author

Antti Karttunen, Jul 29 2009

Keywords

Comments

abs(A025581(a(n+1))-A025581(a(n))) + abs(A002262(a(n+1))-A002262(a(n))) = 1 for all n.

Crossrefs

Inverse: A163336. a(n) = A163331(A163332(n)) = A061579(A163335(n)). One-based version: A163341. See also A163335, A163358.

A163360 Inverse permutation to A163359.

Original entry on oeis.org

0, 2, 4, 1, 3, 6, 11, 7, 12, 17, 24, 18, 13, 8, 5, 9, 14, 19, 26, 20, 27, 35, 43, 34, 42, 52, 62, 51, 41, 33, 25, 32, 40, 49, 60, 50, 61, 73, 85, 72, 84, 98, 112, 97, 83, 71, 59, 70, 58, 47, 38, 48, 39, 31, 23, 30, 22, 16, 10, 15, 21, 29, 37, 28, 36, 45, 56, 46, 57, 69, 81
Offset: 0

Views

Author

Antti Karttunen, Jul 29 2009

Keywords

Comments

abs(A025581(a(n+1)) - A025581(a(n))) + abs(A002262(a(n+1)) - A002262(a(n))) = 1 for all n.

Crossrefs

Inverse: A163359. a(n) = A061579(A163358(n)). One-based version: A163364.

A163544 Inverse permutation to A147995.

Original entry on oeis.org

0, 1, 4, 2, 11, 6, 3, 7, 12, 17, 24, 18, 13, 8, 5, 9, 58, 48, 38, 47, 37, 28, 21, 29, 22, 16, 10, 15, 39, 30, 23, 31, 40, 49, 60, 50, 83, 70, 59, 71, 84, 97, 112, 98, 85, 72, 61, 73, 62, 52, 42, 51, 41, 32, 25, 33, 26, 20, 14, 19, 43, 34, 27, 35, 260, 238, 216, 237, 177
Offset: 0

Views

Author

Antti Karttunen, Aug 01 2009

Keywords

Crossrefs

Inverse: A147995. a(n) = A061579(A163546(n)).

A163546 Inverse permutation to A163545.

Original entry on oeis.org

0, 2, 4, 1, 13, 9, 5, 8, 12, 18, 24, 17, 11, 7, 3, 6, 62, 51, 42, 52, 43, 35, 27, 34, 26, 19, 14, 20, 41, 33, 25, 32, 40, 50, 60, 49, 85, 73, 61, 72, 84, 98, 112, 97, 83, 71, 59, 70, 58, 47, 38, 48, 39, 31, 23, 30, 22, 15, 10, 16, 37, 29, 21, 28, 268, 245, 224, 246, 183
Offset: 0

Views

Author

Antti Karttunen, Aug 01 2009

Keywords

Crossrefs

Inverse: A163545. a(n) = A054239(A163486(n)) = A061579(A163544(n)).

A230419 Square array A(n,k) = difference of digit sums in factorial base representations (A007623) of n and k, n>=0, k>=0, read by antidiagonals; A(n,k) = A034968(n)-A034968(k).

Original entry on oeis.org

0, 1, -1, 1, 0, -1, 2, 0, 0, -2, 2, 1, 0, -1, -2, 3, 1, 1, -1, -1, -3, 1, 2, 1, 0, -1, -2, -1, 2, 0, 2, 0, 0, -2, 0, -2, 2, 1, 0, 1, 0, -1, 0, -1, -2, 3, 1, 1, -1, 1, -1, 1, -1, -1, -3, 3, 2, 1, 0, -1, 0, 1, 0, -1, -2, -3, 4, 2, 2, 0, 0, -2, 2, 0, 0, -2, -2, -4
Offset: 0

Views

Author

Antti Karttunen, Nov 10 2013

Keywords

Comments

Equivalently, A(n,k) = the sum of differences of digits in matching positions of the factorial base representations (A007623) of n and k.

Examples

			The top left corner array is:
   0,  1,  1,  2,  2,  3,  1,  2,  2,  3,  3, ...
  -1,  0,  0,  1,  1,  2,  0,  1,  1,  2,  2, ...
  -1,  0,  0,  1,  1,  2,  0,  1,  1,  2,  2, ...
  -2, -1, -1,  0,  0,  1, -1,  0,  0,  1,  1, ...
  -2, -1, -1,  0,  0,  1, -1,  0,  0,  1,  1, ...
  -3, -2, -2, -1, -1,  0, -2, -1, -1,  0,  0, ...
  -1,  0,  0,  1,  1,  2,  0,  1,  1,  2,  2, ...
  -2, -1, -1,  0,  0,  1, -1,  0,  0,  1,  1, ...
  -2, -1, -1,  0,  0,  1, -1,  0,  0,  1,  1, ...
  -3, -2, -2, -1, -1,  0, -2, -1, -1,  0,  0, ...
  -3, -2, -2, -1, -1,  0, -2, -1, -1,  0,  0, ...
  ...
		

Crossrefs

The topmost row: A034968 (and also the leftmost column negated).
Cf. A230415 (similar array which gives the number of differing digits).
Cf. A231713 (similar array which gives the sum of absolute differences).

Formula

A(col,row) = A034968(col)-A034968(row). [Where col is the column and row the row index of entry A(col,row)]
Equally, as a sequence, a(n) = A034968(A025581(n)) - A034968(A002262(n)).
For each entry, A(j,i) = -A(i,j), or as a sequence, a(A061579(n)) = -a(n). [The array is symmetric up to the sign of entries]
Also, for each entry A(i,j), abs(A(i,j)) <= A231713(i,j).

A119771 Product of n^2 and n-th tetrahedral number: a(n) = n^3*(n+1)*(n+2)/6.

Original entry on oeis.org

0, 1, 16, 90, 320, 875, 2016, 4116, 7680, 13365, 22000, 34606, 52416, 76895, 109760, 153000, 208896, 280041, 369360, 480130, 616000, 781011, 979616, 1216700, 1497600, 1828125, 2214576, 2663766, 3183040, 3780295, 4464000, 5243216, 6127616, 7127505, 8253840
Offset: 0

Views

Author

Brandon Ang (xyz1236(AT)verizon.net), Jun 28 2006

Keywords

Comments

If n is divisible by 10, then a(n) is divisible by 1000.

Examples

			a(25) = n^3*(n+1)*(n+2)/6 = 25^3*(25+1)*(25+2)/6 = 15625*26*27/6 = 15625*13*9 = 1828125.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := n^3*(n+1)*(n+2)/6; Array[a, 35, 0] (* Amiram Eldar, Feb 13 2023 *)

Formula

From Alois P. Heinz, Feb 10 2023: (Start)
a(n) = Sum_{k=0..n} k^2 * A061579(n,k).
G.f.: x*(x+1)*(9*x+1)/(x-1)^6. (End)
From Amiram Eldar, Feb 13 2023: (Start)
Sum_{n>=1} 1/a(n) = 39/8 - 3*Pi^2/4 + 3*zeta(3).
Sum_{n>=1} (-1)^(n+1)/a(n) = 12*log(2) - 51/8 - 3*Pi^2/8 + 9*zeta(3)/4. (End)
E.g.f.: exp(x)*x*(6 + 42*x + 45*x^2 + 13*x^3 + x^4)/6. - Stefano Spezia, Aug 31 2025

A226725 Denominator of the median of {1, 1/2, 1/3, ..., 1/n}.

Original entry on oeis.org

1, 4, 2, 12, 3, 24, 4, 40, 5, 60, 6, 84, 7, 112, 8, 144, 9, 180, 10, 220, 11, 264, 12, 312, 13, 364, 14, 420, 15, 480, 16, 544, 17, 612, 18, 684, 19, 760, 20, 840, 21, 924, 22, 1012, 23, 1104, 24, 1200, 25, 1300, 26, 1404, 27, 1512, 28, 1624, 29, 1740, 30
Offset: 1

Views

Author

Clark Kimberling, Jun 19 2013

Keywords

Examples

			median{1, 1/2, 1/3, 1/4} = (1/2 + 1/3)/2 = 7/12, so that a(4) = 12.
		

Crossrefs

Cf. A093178 (numerators), A061579.

Programs

  • Maple
    A226725:=n->n^(1/2 + (-1)^n/2)*(n + 2^(1/2 + (-1)^n/2))/2: seq(A226725(n), n=1..100); # Wesley Ivan Hurt, Feb 27 2015
  • Mathematica
    Denominator[Table[Median[Table[1/k, {k, n}]], {n, 120}]]
    f[n_] := If[ OddQ@ n, Floor[(n + 1)/2], n(n/2 + 1)]; Array[f, 59] (* Robert G. Wilson v, Feb 27 2015 *)
    With[{nn=30},Riffle[Range[nn],Table[2n+2n^2,{n,nn}]]] (* Harvey P. Dale, May 26 2019 *)
    Riffle[Range[60],LinearRecurrence[{3,-3,1},{4,12,24},60]] (* Harvey P. Dale, Oct 03 2023 *)
  • PARI
    Vec(x*(x^2-4*x-1)/((x-1)^3*(x+1)^3) + O(x^100)) \\ Colin Barker, Feb 27 2015

Formula

a(n) = (n+1)/2 if n is odd, a(n) = n*(n/2+1) if n is even.
G.f.: W(0), where W(k)= 1 + 2*x*(k+2)/( 1 - x/(x + 2*(k+1)/W(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 16 2013
a(n) = 3*a(n-2)-3*a(n-4)+a(n-6). - Colin Barker, Feb 27 2015
G.f.: x*(x^2-4*x-1) / ((x-1)^3*(x+1)^3). - Colin Barker, Feb 27 2015
a(n) = n^(1/2 + (-1)^n/2)*(n + 2^(1/2 + (-1)^n/2))/2. - Wesley Ivan Hurt, Feb 27 2015
a(n) = Sum_{k=0..n} (-1)^k * A061579(n,k). - Alois P. Heinz, Feb 10 2023

Extensions

Formula changed for even terms by Luca Brigada Villa, Jun 20 2013

A349244 Minimal sequence of single-tile sliding moves that transpose the upper-left triangle of size 2, then 3, then 4, ... of an infinite square matrix (see comments for details).

Original entry on oeis.org

1, 4, 2, 5, 8, 12, 7, 3, 4, 2, 5, 1, 2, 5, 3, 4, 5, 2, 1, 3, 4, 7, 12, 8, 3, 1
Offset: 1

Views

Author

M. F. Hasler, Nov 16 2021

Keywords

Comments

Consider the infinite square matrix filled with the nonnegative integers by falling antidiagonals (cf. A001477 displayed as table / square array),
0 1 3 6 10 ...
2 4 7 11 ...
5 8 12 17 ...
...
Similar to the moves in the well-known sliding puzzle, "move m" consists in shifting the nonzero elements between the "empty tile" 0 and a number m in the same row or column as 0, one place towards the 0, and placing the 0 in the former location of m, cf. EXAMPLE. If m is an immediate neighbor of 0 (so m and 0 simply exchange their places) this is a single-tile move, else a multi-tile move.
The target configuration is the transposed matrix, cf. A061579 read as table / square array. More precisely, we call goal [k] any infinite matrix where all of {0, ..., k} are in the same position as in the transposed matrix. The position of numbers > k is irrelevant.
This sequence gives the shortest (and in case of a tie, the lexicographically earliest) sequence of single-tile moves that successively achieves goal [k], k = 2, 5, 9, ... = A000096(1, 2, 3, ...), i.e., completely transposes the upper left triangle of size 2, then of size 3, etc.: see EXAMPLE for more details.
The sequence can be read as irregular table where row r gives the moves which yield goal [k = A000096(r)] starting from the previous goal [A000096(r-1)].
There are several possible variants of this sequence, mainly corresponding to different goals (see A349245 for achieving goal [1], [2], [3], ...; one may also consider goals (k) where only the positions of {1, ..., k} matter, but the location of 0 and the element in the top left corner do not matter) and/or allowing multi-tile moves.

Examples

			After the three moves a(1..3) = (1, 4, 2), the upper left becomes
   1  4  3 ...
   0  2  7 ...
  ...
One further move '1' would place the tile = value 1 in its final position (row 2, column 1); then moves 4 and 2 would lead to
   4  2  3 ...
   1  0 ...
  ...
where 1 and 2 have their final position. (This is called goal (2) in COMMENTS.) However, to achieve goal [2] with also 0 in its initial position (row 1, column 1), one has to proceed differently, see a(4..12).
Read as a table whose n-th row completes transposition of the (1+n)-th antidiagonal, the sequence reads:
row 1: [1, 4, 2, 5, 8, 12, 7, 3, 4, 2, 5, 1] \\ here antidiagonals 1 & 2 are transposed
row 2: [2, 5, 3, 4, 5, 2, 1, 3, 4, 7, 12, 8, 3, 1] \\ here, antidiagonals 1-3 are transposed.
		

Crossrefs

Cf. A001477 (read as square array = initial configuration), A061579 (read as square array = final configuration), A004736 and A002260 (x- and y-coordinates of 0, 1, 2, ... in initial resp. final configuration).
Cf. A000096 = A000217(1, 2, ...) - 1.
Cf. A349245 (variant where goals [1], [2], [3], ... are achieved "individually").

Programs

  • PARI
    (init(n=4)={M=X=Y=vector(2*(n-1)*n); NM=!X0=Y0=1; B=matrix(n, n, y, x, if( n=(x+y)*(x+y-1)\2-y, X[n]=x; Y[n]=y; n))})(); M349244=Map()/*for memoization*/
    move(m/*0 = undo*/)={if(m>0, #M>NM||M=Vec(M,NM+9); M[NM++]=m, m=M[NM]; NM--); B[Y0, X0]=m; [X0, Y0, X[m], Y[m]]= [X[m], Y[m], X0, Y0]; B[Y0, X0]=0}
    movelist(L=#B)={setminus( Set([ B[Y0+imag(I^k), X0+real(I^k)] | k<-[0..3], if(k>2, Y0>1, k>1, X0>1, k, Y00, check goal if d=0, if d<0 do DFS with d=1, 2, 3...*/
    find(goal, d=-1, L=#B)={if( !d, !for(y=1, #goal, for(x=1, #goal[y], B[y, x]==goal[y][x]||return)), d<0, d=0; until(find(goal, d++, L),); M[NM-d+1..NM], foreach(movelist(), m, move(m); find(goal, d-1, L)&& return(1); move()))}
    goal(k, g=[[0]])={for(j=1, k, if(#g[#g]>1, g=concat(g, [[j]]), g[k=j-g[#g][1]]=concat(g[k], j))); g}
    A349244_row(r)=iferr(mapget(M349244, r), E, init(r+2); for(k=1, r-1, apply(move, A349244_row(k))); mapput(M349244, r, r=find(goal(r*(r+3)\2))); r)

A349245 Minimal sequence of single-tile sliding moves that progressively transpose elements 0 through k (k = 1, 2, 3, ...) of the infinite square matrix, cf. comments for details.

Original entry on oeis.org

1, 4, 2, 1, 4, 2, 1, 4, 2, 3, 7, 12, 8, 5, 4, 1, 3, 2, 1, 3, 5, 4, 3, 1, 2, 5, 4, 8, 12, 7, 5, 2, 1, 3, 8, 13, 9, 8, 3, 1, 2, 5, 6, 11, 7, 6, 5, 2, 1, 4, 6, 12, 13, 6, 4, 3, 6, 9, 8, 6, 3, 1, 2, 4, 12, 7, 17, 13, 7, 12, 9, 7, 12, 9, 4, 2, 1, 3, 7, 8, 18, 12, 8, 18, 12, 24, 13, 17, 9
Offset: 1

Views

Author

M. F. Hasler, Nov 18 2021

Keywords

Comments

Consider the infinite square matrix filled with the nonnegative integers by falling antidiagonals (cf. A001477 displayed as table / square array),
0 1 3 6 ...
2 4 7 11 ...
5 8 12 17 ...
...
Similar to the moves in the well-known sliding puzzle, "move m" consists in shifting one place towards "empty tile" 0 all nonzero elements between 0 and the nonzero number m in the same row or column as 0, and moving 0 in the former location of m, cf. EXAMPLE. If m is an immediate neighbor of 0 (so m and 0 simply exchange their places) this is a single-tile move, else a multi-tile move.
The target configuration is the transposed matrix, cf. A061579 read as table / square array. More precisely, we call goal [k] any infinite matrix where all of {0, ..., k}, are in the same position as in the transposed matrix. The position of numbers > k is irrelevant.
This sequence gives the shortest (and in case of a tie, the lexicographically earliest) sequence of single-tile moves that successively achieve goal [1], then [2], then [3], etc. It can be considered as an irregular table where row k gives the moves needed to go from goal [k-1] to goal [k]. See EXAMPLE for details.
It is interesting to note that goal [2] cannot be achieved without using a tile outside the upper left 2 X 2 square, and goal [5] can't be achieved within the 3 X 3 square. Goal [9] can be achieved within the 4 X 4 square, with moves (2, 5, 11, 9, 8, 11, 5, 4, 7, 18, 11, 8, 17, 11, 18, 7, 4, 2), but the minimal solution (row 9, see EXAMPLE) requires using row 5.
There are several variants of this sequence, mainly by achieving different goals and/or considering multi-tile moves. See A349244 for successive goals [1], [2], [3], .... One can also consider goals (k) where only the position of {1, ..., k} must be as given. Then goal (2) is achieved through moves (1, 4, 2, 1, 4, 2).

Examples

			Starting from the initial configuration (cf. comments), the first possible move "1" means to slide the 1 from row 1, column 2 to the "empty square" 0 at (1,1); then move "4" slides the 4 one up, and move "2" slides the 2 to the right:
   0  1  3 ...   (1)   1  0  3 ...   (4)   1  4  3 ...   (2)   1  4  3 ...
   2  4  7 ...   ==>   2  4  7 ...   ==>   2  0  7 ...   ==>   0  2  7 ...
   ... ... ...         ... ... ...         ... ... ...         ... ... ...
The next move, 1, will place that tile in its final position (row 2, column 1):
   (1)   0  4  3 ...
   ==>   1  2  7 ...
         ... ... ...
Given that the 0 is also in its final position (1,1), this achieves what we call goal [1]. Now further moves 4 and 2 would move the 2 in its final position (1,2), so {1, 2} are in their final position, but 0 isn't. (This is called goal (2) in comments.)
However, to achieve goal [2] with also 0 in its initial position (row 1, column 1), in a minimum number of moves, one has to proceed differently: see a(4..18).
Formatted as an irregular table with rows ending with achieved goals [1], [2], [3], ... the sequence reads:
row 1: [1, 4, 2, 1]   \\ here {0, 1} are at their final position
row 2: [4, 2, 1, 4, 2, 3, 7, 12, 8, 5, 4, 1, 3, 2] \\ here {0, 1, 2} are "done"
row 3: [1, 3, 5, 4, 3, 1] \\ here {0, 1, 2, 3} are in their final position
row 4: [2, 5, 4, 8, 12, 7, 5, 2] \\ now {0, ..., 4} are in their final position
row 5: [1, 3, 8, 13, 9, 8, 3, 1] \\ now {0, ..., 5} are in their final position
row 6: [2, 5, 6, 11, 7, 6, 5, 2, 1, 4, 6, 12, 13, 6, 4, 3, 6, 9, 8, 6, 3, 1]
row 7: [2, 4, 12, 7, 17, 13, 7, 12, 9, 7, 12, 9, 4, 2]
row 8: [1, 3, 7, 8, 18, 12, 8, 18, 12, 24, 13, 17, 9, 8, 18, 7, 3, 1]
row 9: [2, 4, 8, 18, 17, 23, 16, 10, 11, 9, 18, 8, 4, 2]
		

Crossrefs

Cf. A349244 (achieve goals [2], [5], [9], ... with minimum number of moves).
Cf. A001477 (read as square array = initial configuration), A061579 (read as square array = final configuration), A004736 and A002260 (x- and y-coordinates of 0, 1, 2, ... in initial resp. final configuration).

Programs

  • PARI
    M349245=Map()/*for memoization*/; A349245_row(k)={iferr(mapget(M349245, k), E, my(g=goal(k)); init(#g+1); for(j=1,k-1, A349245_row(j)); mapput(M349245, k, r=find(g)); r)} \\ see A349244 for helper functions find(), goal(), init()...
Previous Showing 11-19 of 19 results.