A337121 a(n) is the number of ways the n-th prime number prime(n) can be represented as sum of two smaller odd prime numbers p1, p2 with prime(n) > p1 > (p2 minus the maximum odd prime factor of (p1-p2)).
1, 1, 2, 3, 2, 2, 4, 3, 3, 5, 3, 6, 4, 4, 4, 7, 4, 4, 5, 6, 6, 6, 9, 7, 8, 8, 7, 7, 6, 11, 4, 11, 9, 7, 8, 9, 7, 13, 12, 6, 10, 15, 10, 9, 7, 13, 13, 11, 13, 10, 15, 10, 13, 14, 11, 13, 13, 12, 14, 17, 13, 13, 19, 9, 14, 19, 12, 8, 14, 22, 17, 14, 13, 16, 9, 15
Offset: 4
Keywords
Examples
When n=4, prime(4)=7, MaxOddPrimeFactor(5-3)=1, 7=5+3-1. This is the only case, so a(4)=1. When n=5, prime(5)=11, MaxOddPrimeFactor(7-5)=1, 11=7+5-1. This is the only case, so a(5)=1. When n=6, prime(6)=13, MaxOddPrimeFactor(11-3)=1, 13=11+3-1; and MaxOddPrimeFactor(11-5)=3, 13=11+5-3. Two cases found, so a(6)=2.
Programs
-
Mathematica
MaxOddPrimeFactor[m_] := Module[{factors, l, res}, factors = FactorInteger[m]; l = Length[factors]; res = factors[[l, 1]]; If[res == 2, res = 1]; res] Table[p = Prime[n]; p1 = NextPrime[p/2, -1]; ct = 0; While[p1 = NextPrime[p1]; p1 < p, p2 = NextPrime[p - p1, -1]; While[p2 = NextPrime[p2]; p2 < p1, If[p == (p1 + p2 - MaxOddPrimeFactor[p1 - p2]), ct++]]]; ct, {n, 4, 79}]
Comments