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-17 of 17 results.

A107393 a(n) = -1 if n is a prime, else a(n) = 1 if n is the sum of three odd primes, else a(n) = 2 if n is the sum of two primes, else a(n) = 0.

Original entry on oeis.org

0, 0, -1, -1, 2, -1, 2, -1, 2, 1, 2, -1, 2, -1, 2, 1, 2, -1, 2, -1, 2, 1, 2, -1, 2, 1, 2, 1, 2, -1, 2, -1, 2, 1, 2, 1, 2, -1, 2, 1, 2, -1, 2, -1, 2, 1, 2, -1, 2, 1, 2, 1, 2, -1, 2, 1, 2, 1, 2, -1, 2, -1, 2, 1, 2, 1, 2, -1, 2, 1, 2, -1, 2, -1, 2, 1, 2, 1, 2, -1, 2, 1, 2, -1, 2, 1, 2, 1, 2, -1, 2, 1, 2, 1, 2, 1, 2, -1, 2, 1, 2
Offset: 0

Views

Author

Giovanni Teofilatto, May 25 2005

Keywords

Comments

A less natural variant of A051034, which counts the minimal number of primes that add up to n. The Goldbach conjecture implies that a(n) is nonzero for all n > 1.
The original definition was: "a(n) = -1 iff n is a prime, a(n) = 1 iff n is equal to the sum of three primes, a(n) = 2 iff n is equal to the sum of two primes, else a(n) = 0." However, the "iff"s do not make sense since all conditions can hold simultaneously. a(9) = 0 was obviously erroneous. More of the original data requires correction if "odd" is omitted in the second and/or added in the third condition, or if the conditions are tested in a different order.

Examples

			a(9) = 1 because 9 is not a prime but it is the sum of three odd primes, 9 = 3 + 3 + 3.
		

Crossrefs

Cf. A051034.

Programs

  • PARI
    a(n)={isprime(n)&&return(-1);forprime(p=3,n\3,forprime(q=p,(n-p)\2,isprime(n-p-q)&&return(1)));(n>1)*2}

Extensions

Edited, definition and a(9) corrected (following discussion and observations from several other Editors) by M. F. Hasler, Jan 08 2018

A112418 Primes which have a prime number of partitions into five distinct primes.

Original entry on oeis.org

53, 59, 67, 83, 113, 151, 157, 211, 239, 601, 809, 821, 881, 971, 1237, 1297, 1427, 1669, 1759, 1973, 2069, 2129, 2243, 2333, 2659, 2677, 2719, 2789, 2803, 2999, 3329, 3613, 3623, 3769, 3797, 4001, 4451
Offset: 1

Views

Author

Keywords

Comments

The corresponding numbers of partitions are 2,5,11,29,109,331,379,1091...

Examples

			53 is there because there are 2 partitions of 53 (3+7+11+13+19, 5+7+11+13+17) and 2 is prime.
		

Crossrefs

Programs

  • Maple
    part5_prime:=proc(N) s:=1; for n from 2 to N do cont:=0; for i from 1 to n-5 do for j from i+1 to n-4 do for k from j+1 to n-3 do for l from k+1 to n-2 do for m from l+1 to n-1 do if(ithprime(n)= ithprime(i)+ithprime(j)+ithprime(k)+ithprime(l)+ithprime(m) then cont:=cont+1; fi; od; od; od; od; od; if (isprime(cont)=true) then a[s]:=ithprime(n); s:=s+1; fi; od; end:
  • PARI
    has(n)=my(t,Q,R,S);forprime(p=n\5+1,n-26, Q=n-p; forprime(q=Q\4+1,min(p-1,Q-15), R=Q-q; forprime(r=R\3+1,min(q-1,R-8), S=R-r; forprime(s=S-r+1,(S-1)\2, isprime(S-s) && t++)))); isprime(t)
    select(has, primes(100)) \\ Charles R Greathouse IV, Apr 22 2015
    
  • PARI
    list(lim)=my(v=vectorsmall(precprime(lim)),u=List(),Q,R,S); forprime(p=13,#v-26, Q=#v-p; forprime(q=11,min(p-1,Q-15), R=Q-q; forprime(r=7,min(q-1,R-8), S=R-r; forprime(s=5,min(S-2,r-1), forprime(t=3,min(S-s,s-1), v[p+q+r+s+t]++))))); forprime(p=2,lim, if(isprime(v[p]), listput(u,p))); Set(u) \\ Charles R Greathouse IV, Apr 22 2015

Extensions

Edited by Don Reble, Jan 26 2006
a(31)-a(37) from Charles R Greathouse IV, Apr 22 2015

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 *)

A104230 Minimal number of primes needed to sum to n^2.

Original entry on oeis.org

2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 3, 2, 3, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 3, 2, 2, 2, 3, 2, 2, 2, 2, 2, 3, 2, 3, 2, 2, 2, 3, 2, 3, 2, 2, 2, 2, 2, 3, 2, 3, 2, 2, 2
Offset: 2

Views

Author

Giovanni Teofilatto, Apr 02 2005

Keywords

Comments

For the Goldbach conjecture every even number that is greater than 2 is the sum of three primes and odd number is the sum of three primes, no term is greater 3.

Examples

			a(2)=2 because 2^2=2+2;
a(3)=2 because 3^2=2+7.
		

Formula

a(n) = A051034(A000290(n)). - Michel Marcus, Jun 04 2013

Extensions

Corrected and extended by Michel Marcus, Jun 04 2013

A290397 Least number of nonprime squarefree numbers (A000469) that add up to n.

Original entry on oeis.org

1, 2, 3, 4, 5, 1, 2, 3, 4, 1, 2, 2, 3, 1, 1, 2, 3, 3, 4, 2, 1, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 1, 1, 1, 2, 2, 1, 1, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2, 1, 2, 1, 1, 2, 2, 2, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 2, 1, 2, 2, 1, 1, 2, 2, 2, 1, 2, 2, 1, 1, 1, 2
Offset: 1

Views

Author

Ilya Gutkovskiy, Jul 29 2017

Keywords

Comments

It is conjectured that a(n) <= 5.

Examples

			a(6) = 1 because 6 is already nonprime squarefree number.
a(7) = 2 because 7 = 6 + 1 is a partition of 7 into 2 nonprime squarefree parts and there is no such partition with fewer terms.
		

Crossrefs

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

A338630 Least number of odd primes that add up to n, or 0 if no such representation is possible.

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 3, 2, 3, 2, 1, 2, 1, 2, 3, 2, 3, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 3, 2, 3, 2, 1, 2, 3, 2, 3, 2, 1, 2, 1, 2, 3, 2, 3, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 3, 2, 1, 2, 3, 2, 1, 2, 3, 2, 3, 2, 1, 2, 3, 2, 3, 2, 3, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2
Offset: 1

Views

Author

Ilya Gutkovskiy, Nov 04 2020

Keywords

Examples

			a(9) = 3 because 9 = 3 + 3 + 3 is a partition of 9 into 3 odd prime parts and there is no such partition with fewer terms.
		

Crossrefs

Programs

  • Mathematica
    Block[{f, a}, f[m_] := Block[{s = {Prime@ PrimePi@ m}}, KeySort@ Merge[#, Identity] &@ Reap[Do[If[# <= m, Sow[# -> s]; AppendTo[s, Last@ s], If[Last@ s == 3, s = DeleteCases[s, 3]; 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]] ]; a = f[105]; Array[If[KeyExistsQ[a, #], Min@ Map[Length, Lookup[a, #]], 0] &, Max@ Keys@ a]] (* Michael De Vlieger, Nov 04 2020 *)
Previous Showing 11-17 of 17 results.