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 71-80 of 172 results. Next

A071635 Number of decompositions of 4*n+2 into sum of two primes of form 4*k+1.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, May 27 2002

Keywords

Comments

For a(m)=0 see A071636.

Examples

			a(10)=2 as 4*10+2 = 42 = 5+37 = (4*1+1)+(4*9+1) = 13+29 = (4*3+1)+(4*7+1) and the other two decompositions 42 = 11+31 = (4*2+3)+(4*7+3) = 19+23 = (4*4+3)+(4*5+3), A002375(21)=4.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{s = 0}, For[p = 3, p <= 2n+1, p = NextPrime[p], If[Mod[p, 4] == 1 && PrimeQ[4n+2-p], s++]]; s];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Dec 17 2021, after Andrew Howroyd *)
  • PARI
    a(n)={my(s=0); forprime(p=3, 2*n+1, if(p%4==1 && isprime(4*n+2-p), s++)); s} \\ Andrew Howroyd, Feb 02 2020

Formula

a(n) = A002375(2*n+1) - A156642(n). - Vladimir Shevelev, Feb 12 2009

A108421 Smallest number of ones needed to write in binary representation 2*n as sum of two primes.

Original entry on oeis.org

2, 4, 4, 4, 5, 5, 5, 5, 4, 4, 5, 6, 5, 5, 6, 4, 5, 6, 5, 5, 5, 5, 6, 6, 6, 5, 6, 5, 6, 7, 7, 7, 8, 5, 5, 6, 5, 5, 6, 6, 5, 6, 6, 5, 6, 6, 7, 8, 5, 5, 6, 6, 6, 6, 7, 5, 6, 6, 7, 8, 7, 7, 8, 6, 7, 5, 5, 6, 5, 5, 6, 6, 5, 6, 6, 5, 6, 7, 7, 7, 6, 6, 6, 6, 6, 6, 7, 6, 6, 7, 7, 7, 8, 7, 8, 6, 5, 5, 6, 6, 6, 6, 7, 5, 6
Offset: 2

Views

Author

Reinhard Zumkeller, Jun 03 2005

Keywords

Comments

a(n) = Min{A000120(p)+A000120(q) : p,q prime and p+q=2*n}.
a(n) = A108422(n) - A108423(n).
a(n) >= A000120(n)+1, with equality for n in A241757. - Robert Israel, Mar 25 2018

Examples

			n=15: 2*15=30 and A002375(15)=3 with 30=7+23=11+19=13+17,
13+17 -> 1101+10001 needs a(15)=5 binary ones, whereas
7+23 -> 111+10111 and 11+19 -> 1011+10011 need more.
		

Crossrefs

Programs

  • Maple
    N:= 200: # to get a(2)..a(N)
    Primes:= select(isprime, [seq(i,i=3..2*N-3,2)]):
    Ones:= map(t -> convert(convert(t,base,2),`+`), Primes):
    V:= Vector(N): V[2]:= 2:
    for i from 1 to nops(Primes) do
      p:= Primes[i];
      for j from 1 to i do
        k:= (p+Primes[j])/2;
        if k > N then break fi;
        t:= Ones[i]+Ones[j];
        if V[k] = 0 or t < V[k] then V[k]:= t fi
      od
    od:
    convert(V[2..N],list); # Robert Israel, Mar 25 2018
  • Mathematica
    Min[#]&/@(Table[Total[Flatten[IntegerDigits[#,2]]]&/@Select[ IntegerPartitions[ 2*n,{2}],AllTrue[#,PrimeQ]&],{n,2,110}]) (* Harvey P. Dale, Jul 27 2020 *)

A155216 Number of decompositions of positive even numbers 2n into unordered sums of a prime and a prime or semiprime (Chen's partitions).

Original entry on oeis.org

0, 1, 2, 2, 2, 3, 3, 4, 3, 4, 5, 5, 6, 7, 4, 6, 6, 7, 8, 8, 7, 8, 9, 8, 8, 10, 9, 10, 10, 10, 13, 11, 10, 12, 11, 12, 12, 14, 12, 13, 14, 13, 13, 15, 13, 15, 15, 17, 16, 15, 15, 15, 16, 18, 16, 16, 18, 17, 19, 17, 20, 19, 19, 18, 18, 20, 19, 20, 21, 20, 18, 22, 21, 22, 20, 23, 19, 22
Offset: 1

Views

Author

Vladimir Shevelev, Jan 22 2009

Keywords

Comments

According to Chen's result, the terms of this sequence are positive, at least for sufficiently large n.

References

  • J. R. Chen, On the representation of a large even integer as the sum of a prime and the product of at most two primes, Kexue Tongbao, 17(1966), 385-386.
  • J. R. Chen, On the representation of a larger even integer as the sum of a prime and the product of at most two primes, Sci. Sinica, 16(1973), 157-176.
  • P. M. Ross, On Chen's theorem that each large even number has the form (p1+p2) or (p1+p2p3), J. London Math. Soc. (2) 10(1975), 500-506.

Crossrefs

Programs

  • Maple
    A155216 := proc(n) local a,p,q,twon ; twon := 2*n ; a := 0 ; for i from 1 do p := ithprime(i) ; if ithprime(i) > twon then break; end if; q := twon -ithprime(i) ; if isprime(q) and q>= p then a := a+1 ; end if; end do: for i from 1 do p := ithprime(i) ; if ithprime(i) > twon then break; end if; q := twon -ithprime(i) ; if isA001358(q) then a := a+1 ; end if; end do: return a; end proc: seq(A155216(n),n=1..80) ; # R. J. Mathar, Jul 26 2010
  • Mathematica
    a[n_] := Module[{k = 0, p, q}, For[i = 1, True, i++, p = Prime[i]; If[p > 2n, Break[]]; q = 2n - Prime[i]; If[PrimeQ[q] && q >= p, k++]]; For[i = 1, True, i++, p = Prime[i]; If[p > 2n, Break[]]; q = 2n - Prime[i]; If[ PrimeOmega[q] == 2, k++]]; k];
    Array[a, 80] (* Jean-François Alcover, Nov 28 2017, after R. J. Mathar *)

Formula

For n >= 2, a(n) = Sum_{3<=p<=n, p prime} A(2*n - p) + Sum_{t<=2*n, t odd semiprime} A(2*n - t) + A(n) - binomial(A(n),2) + delta(n) - a(n-1) - ... - a(1), where A(n) = A033270(n), delta(n) = 1, if n is prime, and delta(n) = 2, if n is a composite number. - Vladimir Shevelev, Jul 11 2013

Extensions

Terms beyond a(21) from R. J. Mathar, Jul 26 2010

A156642 Number of decompositions of 4n+2 into unordered sums of two primes of the form 4k+3.

Original entry on oeis.org

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

Views

Author

Vladimir Shevelev, Feb 12 2009

Keywords

Comments

Conjecture. For n >= 1, a(n) > 0. This conjecture does not follow from the validity of the Goldbach binary conjecture because numbers of the form 4n+2, generally speaking, also have decompositions into sums of two primes of the form 4k+1.

Examples

			From _Lei Zhou_, Mar 19 2013: (Start)
n=1: 4n+2=6, 6=3+3; this is the only case that matches the definition, so a(1)=1;
n=3: 4n+2=14, 14=3+11=7+7; two instances found, so a(3)=2. (End)
		

Crossrefs

Programs

  • Mathematica
    Table[m = 4*n + 2; p1 = m + 1; ct = 0; While[p1 = p1 - 4; p2 = m - p1; p1 >= p2, If[PrimeQ[p1] && PrimeQ[p2], ct++]]; ct, {n, 1, 100}] (* Lei Zhou, Mar 19 2013 *)

A219026 Number of primes p<=n such that 2n-p and 2n+p-2 are both prime.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Nov 10 2012

Keywords

Comments

Conjecture: a(n)>0 except for n=1,2,4,6,10,22,57.
This is stronger than the Goldbach conjecture; it has been verified for n up to 5*10^7.
Zhi-Wei Sun also conjectured that if n is not among 1,2,3,5,8,87,108 then there is a prime p in (n,2n)
such that 2n-p and 2n+p-2 are both prime. For conjectures in Section 2 of arXiv:1211.1588, he had similar conjectures with p<=n replaced by p in (n,2n)
For example, if n is not among 1,2,4,6,10,15 then there is a prime p in (n,2n) such that
2n-p and 2n+p+2 are both prime.

Examples

			a(8)=2 since 3 and 5 are the only primes p<=8 with 16-p and 14+p both prime.
		

Crossrefs

Programs

A230443 Number of decompositions of 2n into a sum of two primes p2 >= p1 such that the number of runs in binary expansion of p2-p1 is less than or equal to 4.

Original entry on oeis.org

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

Views

Author

Lei Zhou, Oct 18 2013

Keywords

Comments

1. This is a tightly intensified version of Goldbach conjecture.
It is hypothesized that except for n=1402 and 27242, all other terms for n > 1 are greater than zero. Sequence tested up to 1 million without other zero elements.
2. The definition of "the number of runs in binary expansion of k" is from A005811.
3. The first difference of this sequence to A002375 is on a(26).

Examples

			n=2, 2n=4, 4=2+2, 2-2=0, A005811(0)=1 < 4, only one decomposition, so a(2)=1;
...
n=5, 2n=10, 10=5+5=3+7, 5-5=0, A005811(0)=1<4, 7-3=4, A005811(4)=2<4, so a(5)=2;
...
n=26, 2n=52, 52=5+47=11+41=23+29.  47-5=42, A005811(42)=6>4 [X]; 41-11=30, A005811(30)=2<4 [v]; 29-23=6, A005811(6)=2<4 [v]; so a(26)=2.
		

Crossrefs

Programs

  • Mathematica
    Table[ev=2*seed;ct=0;cp1=seed-1;While[cp1=NextPrime[cp1];cp1
    				

A233864 a(n) = |{0 < m < 2*n: m = sigma(k) for some k > 0, and 2*n - 1 - m and 2*n - 1 + m are both prime}|, where sigma(k) is the sum of all (positive) divisors of k.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Dec 16 2013

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 3.
(ii) For any even number 2*n > 0, 2*n + sigma(k) is prime for some 0 < k < 2*n.
See also A233793 for a related conjecture.
Clearly part (i) of the conjecture implies Goldbach's conjecture for even numbers 2*(2*n - 1) with n > 3; we have verified part (i) for n up to 10^8. Concerning part (ii), we remark that 1024 is the unique positive integer k < 1134 with 1134 + sigma(k) prime, and that sigma(1024) = 2047 > 1134.

Examples

			a(7) = 1 since sigma(5) = 6, and 2*7 - 1 - 6 = 7 and 2*7 - 1 + 6 = 19 are both prime.
a(10) = 1 since sigma(6) = sigma(11) = 12, and 2*10 - 1 - 12 = 7 and 2*10 - 1 + 12 = 31 are both prime.
a(11) = 1 since sigma(7) = 8, and 2*11 - 1 - 8 = 13 and 2*11 - 1 + 8 = 29 are both prime.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=Sum[If[Mod[n,d]==0,d,0],{d,1,n}]
    S[n_]:=Union[Table[f[j],{j,1,n}]]
    PQ[n_]:=n>0&&PrimeQ[n]
    a[n_]:=Sum[If[PQ[2n-1-Part[S[2n-1],i]]&&PQ[2n-1+Part[S[2n-1],i]],1,0],{i,1,Length[S[2n-1]]}]
    Table[a[n],{n,1,100}]

A234808 a(n) = |{0 < k < n: p = k + phi(n-k) and 2*n - p are both prime}|, where phi(.) is Euler's totient function.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Dec 30 2013

Keywords

Comments

Conjecture: a(n) > 0 except for n = 1, 8.
Clearly, this implies Goldbach's conjecture.

Examples

			a(3) = 1 since 2 + phi(1) = 3 and 2*3 - 3 = 3 are both prime.
a(20) = 1 since 11 + phi(9) = 17 and 2*20 - 17 = 23 are both prime.
a(22) = 1 since 1 + phi(21) = 13 and 2*22 - 13 = 31 are both prime.
a(24) = 1 since 9 + phi(15) = 17 and 2*24 - 17 = 31 are both prime.
a(76) = 1 since 67 + phi(9) = 73 and 2*76 - 73 = 79 are both prime.
		

Crossrefs

Programs

  • Mathematica
    f[n_,k_]:=k+EulerPhi[n-k]
    p[n_,k_]:=PrimeQ[f[n,k]]&&PrimeQ[2n-f[n,k]]
    a[n_]:=a[n]=Sum[If[p[n,k],1,0],{k,1,n-1}]
    Table[a[n],{n,1,100}]

A237354 a(n) is the maximum of omega(g)+omega(h) for all decompositions n=g+h with g>=h>=1.

Original entry on oeis.org

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

Views

Author

Lei Zhou, Feb 06 2014

Keywords

Comments

omega(g) is defined in A001221.
The smallest n that makes a(n)=2k should be twice the product of the first k-th prime numbers. For example, a(4)=2, 4=2*2; a(12)=4, 12=2*(2*3); a(60)=6, 60=2*(2*3*5).
The largest n that makes a(n)=k should be smaller than or equal to the product of the first k-th primes plus 1. For example, a(3)=1, 3 = 2+1; a(7)=2, 7=2*3+1; a(23)=3, 23<2*3*5+1=31; a(89)=4, 89<211=2*3*5*7+1.

Examples

			For n=2, 2=1+1. 1 does not have prime factor. So a(2)=0+0=0;
For n=3, 3=1+2, 1 does not have prime factor, where 2 has one. So a(3)=0+1=1;
For n=4, 4=1+3=2+2.  From 1+3 we got 1, from 2+2 we got 2.  The larger one is 2.  So a(4)=1+1=2.
...
For n=211, in best case we have 211=105+106=3*5*7+2*53.  So a(211)=3+2=5.
		

Crossrefs

Programs

  • Maple
    A237354 := proc(n)
        local a,g,om ;
        a := 0 ;
        for g from 1 to n/2 do
            om := A001221(g)+A001221(n-g) ;
            if om > a then
                a := om ;
            end if;
        end do:
        a ;
    end proc:
    seq(A237354(n),n=2..100) ; # R. J. Mathar, Feb 13 2014
  • Mathematica
    Table[ct = 0; 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}]
    (* Wouter Meeussen : *) Table[ Max@Table[PrimeNu[ n - k ] + PrimeNu[  k  ], {k, n - 1}], {n, 2, 88}]

A237628 a(n) is the smallest product of prime numbers such that all numbers from 6 and 2n can be written as the sum of two prime factors (duplication allowed) of a(n).

Original entry on oeis.org

3, 15, 15, 105, 105, 1155, 1155, 1365, 15015, 15015, 15015, 255255, 255255, 596505, 4849845, 4849845, 4849845, 10140585, 10140585, 179444265, 229474245, 229474245, 242777535, 640049865, 5898837945, 7357214865, 7357214865, 7357214865, 13350001665, 196656364905
Offset: 3

Views

Author

Lei Zhou, May 02 2014

Keywords

Comments

The prime factors of a(n) make a subset of prime numbers that satisfies the Goldbach Conjecture for even numbers from 6 to 2n.

Examples

			n=4: 2*4=8. 8=3+5.  This is the only possible two-prime decomposition which contains prime numbers 3 and 5, while 6=3+3, 3 is an element of set {3,5}.  So a(4)=3*5=15.
n=5: 2*5=10. 6=3+3, 8=3+5, 10=5+5.  So two selections of prime numbers in set {3,5} (reuse allowed) can be summed into all three numbers 6, 8, and 10.  So a(5)=3*5=15.
...
n=8: 2n=16. We will be able to find two sets, {3,5,7,11} and {3,5,7,13}, that have such feature:
  for set {3,5,7,11}, 6=3+3, 8=3+5, 10=5+5, 12=5+7, 14=7+7, and 16=5+11;
  for set {3,5,7,13}, 6=3+3, 8=3+5, 10=5+5, 12=5+7, 14=7+7, and 16=3+13.
  3*5*7*11=1155, and 3*5*7*13=1365.  1155<1365, so a(8)=1155.  Here we did not count set {3,5,7,11,13} which also has the desired feature since the two shorter sets are its subsets such that the products of the elements in the subsets are obviously smaller than the product of elements in this larger set.
		

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]; b = {};
    lna = Length[na]; Do[prd = Times @@ na[[k]]; AppendTo[b, prd], {k, 1, lna}]; Min[b], {n, 4, 32}](*Program lists the 4th item and beyond*)
Previous Showing 71-80 of 172 results. Next