A225781 Numbers k such that both k and (k+1)/2 are primes and evil.
5, 277, 673, 1093, 1237, 1381, 1621, 1873, 2473, 2593, 2797, 2857, 4177, 4357, 4441, 4561, 4933, 5077, 5233, 5413, 5437, 5581, 5701, 6037, 6133, 6997, 7477, 7537, 8053, 8353, 8713, 8893, 9133, 9901, 10861, 10957, 11113, 11161, 11497, 12073, 12457, 12757
Offset: 1
Links
- Brad Clardy, Table of n, a(n) for n = 1..1000
Programs
-
Magma
//the function Bweight determines the binary weight of a number Bweight := function(m) Bweight:=0; adigs := Intseq(m,2); for n:= 1 to Ilog2(m)+1 do Bweight:=Bweight+adigs[n]; end for; return Bweight; end function; for i:=1 to 1000000 do pair:=(i+1)div 2; if (IsPrime(i) and IsPrime(pair) and (Bweight(i) mod 2 eq 0) and (Bweight(pair) mod 2 eq 0)) then i; end if; end for;
-
Mathematica
evilQ[n_] := EvenQ[DigitCount[n, 2, 1]]; Select[Prime[Range[1600]], PrimeQ[(#+1)/2] && And @@ evilQ /@ {#, (#+1)/2} &] (* Amiram Eldar, Aug 06 2023 *)
Comments