[go: up one dir, main page]

login
A290507
Sums and differences of products of the first n primes partitioned into two disjoint parts.
0
1, 5, 7, 11, 13, 17, 23, 29, 31, 37, 41, 47, 67, 73, 83, 89, 97, 101, 103, 107, 127, 131, 139, 151, 157, 163, 169, 179, 181, 199, 221, 227, 239, 241, 263, 307, 313, 323, 337, 347, 349, 353, 359, 361, 379, 383, 389, 391, 397, 421, 457, 463, 467, 491, 499, 521, 527, 601, 619, 643, 653, 667, 673, 709, 713
OFFSET
1,2
COMMENTS
Partition the set Pn = {2,3,5,...,pn} of the first n primes into two disjoint parts. Let a,b be their respective products, S = a + b and D = |a - b|. The list is composed of sorted values of S and D.
Numbers a,b share no common factors. It follows that the prime factors of S or D can't divide either a or b. So the smallest possible prime factor of S or D is pn+1.
After the value 1, the next 25 numbers of the list are primes. Then the proportion of primes decreases. For the first 2000 elements, about 50% are primes.
LINKS
C. Aebi and G. Cairns, Partitions of Primes, Parabola, Vol. 45, No. 1 (2009).
EXAMPLE
3 - 2 = 1
2 + 3 = 5
2*5 - 3 = 7
2*3 + 5 = 11
2*5 + 3 = 13
3*5 + 2 = 17
2*3*5 - 7 = 23
2*7 + 3*5 = 29
2*5 + 3*7 = 31
...
PROG
(JavaScript)
<script>
/**************************
Sum and Difference of multiplication of two complementary subset the n first primes
****************************/
// List of the first primes
var P=new Array(2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97);
function Sum_and_Difference(n)
{
var L=[]; // Table used to have the two partitions of a set of elements
var a=1; // First product of primes
var b=1; // Second product of primes
var Ok = 0; // if n is only composed of 1
var S, D; // Sum and Difference of products of primes
// Generate a table L containing n in binary digits : 0 and 1 values in L are used to obtain the two partitions
do
{
var r=n%2;
L.push(r);
n=(n-r)/2;
}while(n!=0);
for(var i=0; i < L.length ; i++)
{
if(L[i] == 0)
{
Ok = 1;
a = a * P[i];
}
else
b = b * P[i];
}
if (Ok)
{
D = Math.abs(a-b);
document.write(D + " = |" + a + " - " + b + "| </BR> ");
S = a+b;
document.write(S + " = " + a + " + " + b + " </BR> ");
}
}
for (var j = 1 ; j < 32 ; j++)
{
Sum_and_Difference(j);
}
</script>
CROSSREFS
Sequence in context: A104860 A216751 A216741 * A139812 A180951 A040146
KEYWORD
nonn
AUTHOR
Yves Debeuret, Aug 04 2017
STATUS
approved