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.

A339399 Pairwise listing of the partitions of k into two parts (s,t), with 0 < s <= t ordered by increasing values of s and where k = 2,3,... .

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 2, 2, 1, 4, 2, 3, 1, 5, 2, 4, 3, 3, 1, 6, 2, 5, 3, 4, 1, 7, 2, 6, 3, 5, 4, 4, 1, 8, 2, 7, 3, 6, 4, 5, 1, 9, 2, 8, 3, 7, 4, 6, 5, 5, 1, 10, 2, 9, 3, 8, 4, 7, 5, 6, 1, 11, 2, 10, 3, 9, 4, 8, 5, 7, 6, 6, 1, 12, 2, 11, 3, 10, 4, 9, 5, 8, 6, 7, 1, 13, 2, 12, 3, 11
Offset: 1

Views

Author

Wesley Ivan Hurt, Dec 02 2020

Keywords

Comments

a(n-1) and a(n) are the lesser and greater of a twin prime pair if and only if a(n) = a(n-1) + 2 where a(n-1) and a(n) are prime.

Examples

			                                                                     [1,9]
                                                     [1,7]   [1,8]   [2,8]
                                     [1,5]   [1,6]   [2,6]   [2,7]   [3,7]
                     [1,3]   [1,4]   [2,4]   [2,5]   [3,5]   [3,6]   [4,6]
     [1,1]   [1,2]   [2,2]   [2,3]   [3,3]   [3,4]   [4,4]   [4,5]   [5,5]
   k   2       3       4       5       6       7       8       9      10
  --------------------------------------------------------------------------
   k   Nondecreasing partitions of k
  --------------------------------------------------------------------------
   2   1,1
   3   1,2
   4   1,3,2,2
   5   1,4,2,3
   6   1,5,2,4,3,3
   7   1,6,2,5,3,4
   8   1,7,2,6,3,5,4,4
   9   1,8,2,7,3,6,4,5
  10   1,9,2,8,3,7,4,6,5,5
  ...
		

Crossrefs

Bisections: A122197 (odd), A199474 (even).

Programs

  • Mathematica
    t[n_] := Flatten[Reverse /@ IntegerPartitions[n, {2}]]; Array[t, 14, 2] // Flatten (* Amiram Eldar, Dec 03 2020 *)
    Table[(1 + (-1)^n) (1 + Floor[Sqrt[2 n - 1 - (-1)^n]])/2 - ((2 n + 1 - (-1)^n)/2 - 2 Sum[Floor[(k + 1)/2], {k, -1 + Floor[Sqrt[2 n - 2 - (-1)^n]]}]) (-1)^n/2, {n, 100}] (* Wesley Ivan Hurt, Dec 04 2020 *)
  • PARI
    row(n) = vector(n\2, i, [i, n-i]);
    tabf(nn) = for (n=2, nn, print(row(n))); \\ Michel Marcus, Dec 03 2020

Formula

a(n) = (1+(-1)^n)*(1+floor(sqrt(2*n-1-(-1)^n)))/2-((2*n+1-(-1)^n)/2-2 *Sum_{k=1..floor(sqrt(2*n-2-(-1)^n)-1)} floor((k+1)/2))*(-1)^n/2.
a(n) = A339443(A103889(n)). - Wesley Ivan Hurt, May 09 2021