OFFSET
1,5
COMMENTS
a(1)=0 is the only zero term up to n=200000.
It is hypothesized that a(1)=0 is the only zero term of this sequence.
The histogram for 1<=n<=60000 of this sequence shows the shape of a distribution with mode=10, and it has a regional maximum at 20.
LINKS
EXAMPLE
For n=1, 2n=2, which cannot be decomposed into the sum of two primes, so a(1)=0.
For n=2, 2n = 4 = 2+2, and 2-2 = 0 = 2^0-1, so the difference from 2^0 is 1, which satisfies the condition. So a(2)=1;
...
For n=5, 2n = 10 = 3+7 = 5+5. |3*2-7| = 1 = 2^0 and |5-5| = 0 = 2^0-1; both satisfy the condition, so a(5)=2.
...
For n=35, 2n = 70 = 3+67 = 11+59 = 17+53 = 23+47 = 29+41. These five Goldbach decompositions make A045917(35)=5. Among these, |3*22-67| = 1 = 2^0; |11*5-59| = 4 = 2^2; |17*3-53| = 2 = 2^1; |23*2-47| = 1 satisfies the condition. However, |29-41| = 12 = 2^3+4 = 2^4-4 does not satisfy the condition. So, a(35)=4 < A045917(35). This is the first term where the two sequences differ.
MATHEMATICA
NumDiff[n1_, n2_] := Module[{c1 = n1, c2 = n2}, If[c1 < c2, c1 = c1 + c2; c2 = c1 - c2; c1 = c1 - c2]; k = Floor[c1/c2]; a1 = c1 - k*c2; If[a1 == 0, a2 = 0, a2 = (k + 1) c2 - c1]; Return[Min[a1, a2]]];
Table[e = 2 n; p1 = 1; ct = 0; While[p1 = NextPrime[p1]; p1 <= n, p2 = e - p1; If[PrimeQ[p2], d = NumDiff[p1, p2]; k = Floor[Log[2, d]]; diff1 = d - 2^k; If[diff1 == 0, ct++, diff2 = 2^(k + 1) - d; If[(diff1 <= 2) || (diff2 <= 2), ct++]]]]; ct, {n, 1, 100}]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Lei Zhou, Feb 02 2015
STATUS
approved