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
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
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.
-
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
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.
-
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
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
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.
-
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}]
-
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
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.
-
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
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.
-
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}]
-
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
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.
-
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
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.
-
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
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).
-
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
-
a(n)=sum(i=2,primepi(floor(sqrt(2*n-2))),isprime(2*n-prime(i))) \\ Lear Young, Apr 11 2014
Comments