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.

Showing 1-8 of 8 results.

A333365 T(n,k) is the number of times that prime(k) is the least part in a partition of n into prime parts; triangle T(n,k), n >= 0, 1 <= k <= max(1,A000720(A331634(n))), read by rows.

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 2, 0, 0, 1, 2, 1, 3, 1, 3, 1, 1, 4, 1, 0, 0, 1, 5, 1, 1, 6, 2, 0, 0, 0, 1, 7, 2, 0, 1, 9, 2, 1, 10, 3, 1, 12, 3, 1, 0, 0, 0, 1, 14, 3, 1, 1, 17, 4, 1, 0, 0, 0, 0, 1, 19, 5, 1, 1, 23, 5, 1, 1, 26, 6, 2, 0, 1, 30, 7, 2, 0, 0, 0, 0, 0, 1
Offset: 0

Views

Author

Alois P. Heinz, Mar 16 2020

Keywords

Examples

			In the A000607(11) = 6 partitions of 11 into prime parts, (11), 335, 227, 2225, 2333, 22223 the least parts are 11 = prime(5) (once), 3 = prime(2)(once), and 2 = prime(1) (four times), whereas 5 and 7 (prime(3) and prime(4)) do not occur. Thus row 11 is [4,1,0,0,1].
Triangle T(n,k) begins:
   0    ;
   0    ;
   1    ;
   0, 1    ;
   1       ;
   1, 0, 1    ;
   1, 1       ;
   2, 0, 0, 1    ;
   2, 1          ;
   3, 1          ;
   3, 1, 1       ;
   4, 1, 0, 0, 1    ;
   5, 1, 1          ;
   6, 2, 0, 0, 0, 1    ;
   7, 2, 0, 1          ;
   9, 2, 1             ;
  10, 3, 1             ;
  12, 3, 1, 0, 0, 0, 1    ;
  14, 3, 1, 1             ;
  17, 4, 1, 0, 0, 0, 0, 1    ;
  19, 5, 1, 1                ;
  ...
		

Crossrefs

Columns k=1-2 give: A000607(n-2) for n>1, A099773(n-3) for n>2.
Row sums give A000607 for n>0.
Length of n-th row is A000720(A331634(n)) for n>1.
Indices of rows without 1's: A330433.

Programs

  • Maple
    b:= proc(n, p, t) option remember; `if`(n=0, 1, `if`(p>n, 0, (q->
          add(b(n-p*j, q, 1), j=1..n/p)*t^p+b(n, q, t))(nextprime(p))))
        end:
    T:= proc(n) option remember; (p-> seq(`if`(isprime(i),
          coeff(p, x, i), [][]), i=2..max(2,degree(p))))(b(n, 2, x))
        end:
    seq(T(n), n=0..23);
  • Mathematica
    b[n_, p_, t_] := b[n, p, t] = If[n == 0, 1, If[p > n, 0, With[{q = NextPrime[p]}, Sum[b[n - p*j, q, 1], {j, 1, n/p}]*t^p + b[n, q, t]]]];
    T[n_] := If[n < 2, {0}, MapIndexed[If[PrimeQ[#2[[1]]], #1, Nothing]&, Rest @ CoefficientList[b[n, 2, x], x]]];
    T /@ Range[0, 23] // Flatten (* Jean-François Alcover, Mar 30 2021, after Alois P. Heinz *)

Formula

T(n,pi(n)) = A010051(n) for n > 1.
T(p,pi(p)) = 1 if p is prime.
T(prime(k),k) = 1 for k >= 1.
Recursion: T(n,k) = Sum_{q=k..pi(n-p)} T(n-p, q) with p := prime(k) and T(n,k) = 0 if n < p, or 1 if n = p. - David James Sycamore, Mar 28 2020

A330507 a(n) is the smallest number k having for every prime p <= prime(n) at least one prime partition with least part p, and no such partition having least part > prime(n). If no such k exists then a(n) = 0 (see comments).

Original entry on oeis.org

2, 6, 10, 18, 24, 30, 51, 57, 69, 60, 99, 111, 123, 143, 147, 159, 177, 189, 201, 213, 225, 245, 255, 267, 291, 303, 309, 321, 345, 357, 381, 393, 411, 427, 447, 465, 471, 493, 507, 519, 537, 553, 573, 583, 623, 621, 633, 669, 681, 695, 707, 729, 749, 753, 783
Offset: 1

Views

Author

David James Sycamore, Mar 01 2020

Keywords

Comments

Alternatively, a(n) is the smallest number whose product of distinct least part primes from all partitions of n into prime parts, is equal to primorial(n).
2 is the only prime term.
a(n) = 0 for n = 90, 151, 349, 352, 444, ... . - Alois P. Heinz, Mar 12 2020

Examples

			a(1) = 2 because [2] is the only prime partition of prime(1) = 2.
a(2) = 6 because [2,2,2] and [3,3] are the only possible prime partitions of 6, namely with prime(1) and prime(2) the only least parts.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, p, t) option remember; `if`(n=0, 1, `if`(p>n, 0, (q->
          add(b(n-p*j, q, 1), j=1..n/p)*t^p+b(n, q, t))(nextprime(p))))
        end:
    a:= proc(n) option remember; local f, k, p; p:= ithprime(n);
          for k to 4*p do f:= b(k, 2, x); if degree(f)<= p and andmap(
            h->0Alois P. Heinz, Mar 12 2020
  • Mathematica
    With[{s = Array[Union@ Select[IntegerPartitions[#], AllTrue[#, PrimeQ] &][[All, -1]] &, 70]}, TakeWhile[Map[FirstPosition[s, #][[1]] &, Rest@ NestList[Append[#, Prime[Length@ # + 1]] &, {}, 12]], IntegerQ]] (* Michael De Vlieger, Mar 06 2020 *)
    (* Second program: *)
    Block[{a, m = 125, s}, a = ConstantArray[{}, m]; s = {Prime@ PrimePi@ m}; Do[If[# <= m, If[FreeQ[a[[#]], Last@ s], a = ReplacePart[a, # -> Union@ Append[a[[#]], Last@ s]], Nothing]; AppendTo[s, Last@ s], If[Last@ s == 2, s = DeleteCases[s, 2]; If[Length@ s == 0, Break[], s = MapAt[Prime[PrimePi[#] - 1] &, s, -1]], s = MapAt[Prime[PrimePi[#] - 1] &, s, -1]]] &@ Total[s], {i, Infinity}]; TakeWhile[Map[FirstPosition[a, #][[1]] &, Rest@ NestList[Append[#, Prime[Length@ # + 1]] &, {}, Max[Length /@ a]]], IntegerQ]] (* Michael De Vlieger, Mar 11 2020 *)

Extensions

a(19)-a(21) from Michael De Vlieger, Mar 12 2020
a(22)-a(55) from Alois P. Heinz, Mar 12 2020

A332861 Primes p with the property that if q

Original entry on oeis.org

2, 3, 7, 13, 23, 31, 41, 79, 101, 107, 149, 163, 173, 191, 197, 269, 271, 293, 347, 419, 443, 523, 557, 647, 761, 769, 787, 1013, 1153, 1373, 1613, 1619, 1669, 1693, 1777, 1783, 1873, 2153, 2161, 2207, 2399, 2447, 2801, 2939, 2999, 3011, 3049, 3253, 3319, 3413
Offset: 1

Views

Author

David James Sycamore, Feb 27 2020

Keywords

Examples

			Prime 13 is a member, because the minimal primes in partitions of 13 into prime parts smaller than 13 occur at least twice: [2,2,2,2,2,3], [2,2,3,3,3], [2,2,2,2,5], [2,3,3,5], [2,2,2,7], [2,11], [3,3,7], [3,5,5]; 3 occurs twice, 2 occurs 6 times.
Prime 11 is not a member, because 3 occurs only once as a minimal prime in partitions of 11 into smaller primes: [2,2,2,2,3], [2,3,3,3], [2,2,2,5], [2,2,7], [3,3,5].
		

Crossrefs

Programs

  • Maple
    b:= proc(n, p, t) option remember; `if`(n=0, 1, `if`(p>n, 0, (q->
          add(b(n-p*j, q, 1), j=1..n/p)*t^p+b(n, q, t))(nextprime(p))))
        end:
    a:= proc(n) option remember; local p; p:= a(n-1); do
          p:= nextprime(p); if (f-> andmap(i-> coeff(f, x, i)
              <>1, [$2..p-1]))(b(p, 2, x)) then return p fi od
        end: a(1):=2:
    seq(a(n), n=1..33);  # Alois P. Heinz, Mar 13 2020
  • Mathematica
    b[n_, p_, t_] := b[n, p, t] = If[n == 0, 1, If[p > n, 0, With[{q = NextPrime[p]}, Sum[b[n - p j, q, 1], {j, 1, n/p}] t^p + b[n, q, t]]]];
    a[n_] := a[n] = Module[{p = a[n - 1]}, While[True, p = NextPrime[p]; If[AllTrue[Range[2, p-1], SeriesCoefficient[b[p, 2, x], {x, 0, #}] != 1&], Return [p]]]];
    a[1] = 2;
    Table[Print[n, " ", a[n]]; a[n], {n, 1, 33}] (* Jean-François Alcover, Nov 23 2020, after Alois P. Heinz *)

Extensions

a(13)-a(50) from Alois P. Heinz, Feb 28 2020

A335106 Irregular triangle T(n,k) is the number of times that prime(k) is the greatest part in a partition of n into prime parts; Triangle T(n,k), n>=0, 1 <= k <= max(1,A000720(A335285(n))), read by rows.

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 2, 1, 1, 1, 1, 2, 1, 0, 2, 2, 1, 1, 1, 2, 2, 2, 0, 2, 3, 2, 1, 1, 1, 2, 3, 3, 1, 0, 3, 4, 3, 1, 1, 1, 2, 4, 4, 2, 1, 0, 3, 5, 5, 2, 1, 1, 1, 3, 5, 5, 3, 2, 0, 3, 6, 7, 3, 2, 1, 1, 1, 3, 7, 7, 4, 3, 1, 0, 4
Offset: 0

Views

Author

Keywords

Comments

Let L(n) be the set of least part primes of all prime partitions of n, and let G(n) be corresponding set of greatest prime parts. All prime partitions, commencing with p in L(n) and terminating with q in G(n) can be shown as unique pathways on a partition tree of n; see link for details. |G(n)| = A000607(n).

Examples

			A000607(10) = 5 and the prime partitions of 10 are: (2,2,2,2,2), (2,2,3,3), (2,3,5), (5,5) and (3,7). Thus G(10) = {2,3,5,5,7}, and consequently row 10 is [1,1,2,1]. In the table below, for n >= 2,  0 is used to indicate when prime(k) is not in G(n) and is less than the greatest member of G(n), otherwise the entry for prime(k) not in G(n) is left empty. For n >= 2 the sum of entries in the n-th row is |G(n)| = A000607(n). Triangle T(n,k) begins:
0;
0;
1;
0, 1;
1;
0, 1, 1;
1, 1;
0, 1, 1, 1;
1, 1, 1;
0, 2, 1, 1;
1, 1, 2, 1;
0, 2, 2, 1, 1;
1, 2, 2, 2;
0, 2, 3, 2, 1, 1;
1, 2, 3, 3, 1;
0, 3, 4, 3, 1, 1;
1, 2, 4, 4, 2, 1;
0, 3, 5, 5, 2, 1, 1;
...
		

Crossrefs

Row sums gives A000607 for n > 1. Length of n-th row is A000720(A335285(n)) for n >1.
Number of partition of n in the first k primes: A059841 (k = 1), A103221 (k = 2), A025795 (k = 3), A029144 (k = 4), A140952 (k = 5), A140953 (k = 6).

Programs

  • Mathematica
    Flatten@ Block[{nn = 22, t}, t = Block[{s = {Prime@ PrimePi@ nn}}, KeySort@ Merge[#, Identity] &@ Join[{0 -> {}, 1 -> {}}, Reap[Do[If[# <= nn, Sow[# -> s]; AppendTo[s, Last@ s], If[Last@ s == 2, s = DeleteCases[s, 2]; If[Length@ s == 0, Break[], s = MapAt[Prime[PrimePi[#] - 1] &, s, -1]], s = MapAt[Prime[PrimePi[#] - 1] &, s, -1] ] ] &@Total[s], {i, Infinity}]][[-1, -1]] ] ]; Array[Function[p, If[! IntegerQ@ First@ p, {0}, Array[Count[p, Prime@ #] &, PrimePi@ Max@ p]]]@ Map[Max, t[[#]]] &, Max@ Keys@ t]] (* Michael De Vlieger, May 23 2020 *)
    row[0]={0}; row[k_] := Join[If[OddQ@k, {0}, {}], Last /@ Tally@ Sort[ First /@ IntegerPartitions[k, All, Prime@ Range@ PrimePi@ k]]]; Join @@ Array[row, 20, 0] (* Giovanni Resta, May 31 2020 *)

Extensions

More terms from Giovanni Resta, May 31 2020

A335285 a(n) is the greatest possible greatest part of any partition of n into prime parts.

Original entry on oeis.org

2, 3, 2, 5, 3, 7, 5, 7, 7, 11, 7, 13, 11, 13, 13, 17, 13, 19, 17, 19, 19, 23, 19, 23, 23, 23, 23, 29, 23, 31, 29, 31, 31, 31, 31, 37, 31, 37, 37, 41, 37, 43, 41, 43, 43, 47, 43, 47, 47, 47, 47, 53, 47, 53, 53, 53, 53, 59, 53, 61, 59, 61, 61, 61, 61, 67, 61, 67
Offset: 2

Views

Author

Keywords

Comments

For n odd, a(n) is the greatest prime <= n; for n even > 2, a(n) is the greatest prime < n-1.
For composite n = p + 1, p does not appear since 2 is the smallest prime. - Michael De Vlieger, May 31 2020

Examples

			a(9) = 7, the greatest prime < 9 (prime partitions of 9 are: [2,7], [2,2,5], [2,2,2,3] and [3,3,3], in which 7 is greatest of greatest parts).
a(12) = 7 (greatest prime < 11).
		

Crossrefs

Programs

  • Mathematica
    Array[Max@ Select[IntegerPartitions[#], AllTrue[#, PrimeQ] &][[All, 1]] &, 68, 2] (* Michael De Vlieger, May 30 2020 *)
    Array[Prime[PrimePi@ # - Boole[And[PrimeQ[# - 1], # != 3]]] &, 68, 2] (* Michael De Vlieger, May 31 2020 *)

A330433 Numbers k such that if there is a prime partition of k with least part p, then there exists at least one other prime partition of k with least part p.

Original entry on oeis.org

63, 161, 195, 235, 253, 425, 513, 581, 611, 615, 635, 667, 767, 779, 791, 803, 959, 1001, 1015, 1079, 1095, 1121, 1127, 1251, 1253, 1265, 1267, 1547, 1557, 1595, 1617, 1625, 1647, 1649, 1681, 1683, 1687, 1771, 1817, 1829, 1915, 1921, 2071, 2125, 2159, 2185
Offset: 1

Views

Author

David James Sycamore, Mar 01 2020

Keywords

Comments

If k is prime then [k] is the only prime partition of k with least part k, and therefore k cannot be in this sequence. If k > 2 is even, then (assuming the validity of Goldbach's conjecture) there is a prime partition [p,q] of k (p <= q) in which p is the greatest possible least part and therefore no other partition of k is possible with least part p, so k is not a term. Therefore all terms of this sequence are odd composites.

Examples

			9 is not a term because [3,3,3] is the only prime partition of 9 having 3 as least part.
63 is a term because every possible prime partition is accounted for as follows, where (m,p) means m partitions of 63 with least part p: (2198,2), (323,3), (60,5), (15,7), (5,11), (2,13), (2,17), (sum of m values = 2605 = A000607(63)). 63 must be in the sequence because (1,p) does not appear in this list, and is the smallest such number because every odd composite < 63 has at least one prime partition with unique least part (as for 9 above).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, p, t) option remember; `if`(n=0, 1, `if`(p>n, 0, (q->
          add(b(n-p*j, q, 1), j=1..n/p)*t^p+b(n, q, t))(nextprime(p))))
        end:
    a:= proc(n) option remember; local k; for k from a(n-1)+1
          while 1 in {coeffs(b(k, 2, x))} do od; k
        end: a(0):=1:
    seq(a(n), n=1..40);  # Alois P. Heinz, Mar 21 2020
  • Mathematica
    b[n_, p_, t_] := b[n, p, t] = If[n == 0, 1, If[p > n, 0, Function[q, Sum[b[n - p j, q, 1], {j, 1, n/p}] t^p + b[n, q, t]][NextPrime[p]]]];
    a[0] = 1;
    a[n_] := a[n] = Module[{k}, For[k = a[n-1]+1, MemberQ[CoefficientList[b[k, 2, x], x], 1], k++]; k];
    Table[Print[n, " ", a[n]]; a[n], {n, 1, 40}] (* Jean-François Alcover, Nov 26 2020, after Alois P. Heinz *)

A333417 a(n) is the greatest number k having for every prime <= prime(n) at least one prime partition with least part p, and no such partition having least part > prime(n). If no such k exists then a(n) = 0.

Original entry on oeis.org

4, 9, 16, 27, 35, 49, 63, 65, 85, 95, 105, 121, 135, 145, 169, 175, 187, 203, 207, 221, 253, 265, 273, 289, 301, 305, 319, 351, 369, 387, 403, 407, 425, 445, 473, 485, 495, 517, 529, 545, 551, 567, 611, 615, 629, 637, 671, 679, 693, 697, 725, 747, 781, 793, 799
Offset: 1

Views

Author

David James Sycamore, Mar 20 2020

Keywords

Comments

Alternatively a(n) is the greatest number whose product of distinct least part primes from all prime partitions of n, is equal to primorial(n). Companion sequence to A330507.
From Michael De Vlieger, Mar 20 2020: (Start)
a(n) = 0 for n = {90, 151, 349, 352, 444, ...}, cf. the comment from Alois P. Heinz at A330507.
Index m of last instance of A002110(n) in A333129 as m increases.
Last row n in A333238 that contains the consecutive primes (1...n).
Last index of the occurrence of 2^n - 1 in A333259, which is the decimal value of the characteristic function of primes in A333238 interpreted as a binary number. (End)

Examples

			a(1) = 4 because [2,2] is the only prime partition of 4, and no greater number n has only 2 as least part in any partition of n into primes.
From _Michael De Vlieger_, Mar 20 2020: (Start)
Looking at this sequence as the first position of 2^n - 1 in A333259, which in binary is a k-bit repunit, we look for the last occasion of such in A333259, indicated by the arrows. a(k) = n for rows n that have an arrow. In the chart, we reverse the portrayal of the binary rendition of A333259(n), replacing zeros with "." for clarity:
   n   A333259(n)            k
------------------------------
   2   1                     1
   3   . 1
   4   1                  -> 1
   5   1 . 1
   6   1 1                   2
   7   1 . . 1
   8   1 1                   2
   9   1 1                -> 2
  10   1 1 1                 3
  11   1 1 . . 1
  12   1 1 1                 3
  13   1 1 . . . 1
  14   1 1 . 1
  15   1 1 1                 3
  16   1 1 1              -> 3
  17   1 1 1 . . . 1
  18   1 1 1 1               4
  19   1 1 1 . . . . 1
  20   1 1 1 1               4
  ... (End)
		

Crossrefs

Programs

  • Mathematica
    With[{s = TakeWhile[Import["https://oeis.org/A333259/b333259.txt", "Data"], Length@ # > 0 &][[All, -1]]}, Array[If[Length[#] == 0, 0, #[[-1, 1]] - 1] &@ Position[s, 2^# - 1] &, 55]] (* Michael De Vlieger, Mar 20 2020, using the b-file at A333259 *)

Extensions

More terms from Michael De Vlieger, Mar 20 2020

A333636 a(n) is the greatest least part of a partition of n into prime parts which does not divide n, or 0 if no such prime exists.

Original entry on oeis.org

0, 0, 0, 2, 0, 2, 3, 2, 3, 3, 5, 3, 3, 2, 5, 5, 7, 5, 7, 5, 5, 5, 11, 7, 7, 7, 11, 7, 13, 7, 13, 7, 11, 11, 17, 11, 7, 11, 17, 11, 19, 13, 13, 13, 17, 13, 19, 13, 19, 13, 23, 17, 23, 17, 19, 17, 17, 17, 29, 19, 19, 17, 23, 19, 29, 19, 31, 19, 29, 19, 31, 19, 31, 23, 29, 23, 37, 19, 37, 23, 29, 23, 41
Offset: 2

Views

Author

David James Sycamore, Mar 30 2020

Keywords

Comments

For n = 2,3,4,6 a(n) = 0. For n > 6 there are no terms a(n) = 0, and therefore n has at least one prime partition whose least part prime does not divide n. This sequence lists the greatest such prime for each n. The indices of the records of this sequence are in A001043.

Examples

			The only prime partition of 2 is [2], but 2|2, so a(2) = 0. Also, since [2,2,2] and [3,3] are the prime partitions of 6, with 2|6 and 3|6, a(6) = 0. The prime partitions of 5 are [2,3] and [5], but 2 does not divide 5 so a(5) = 2.
From _Michael De Vlieger_, Apr 01 2020: (Start)
Chart showing terms k in rows 5 <= n <= 24 of A333238, plotted at pi(k), with "." replacing terms k | n. In the table, we place a(n) in parenthesis:
   n   k
  -------------------
   5  (2)      .
   6   .   .
   7  (2)          .
   8   .  (3)
   9  (2)  .
  10   .  (3)  .
  11   2  (3)          .
  12   .   .  (5)
  13   2  (3)              .
  14   .  (3)      .
  15  (2)  .   .
  16   .   3  (5)
  17   2   3  (5)              .
  18   .   .   5  (7)
  19   2   3  (5)                  .
  20   .   3   .  (7)
  21   2   .  (5)  .
  22   .   3  (5)      .
  23   2   3  (5)                      .
  24   .   .   5   7  (11)
  ... (End)
		

Crossrefs

Programs

  • Mathematica
    Block[{m = 84, s, a}, a = ConstantArray[{}, m]; s = {Prime@ PrimePi@ m}; Do[If[# <= m, If[And[FreeQ[a[[#]], Last[s]], Mod[#, Last[s]] != 0], a = ReplacePart[a, # -> Union@ Append[a[[#]], Last@ s]], Nothing]; AppendTo[s, Last@ s], If[Last@ s == 2, s = DeleteCases[s, 2]; If[Length@ s == 0, Break[], s = MapAt[Prime[PrimePi[#] - 1] &, s, -1]], s = MapAt[Prime[PrimePi[#] - 1] &, s, -1]]] &@ Total[s], {i, Infinity}]; Map[If[Length[#] == 0, 0, Last@ #] &, Rest@ a]] (* Michael De Vlieger, Apr 01 2020 *)
Showing 1-8 of 8 results.