cp's OEIS Frontend

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.

A077654 Composites k such that 2k+1 is also composite.

This page as a plain text file.
%I A077654 #31 Feb 21 2024 01:45:06
%S A077654 4,10,12,16,22,24,25,27,28,32,34,38,40,42,45,46,49,52,55,57,58,60,62,
%T A077654 64,66,70,72,76,77,80,82,84,85,87,88,91,92,93,94,100,102,104,106,108,
%U A077654 110,112,115,117,118,121,122,123,124,126,129,130,132,133,136,142
%N A077654 Composites k such that 2k+1 is also composite.
%C A077654 Sequence is infinite. For instance, it contains 2^m for m not of the form 2^k - 1. - _Eric M. Schmidt_, Apr 09 2015
%H A077654 Eric M. Schmidt, <a href="/A077654/b077654.txt">Table of n, a(n) for n = 1..10000</a>
%e A077654 Both 16 and 33 = 16*2 + 1 are composite, so 16 is in this sequence.
%t A077654 Select[Range[200], !PrimeQ[#] && !PrimeQ[2 # + 1] &] (* _Vincenzo Librandi_, Apr 09 2015 *)
%t A077654 Select[Range[200],AllTrue[{#,2#+1},CompositeQ]&] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Jun 12 2019 *)
%o A077654 (PARI) isA077654(n) = !(isprime(n)) & !(isprime(2*n+1)); \\ _Michael B. Porter_, Oct 01 2009
%o A077654 (Magma) [n: n in [1..200] | not IsPrime(n) and not IsPrime(2*n+1)]; // _Vincenzo Librandi_, Apr 09 2015
%o A077654 (Python)
%o A077654 from sympy import isprime
%o A077654 def ok(n): return n >= 4 and not isprime(2*n+1) and not isprime(n)
%o A077654 print(list(filter(ok, range(4, 143)))) # _Michael S. Branicky_, Apr 10 2021
%Y A077654 Cf. A005384, A005385, A067812.
%K A077654 nonn
%O A077654 1,1
%A A077654 _Lior Manor_, Nov 13 2002
%E A077654 Offset corrected by _Eric M. Schmidt_, Apr 09 2015