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 101-110 of 172 results. Next

A218469 Number of partitions of n into at most three distinct primes (including 1).

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 2, 3, 2, 3, 2, 3, 3, 4, 3, 4, 3, 5, 5, 6, 5, 5, 5, 6, 6, 6, 5, 4, 6, 6, 9, 7, 7, 6, 8, 7, 10, 6, 8, 5, 10, 8, 12, 9, 10, 7, 13, 9, 14, 10, 12, 7, 15, 9, 17, 9, 13, 6, 17, 10, 21, 10, 15, 8, 19, 11, 22, 9, 16, 8, 24, 12, 25, 12, 19, 10, 26, 12
Offset: 1

Views

Author

Frank M Jackson, Mar 26 2013

Keywords

Comments

Using {1 union primes} as the base, the above sequence relies on the strong Goldbach's conjecture that any positive integer is the sum of at most three distinct terms.

Examples

			a(21)=5 as 21 = 2+19 = 1+3+17 = 1+7+13 = 3+5+13 = 3+7+11.
		

Crossrefs

Programs

  • Mathematica
    primeQ[p0_] := If[p0==1, True, PrimeQ[p0]]; SetAttributes[primeQ, Listable]; goldbachcount[p1_] := (parts=IntegerPartitions[p1, 3]; count=0; n=1; While[n<=Length[parts], If[Intersection[Flatten[primeQ
      [parts[[n]]]]][[1]]&&Total[Intersection[parts[[n]]]]==Total[parts
      [[1]]], count++]; n++]; count); Table[goldbachcount[i], {i, 1, 100}]

A219025 Number of primes p

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Nov 10 2012

Keywords

Comments

Conjecture: a(n)>0 for all n=6,7,...
This has been verified for n up to 10^8.
Zhi-Wei Sun also made the following general conjecture:
Let P(x) be any non-constant integer-valued polynomial with positive leading coefficient. If n is large enough, then there is a prime p
See also A219023 for similar conjectures.

Examples

			a(11)=2 since the 5 and 7 are the only primes p<11 with 66-p and 66+p both prime.
		

Programs

  • Mathematica
    a[n_]:=a[n]=Sum[If[PrimeQ[6n-Prime[k]]==True&&PrimeQ[6n+Prime[k]]==True,1,0],{k,1,PrimePi[n-1]}]
    Do[Print[n," ",a[n]],{n,1,20000}]

A219966 Number of ways to write n=p+q+(n mod 2)q with q<=n/2 and p, q, q+6 all prime.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 1, 3, 2, 2, 3, 2, 3, 3, 2, 1, 4, 3, 1, 4, 3, 1, 4, 2, 3, 3, 2, 2, 4, 3, 2, 4, 2, 2, 5, 3, 4, 5, 2, 1, 5, 3, 2, 4, 1, 1, 5, 4, 4, 4, 3, 2, 5, 3, 2, 4, 3, 4, 5, 3, 4, 6, 3, 3, 6, 3, 3, 8, 5, 2, 6, 3, 4, 6, 2, 2, 9, 5, 3, 5, 4, 2, 6, 4
Offset: 1

Author

Zhi-Wei Sun, Dec 02 2012

Keywords

Comments

Conjecture: a(n)>0 for all n>11.
This conjecture is stronger than Goldbach's conjecture and Lemoine's conjecture. It can be further strengthened; see A219055 and the comments there.

Examples

			a(19)=1 since 19=5+2*7 with 5, 7, 7+6 all prime.
a(20)=1 since 20=13+7 with 13, 7, 7+6 all prime.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=a[n]=Sum[If[PrimeQ[Prime[k]+6]==True&&PrimeQ[n-(1+Mod[n,2])Prime[k]]==True,1,0],{k,1,PrimePi[n/2]}]
    Do[Print[n," ",a[n]],{n,1,10000}]

A230762 List of commonest number of decompositions of 2k into an unordered sum of two odd primes in range 3 <= k <= m, integer m >= 3, where m is explained below.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 9, 11, 18, 27, 44, 48, 52, 58, 61, 75, 77, 98, 141, 165, 200, 231, 337, 360, 378, 384, 466, 517, 697, 880, 1061, 1400, 1503, 1615, 1700, 1896, 2082, 2163, 3242, 3929, 4232, 5373
Offset: 1

Author

Lei Zhou, Oct 29 2013

Keywords

Comments

If making a statistical bar chart with x-axis denoting the number of decompositions of an even number, and y-axis denoting the number of hits of an x-axis value for all 3 <= k <= m, there are one or more commonest x value presenting with highest y value. Such commonest x values increase when m increases, and fall on the x values listed in this sequence.
Hypothesis: With the increase of m, the commonest number of decompositions of 2n into an unordered sum of two odd primes in the range of 3 <= k <= m ascends.
This hypothesis derives that the corresponding smallest m to the terms of this sequence makes an ascending sequence. Or say, when testing with m ascending, once a number a(n) enters this sequence, no number smaller than a(n) will be able to enter this sequence if they had not enter previous.

Examples

			When m=3, k has only one value 3, 2k=6=3+3.  Only one possible decomposition, making a decomposition statistics {{x,y}}={{1,1}}.  So a(1)=1;
When m=4, k gets another value 4, 2k=8=3+5. The decomposition statistics {{x,y}}={{1,2}};...
Thereafter, k=5 makes 2k=10=5+5=3+7, {{x,y}}={{1,2},{2,1}}, the commonest value is still 1.
k=6, 2k=12=5+7, {{x,y}}={{1,3},{2,1}}, commonest x is still 1.
k=7, 2k=14=3+11=7+7, {{x,y}}={{1,3},{2,2}}, commonest x is still 1.
k=8, 2k=16=3+13=5+11, {{x,y}}={{1,3},{2,3}}, except for 1, 2 is now eligible to be the new possible commonest x, so a(2)=2.
...
Counting up to k=28, the decomposition statistics is {{1,3},{2,8},{3,8},{4,5},{5,2}}, 2 and 3 are now the commonest decompositions. It is the first time for 3 to appear.  So a(3)=3.
		

Crossrefs

Cf. A002375.

Programs

  • Mathematica
    check=0;posts={};mpos=0;res={};sres=0;s={};size=0;k=2;
    While[k++;k2=2*k;p2=k-1;ct=0;
      While[p2=NextPrime[p2];p2size, Do[AppendTo[s,0],{i,size+1,ct}]; size=ct];
      (*and construct statistics in array s*)
      s[[ct]]++;m=Max[s];aa=Position[s,m];la=Length[aa];
      Do[a=aa[[pos,1]];
        If[a>sres,
          While[sres
    				

Extensions

Lei Zhou, Nov 08 2013, uploaded a b-file extending the known elements of this sequence to the 45th.

A237353 For n=g+h, a(n) is the minimum value of omega(g)+omega(h).

Original entry on oeis.org

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

Author

Lei Zhou, Feb 06 2014

Keywords

Comments

omega(g) is defined in A001221.
If Goldbach's conjecture is true, all items with even index of this sequence is less than or equal to 2.
This sequence is defined for n >= 2.
It is conjectured that the maximum value of this sequence is 3.
2=1+1 makes the only zero term of this sequence a(2)=0.
This sequence gets a(n)=1 when n=1+p^k, where p is a prime number and k >= 1.

Examples

			For n=2, 2=1+1. 1 does not have prime factor. So a(2)=0+0=0;
For n=6, 6=1+5.  1 does not have prime factor where 5 has one. Another case 6=3+3 yields sum of prime factors of g and h 1+1=2.  Since 1 < 2, according to the definition, we chose the smaller one. So a(6)=1;
For n=7, 7=2+5.  Both 2 and 5 have one prime factor.  So a(7)=1+1=2;
For n=331, one of the case is 331=2+329=2+7*47.  In which 2 has one prime factor, and 329 has two.  So a(331)=1+2=3.
		

Crossrefs

Programs

  • Mathematica
    Table[ct = n; Do[h = n - g; c = Length[FactorInteger[g]] + Length[FactorInteger[h]]; If[g == 1, c--]; If[h == 1, c--]; If[c < ct, ct = c], {g, 1, Floor[n/2]}]; ct, {n, 2, 88}]
    Table[ Min@Table[PrimeNu[ n - k ] + PrimeNu[  k  ], {k, n - 1}], {n, 2, 88}]
  • Sage
    def a(n): return min(A001221(a)+A001221(n-a) for a in range(1,floor(n/2)+1)) # Ralf Stephan, Feb 23 2014

A237638 a(n) is the number of prime sets such that each set contains enough prime numbers to decompose every even number from 6 to 2n into the sum of two of its elements (reuse allowed), while none of the sets is a subset of another such set.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 3, 4, 4, 5, 6, 6, 9, 11, 11, 11, 13, 16, 23, 25, 31, 47, 57, 63, 70, 74, 79, 82, 122, 131, 129, 180, 215, 219, 323, 367, 446, 501, 531, 661, 867, 897, 1311, 1471, 1691, 1695, 2130, 2288, 2833, 3363, 3891, 5435, 8068, 8867, 13476, 15451, 15897
Offset: 3

Author

Lei Zhou, May 02 2014

Keywords

Examples

			n=4, 2n=8. There is only one set of primes {3,5} such that 6=3+3, 8=3+5. So a(4)=1.
...
n=8, 2n=16. We can find two sets, {3,5,7,11} and {3,5,7,13} that have such features. So a(8)=2. Here any set with more primes either contains an unused prime number or one of these two sets is a subset of them, like {3,5,7,11,13}, and thus is not considered. So a(8)=2.
...
n=13, 2n=26. Five such sets are found: {3,5,7,11,13}, {3,5,7,13,17},{3,5,7,13,19}, {3,5,7,11,17,19}, {3,5,7,11,17,23}. So a(13)=5.
		

Crossrefs

Programs

  • Mathematica
    a = {{{3}}}; Table[n2 = 2*n; na = {}; la = Last[a]; lo = Length[la]; Do[ok = 0; Do[p1 = la[[i, j]]; p2 = n2 - p1; If[MemberQ[la[[i]], p2], ok = 1], {j, 1, Length[la[[i]]]}];
      If[ok == 1, na = Sort[Append[na, la[[i]]]], Do[p1 = la[[i, j]]; p2 = n2 - p1; If[PrimeQ[p2], ng = Sort[Append[la[[i]], p2]]; big = 0; If[Length[na] > 0, Do[If[Intersection[na[[k]], ng] == na[[k]], big = 1], {k, 1, Length[na]}]]; If[big == 0, na = Sort[Append[na, ng]]]], {j, 1, Length[la[[i]]]}]], {i, 1, lo}]; AppendTo[a, na]; Length[na], {n, 4, 60}](* Program lists the 4th item and beyond *)

A238268 The number of unordered ways that n can be written as the sum of two numbers of the form p or 2p, where p is prime.

Original entry on oeis.org

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

Author

Lei Zhou, Feb 21 2014

Keywords

Comments

p and 2p are terms of A001751.
Sequence defined for n >= 4.
It is conjectured that all terms of this sequence are greater than zero.

Examples

			n=4, 4=2+2, one case found. So a(4)=1;
...
n=24, 24 = 2+2*11 = 5+19 = 7+17 = 2*5+2*7 = 11+13, 5 cases found.  So a(24)=5;
...
n=33, 33 = 2+31 = 2*2+29 = 7+2*13 = 2*5+23 = 11+2*11 = 2*7+19, 6 cases found.  So a(33)=6.
		

Crossrefs

Programs

  • Mathematica
    Table[ct = 0; Do[If[((PrimeQ[i]) || (PrimeQ[i/2])) && ((PrimeQ[n - i]) || (PrimeQ[(n - i)/2])), ct++], {i, 2, Floor[n/2]}]; ct, {n, 4, 89}]
  • PARI
    isp(i) = isprime(i) || (((i % 2) == 0) && isprime(i/2));
    a(n) = sum(i=1, n\2, isp(i) && isp(n-i)); \\ Michel Marcus, Mar 07 2014

A239617 Number of ways to write 2*n = p + q with p, q and pi(2*p) - pi(p) all prime, where pi(x) denotes the number of primes not exceeding x.

Original entry on oeis.org

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

Author

Zhi-Wei Sun, Mar 22 2014

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 4.
(ii) Each integer n > 5 can be written as p + q (q > 0) with p and pi(2*q) - pi(q) both prime.
(iii) Any integer n > 2 not equal to 11 can be written as p + q with p prime and pi(2*q) - pi(q) a square.
Part (i) is a refinement of Goldbach's conjecture. It implies that there are infinitely many primes p with pi(2*p) - pi(p) prime.

Examples

			a(5) = 1 since 2*5 = 7 + 3 with 7, 3 and pi(2*7) - pi(7) = 6 - 4 = 2 all prime.
a(6) = 1 since 2*6 = 7 + 5 with 7, 5 and pi(2*7) - pi(7) = 2 all prime.
a(11) = 1 since 2*11 = 11 + 11 with 11 and pi(2*11) - pi(11) = 8 - 5 = 3 both prime.
a(16) = 1 since 2*16 = 13 + 19 with 13, 19 and pi(2*13) - pi(13) = 9 - 6 = 3 all prime.
a(23) = 1 since 2*23 = 23 + 23 with 23 and pi(2*23) - pi(23) = 14 - 9 = 5 both prime.
a(44) = 1 since 2*44 = 59 + 29 with 59, 29 and pi(2*59) - pi(59) = 30 - 17 = 13 all prime.
a(166) = 1 since 2*166 = 103 + 229 with 103, 229 and pi(2*103) - pi(103) = 46 - 27 = 19 all prime.
		

Crossrefs

Programs

  • Mathematica
    p[n_,k_]:=PrimeQ[PrimePi[2*Prime[k]]-k]&&PrimeQ[2n-Prime[k]]
    a[n_]:=Sum[If[p[n,k],1,0],{k,1,PrimePi[2n-1]}]
    Table[a[n],{n,1,80}]

A240713 Number of decompositions of 2n=p1+p2 (prime p1 <= p2), where at least one other such pair 2n=p3+p4 (prime p3 <= p4) exists such that |p1-p3|= 6 or 12.

Original entry on oeis.org

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

Author

Lei Zhou, Apr 10 2014

Keywords

Comments

It is conjectured that a(n)=0 only when n=1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 16, 34, 76, 229.
The 2n decompositions counted in this sequence are a subset of 2n decompositions as of in Goldbach conjecture (A002375).
Per definition, all nonzero terms are greater than 1.

Examples

			For n = 11, 2n=22. 22 = 3 + 19 = 5 + 17 = 11 + 11. |5-11|=6 so pair 5+17 and 11+11 are counted. So a(11)=2.
...
For n = 17, 2n=34. 34 = 3 + 31 = 5 + 29 = 11 + 23 = 17 + 17. |5-11|=6, so 5+29 and 11+23 are counted. Also since |11-17|=6, 17+17 is also counted (where 11+23 is already counted). In case |5-17|=12, both instances are already counted. So overall three instances are found. a(17)=3.
		

Crossrefs

Programs

  • Mathematica
    Table[s = 2*n; ct = 0; p = 1; While[p = NextPrime[p]; p <= n, If[PrimeQ[s - p], ok = 0; a1 = p - 12; b1 = s - a1; a2 = p - 6; b2 = s - a2; a3 = p + 6; b3 = s - a3; a4 = p + 12; b4 = s - a4; If[a1 > 0, If[PrimeQ[a1] && PrimeQ[b1], ok = 1]]; If[a2 > 0, If[PrimeQ[a2] && PrimeQ[b2], ok = 1]]; If[a3 <= n, If[PrimeQ[a3] && PrimeQ[b3], ok = 1]]; If[a4 <= n, If[PrimeQ[a4] && PrimeQ[b4], ok = 1]]; If[ok == 1, ct++]]]; ct, {n, 1, 85}]

A240718 Number of decompositions of 2n into an unordered sum of two primes, one of the two primes less than sqrt(2n-2).

Original entry on oeis.org

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

Author

Lear Young, Apr 11 2014

Keywords

Examples

			For n = 7, the a(7) = 1 solution is 2*7 = 3 + 11 = 7 + 7; one of these pairs, 3 + 11, contains a number less than sqrt(2*7 - 2).
		

Crossrefs

Cf. A002375.

Programs

  • Maple
    P:= NULL: A[1]:= 0: nextp:= 2:
    for n from 2 to 100 do
     while nextp^2 < 2*n-2 do
       P:= P, nextp;
       nextp:= nextprime(nextp);
     od;
     A[n]:= numboccur(true, map(t -> isprime(2*n-t), [P]))
    od:
    seq(A[i],i=1..100); # Robert Israel, Apr 30 2019
  • PARI
    a(n)=sum(i=2,primepi(floor(sqrt(2*n-2))),isprime(2*n-prime(i))) \\ Lear Young, Apr 11 2014
Previous Showing 101-110 of 172 results. Next