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.

A255967 Odd numbers m that are neither of the form p + 2^k nor of the form p - 2^k with 2^k < m, k >= 1, and p prime.

Original entry on oeis.org

1, 1973, 3181, 3967, 4889, 5617, 7747, 7913, 8363, 8587, 8923, 11437, 11993, 12517, 13285, 13973, 14101, 14231, 14489, 16117, 16769, 16849, 18391, 18611, 19583, 19819, 21289, 21683, 21701, 21893, 22147, 22817, 22949, 23651, 24943, 25829, 27197, 27437
Offset: 1

Views

Author

Arkadiusz Wesolowski, Mar 12 2015

Keywords

Comments

Odd numbers m such that for all 2^k < m the numbers m + 2^k and m - 2^k are composite, with k >= 1.

Crossrefs

Cf. A076335.
Subsequence of A006285. Supersequence of A256163.
A153352 gives the primes.

Programs

  • Magma
    lst:=[]; for n in [1..27437 by 2] do t:=0; k:=0; while 2^k lt n do if IsPrime(n-2^k) or IsPrime(n+2^k) then t:=1; break; end if; k+:=1; end while; if IsZero(t) then Append(~lst, n); end if; end for; lst;
    
  • Mathematica
    q[m_] :=  If[EvenQ[m], False, Module[{pow = 2},While[pow < m && !PrimeQ[m - pow] && !PrimeQ[m + pow], pow *= 2]; pow > m]]; Select[Range[30000], q] (* Amiram Eldar, Jul 19 2025 *)
  • PARI
    isok(m) = if(!(m % 2), 0, my(pow = 2); while(pow < m && !isprime(m - pow) && !isprime(m + pow), pow *= 2); pow > m); \\ Amiram Eldar, Jul 19 2025