A276034
a(n) is the number of decompositions of 2n into an unordered sum of two primes in A274987.
Original entry on oeis.org
0, 0, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 3, 2, 1, 2, 2, 2, 1, 2, 1, 0, 2, 1, 1, 2, 2, 3, 3, 2, 2, 2, 2, 3, 2, 1, 2, 4, 3, 1, 5, 3, 2, 5, 1, 2, 2, 2, 5, 2, 3, 4, 5, 3, 2, 5, 2, 1, 4, 0, 1, 5, 3, 1, 3, 5, 4, 4, 3, 2, 4, 3, 3, 4, 2, 3, 7, 2, 2, 3, 2, 2, 2
Offset: 1
A274987 = {3, 5, 7, 11, 13, 17, 23, 31, 37, 53, 59, 61, 73, 79, 83, 89, 101, 103, 109, ...}.
For n=3, 2n=6 = 3+3, one case of decomposition, so a(3)=1;
for n=4, 2n=8 = 3+5, one case of decomposition, so a(4)=1;
...
for n=17, 2n=34 = 3+31 = 11+23 = 17+17, three cases of decompositions, so a(17)=3.
-
p = 3; sp = {p}; a = Table[m = 2*n; l = Length[sp]; While[sp[[l]] < m, While[p = NextPrime[p]; cp = 2*3^(Floor[Log[3, 2*p - 1]]) - p; ! PrimeQ[cp]]; AppendTo[sp, p]; l++]; ct = 0; Do[If[(2*sp[[i]] <= m) && (MemberQ[sp, m - sp[[i]]]), ct++], {i, 1, l}]; ct, {n, 1, 87}]
A276520
a(n) is the number of decompositions of n into unordered form p + c*q, where p, q are terms of A274987, c=1 for even n-s and c=2 for odd n-s.
Original entry on oeis.org
0, 0, 0, 0, 0, 1, 0, 1, 1, 2, 1, 1, 2, 2, 1, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 3, 2, 2, 0, 3, 3, 1, 2, 4, 1, 3, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 1, 3, 0, 2, 2, 0, 1, 3, 1, 3, 2, 0, 2, 3, 3, 3, 3, 3, 2, 3, 2, 2, 2, 2, 2, 3, 3, 2, 2, 4, 1, 2, 2, 3, 4, 4, 3, 4
Offset: 1
A274987 = {3, 5, 7, 11, 13, 17, 23, 31, 37, 53, 59, 61, 73, 79, 83, 89, 101, 103, 109, ...}
For n=6, 6 = 3+3, one case of decomposition, so a(6)=1;
For n=7, 7 < 3+2*3=9, no eligible case could be found, so a(7)=0;
...
For n=17, 17 = 3+2*7 = 7+2*5 = 11+2*3, three cases of decompositions, so a(17)=3.
Cf.
A002375,
A045917,
A001031,
A274987,
A171611,
A240708,
A240712,
A230443,
A276034,
A103151,
A001031.
-
p = 3; sp = {p}; Table[l = Length[sp]; While[sp[[l]] < n, While[p = NextPrime[p]; cp = 2*3^(Floor[Log[3, 2*p - 1]]) - p; ! PrimeQ[cp]]; AppendTo[sp, p]; l++]; c = 2 - Mod[n + 1, 2]; ct = 0; Do[If[MemberQ[sp, n - c*sp[[i]]], If[c == 1, If[(2*sp[[i]]) <= n, ct++], ct++]], {i, 1, l}]; ct, {n, 1, 87}]
A278341
a(n) is the number of decompositions of n into unordered form p + c*q, where p, q are terms of A274987 and the difference of trits for p and q is no more than 1, c=1 for even n-s and c=2 for odd n-s.
Original entry on oeis.org
0, 0, 0, 0, 0, 1, 0, 1, 1, 2, 1, 1, 2, 2, 1, 2, 3, 2, 2, 1, 2, 2, 1, 2, 2, 1, 3, 2, 2, 2, 2, 0, 3, 2, 1, 2, 2, 1, 3, 1, 2, 2, 1, 2, 3, 1, 2, 2, 1, 1, 3, 0, 2, 2, 0, 0, 3, 0, 2, 1, 0, 1, 2, 0, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 1, 2, 1, 1, 2, 0, 1, 1, 1, 2, 2, 0, 2
Offset: 1
A274987 = {3, 5, 7, 11, 13, 17, 23, 31, 37, 53, 59, 61, 73, 79, 83, 89, 101, 103, 109...}
For n=6, c=1, 6=3+3, 3=10 in balanced ternary(BT). 3 is a 2 trits BT number. 2-2=0<1, so this one counts, a(6)=1;
...
For n=20, c=1, 20=3+17=7+13. For 3 and 17 pair, 3=10(BT), 17=1T0T(BT), the difference of trits of these two primes is 2. This does not count. For 7 and 13 pair, 7=1T1(BT), 13=111(BT), the difference of trits of these two primes is 0. This is counted. So a(20)=1;
...
For n=29, c=2, 29=23+2*3=7+2*11=3+2*13. For 23 and 3 pair, 23=10TT(BT), 3=10(BT), the difference of trits of these two primes is 2, this does not count; for 7 and 11 pair, 7=1T1(BT), 11=11T(BT), the difference of trits of these two primes is , this is counted; for 3 and 13 pair, 3=10(BT), 13=111(BT), the difference of trits of these two primes is 1, this is counted. So a(29)=2.
-
p = 3; sp = {p}; Table[l = Length[sp]; While[sp[[l]] < n, While[p = NextPrime[p]; cp = 2*3^(Floor[Log[3, 2*p - 1]]) - p; ! PrimeQ[cp]]; AppendTo[sp, p]; l++]; c = 2 - Mod[n + 1, 2]; ct = 0; Do[If[MemberQ[sp, n - c*sp[[i]]], If[Abs[Floor[Log[3, 2*sp[[i]] - 1]] - Floor[Log[3, 2*(n - c*sp[[i]]) - 1]]] <= 1, If[c == 1, If[(2*sp[[i]]) <= n, ct++], ct++]]], {i, 1, l}];
ct, {n, 1, 87}]
Original entry on oeis.org
1, 2, 3, 4, 5, 7, 32, 52, 55, 56, 58, 61, 64, 66, 72, 80, 86, 88, 89, 94, 101, 103, 108, 109, 128, 130, 131, 161, 173, 187, 193, 194, 213, 214, 224, 244, 253, 260, 270, 292, 304, 314, 323, 334, 344, 348, 349, 365, 370, 373, 388, 404, 424, 454, 470, 478, 482
Offset: 1
A278341(1,2,3,4,5,7)=0, so a(1)=1, a(2)=2,...,a(5)=5, and a(6)=7.
a(7)=32 is because 32 cannot be decomposited into the sum of two terms in A274987={3, 5, 7, 11, 13, 17, 23, 31, 37, 53, 59, 61, 73, 79, 83, 89, 101, 103, 109...}.
-
p = 3; sp = {p}; m = 0; Table[
While[m++; l = Length[sp];
While[sp[[l]] < m,
While[p = NextPrime[p];
cp = 2*3^(Floor[Log[3, 2*p - 1]]) - p; ! PrimeQ[cp]];
AppendTo[sp, p]; l++]; c = 2 - Mod[m + 1, 2]; ct = 0;
Do[If[MemberQ[sp, m - c*sp[[i]]],
If[Abs[Floor[Log[3, 2*sp[[i]] - 1]] -
Floor[Log[3, 2*(m - c*sp[[i]]) - 1]]] <= 1,
If[c == 1, If[(2*sp[[i]]) <= m, ct++], ct++]]], {i, 1, l}];
ct > 0];
m, {n, 1, 208}]
Showing 1-4 of 4 results.
Comments