A360016 Number of partitions of 4*n into four odd primes (p_1, p_2, p_3, p_4) (p_1 < p_2 <= p_3 < p_4 and p_1 + p_4 = p_2 + p_3 = 2*n) such that (p_1, p_2) and (p_3, p_4) are consecutive pairs of prime numbers with the same difference, d = p_2 - p_1 = p_4 - p_3, and (p_1, p_3), (p_2, p_4) are also consecutive pairs of prime numbers with the same difference, D = p_3 - p_1 = p_4 - p_2.
0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 2, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 3, 0
Offset: 1
Examples
a(57)=2 because there are two such partitions of 228: {43,47,67,71}, {43,53,61,71}. In the first partition (i.e., p_1 = 43, p_2 = 47, p_3 = 67, p_4 = 71), (43,47) and (67,71) are prime pairs with difference 4 (since p_2 - p_1 = p_4 - p_3 = 4), and they are consecutive among such pairs (i.e., there does not exist any intervening pair of primes with difference 4). It is also true that (43,67) and (47,71) are prime pairs with difference 24 (since p_3 - p_1 = p_4 - p_2 = 24), and they are consecutive among such pairs (i.e., no intervening pair of primes with difference 24 exists). Similarly, in the second partition (i.e., p_1 = 43, p_2 = 53, p_3 = 61, p_4 = 71), (43,53) and (61,71) are consecutive pairs of prime numbers with difference 10: p_2 - p_1 = p_4 - p_3 = 10, and (43,61) and (53,71) are consecutive pairs of prime numbers with difference 18: p_3 - p_1 = p_4 - p_2 = 18.
Programs
-
PARI
chk(s, t, d)={forprime(p=s, t, if(isprime(p+d), return(0))); 1} a(n) = {my(s=0); forprime(p=3, n, if(isprime(2*n-p), forprime(q=p+1, n, if(isprime(2*n-q) && chk(p+1, 2*n-q-1, q-p) && chk(p+1,q-1,2*n-q-p), s++)))); s} \\ Andrew Howroyd, Feb 03 2023
Comments