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.

A283806 Odd numbers which are uniquely decomposable into the sum of a prime and a power of two.

Original entry on oeis.org

3, 5, 17, 29, 41, 53, 59, 65, 89, 97, 119, 137, 163, 179, 185, 191, 193, 209, 217, 219, 221, 223, 233, 239, 247, 253, 269, 281, 305, 307, 311, 343, 359, 389, 403, 407, 415, 419, 427, 431, 457, 491, 505, 521, 533, 545, 547, 557, 569, 575, 581, 583, 597, 613, 637
Offset: 1

Views

Author

Arkadiusz Wesolowski, Mar 17 2017

Keywords

Comments

It is conjectured that none of these numbers is in A101036.
A positive integer n belongs to this sequence if n is of the form x*y + x - 1 and for some m >= 1:
1) y = -1 + 2 * Product_{k=0..m} (2^(2^k) + 1),
2) x <= 2^(2^(m+1) - 1),
3) n - 2^(2^(m+1)) is prime.
Odd numbers m that satisfy A109925(m) = 1. - Michel Marcus, Mar 19 2017

Examples

			17 is in the sequence since 17 - 2^2 = 13 is a prime and 17 - 2^0 = 16, 17 - 2^1 = 15, 17 - 2^3 = 9, 17 - 2^4 = 1 are all nonprimes.
		

Crossrefs

Programs

  • Magma
    lst:=[]; for n in [1..637 by 2] do c:=0; r:=Floor(Log(n)/Log(2)); for x in [0..r] do a:=n-2^x; if IsPrime(a) then c+:=1; end if; if c eq 2 then break; end if; end for; if c eq 1 then Append(~lst, n); end if; end for; lst;
    
  • Mathematica
    Select[Range[1, 640, 2], Function[n, Total@ Boole@ PrimeQ@ Map[n - # &, 2^Range[0, Floor@ Log2@ n]] == 1]] (* Michael De Vlieger, Mar 18 2017 *)
  • PARI
    isok(n) = (n % 2) && (sum(k=0, log(n)\log(2), isprime(n-2^k)) == 1); \\ Michel Marcus, Mar 18 2017
    
  • Python
    from sympy import isprime
    import math
    print([n for n in range(1001) if n%2 and sum([isprime(n-2**k) for k in range(int(math.floor(math.log(n)/math.log(2))) + 1)]) == 1]) # Indranil Ghosh, Mar 29 2017

Formula

a(n) ~ 10*(n + n/log(n)).