A179825 Multiples of 6 which are not the sum of a pair of twin primes.
96, 402, 516, 786, 906, 1116, 1146, 1266, 1356, 3246, 4206
Offset: 1
Keywords
Crossrefs
Cf. A007534
This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
a(6) = 101 because 101 - 3 = 98 and (98 - 73 = 25, 98 - 71 = 27), (98 - 61 = 37, 98 - 59 = 39), ..., (98 - 5 = 93, 98 - 3 = 95) aren't twin primes.
p = Prime[Range[600]]; p2 = Select[p, PrimeQ[# - 2] || PrimeQ[# + 2] &]; Select[ p - 3, IntegerPartitions[#, {2}, p2] == {} &] + 3 (* Amiram Eldar, Nov 15 2018 *)
{forprime(n=2,10^4,p=n-3;forprime(t1=2,n,forprime(t2=t1,n,t12=t1+t2; if((isprime(t1-2)||isprime(t1+2))&&(isprime(t2-2)||isprime(t2+2)), if(t12==p,break(2)))));if(t12==2*n,print1(n", ")))}
isok(p) = {if (isprime(p), p -= 3; forprime(q = 2, p, if (isprime(r=p-q), if ((isprime(r+2) || isprime(r-2)) && (isprime(q-2) || isprime(q+2)), return (0)););); return (1));} \\ Michel Marcus, Dec 05 2018
\\ See Corneth link \\ David A. Corneth, Dec 05 2018
The cousin primes < 100 are 3, 7, 11, 13, 17, 19, 23, 37, 41, 43, 47, 67, 71, 79, 83, 97. 76 is in the sequence because no combination of any two numbers from the set just enumerated can be summed to make 76.
Lim=10^4;cp1=Select[Range[Lim], PrimeQ[#] && PrimeQ[# + 4] &] ;cp=Union[Join[cp1,cp1+4]];sms=Total/@Tuples[cp,2];en=Range[2,Lim,2];Complement[en,sms] (* James C. McMahon, Mar 30 2025 *)
15=3+5+7, 19=3+5+11 hence 15 and 19 are not in the sequence.
pr=Prime[Range[100]];se=Select[pr,PrimeQ[ #-2]||PrimeQ[ #+2]&]; se2=Select[Union[Total/@Subsets[se,{3}]],#<200&];Complement[Range[200],se2]
10=3+7=5+5 not in the sequence (not >3 or not different), 12=5+7, 12 first in the sequence, 14=3+11=7+7 not in the sequence.
is_A231903(n)={my(s=0);forprime(p=5,n\2-1,isprime(n-p)&&s++>1&&return);s} \\ - M. F. Hasler, Nov 22 2013
For even n with 4 <= n <= 100, all have at least one representation as the difference of two primes, each of which is a member of a pair of twin primes, but the following have only one such representation, and so belong to the sequence: 4 = 7 - 3 6 = 11 - 5 20 = 31 - 11 34 = 41 - 7 46 = 59 - 13 50 = 61 - 11 74 = 103 - 29 82 = 101 - 19 86 = 103 - 17
istwin(p) = isprime(p+2) || isprime(p-2); isok(n) = {my(nb = 0); forprime(p=3, n, if (isprime(n+p) && istwin(p) && istwin(n+p), nb++);); if (nb == 1, return (1));} lista(nn) = forstep(n=4, nn, 2, if (isok(n), print1(n, ", "))); \\ Michel Marcus, Jun 07 2016
6 = 3 + 3 is an element since (3,5) are twins, as is 8 = 5 + 3. 10 = 7 + 3 = 5 + 5 is not an element, since it is not uniquely resolved, even though the two resolutions both involve primes with twins.
ok[n_] := 1 == Length@ IntegerPartitions[n, {2}, Select[Prime@ Range@ PrimePi@ n, Or @@ PrimeQ[# + {-2, 2}] &]]; Select[2 Range[500], ok] (* Giovanni Resta, Jun 06 2016 *)
tp = Select[Prime@Range@ 16340, PrimeQ[# -2] || PrimeQ[# +2] &]; f[n_] := Length@ IntegerPartitions[n, {2, 2}, tp]; t[_] := 0; k = 2; While[k < 10201, a = f@k; If[ t[a] == 0, t[a] = k]; k += 2]; t /@ Range[0, 75]
Comments