login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo

Please make a donation to keep the OEIS running. We are now in our 56th year. In the past year we added 10000 new sequences and reached almost 9000 citations (which often say "discovered thanks to the OEIS").
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A118957 Numbers of the form 2^k + p, where p is a prime less than 2^k. 4
6, 7, 10, 11, 13, 15, 18, 19, 21, 23, 27, 29, 34, 35, 37, 39, 43, 45, 49, 51, 55, 61, 63, 66, 67, 69, 71, 75, 77, 81, 83, 87, 93, 95, 101, 105, 107, 111, 117, 123, 125, 130, 131, 133, 135, 139, 141, 145, 147, 151, 157, 159, 165, 169, 171, 175, 181, 187, 189, 195, 199 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

A118952(a(n)) = 1.

LINKS

Table of n, a(n) for n=1..61.

MAPLE

isA118957 := proc(n)

    local twok, p ;

    twok := 1 ;

    while twok < n-1 do

        p := n-twok ;

        if isprime(p) and p < twok then

            return true;

        end if;

        twok := twok*2 ;

    end do:

    return false;

end proc:

for n from 1 to 200 do

    if isA118957(n) then

        printf("%d, ", n) ;

    end if;

end do: # R. J. Mathar, Feb 27 2015

MATHEMATICA

okQ[n_] := Module[{k, p}, For[k = Ceiling[Log[2, n]], k>1, k--, p = n-2^k; If[2 <= p < 2^k && PrimeQ[p], Return[True]]]; False]; Select[Range[200], okQ] (* Jean-Fran├žois Alcover, Mar 11 2019 *)

PROG

(PARI) is(n)=for(k=logint(n, 2), logint(n, 2), if(isprime(n-2^k), return(1))); 0 \\ Charles R Greathouse IV, Sep 01 2015

CROSSREFS

Complement of A118956; subsequence of A118955.

Cf. A118958, A156695.

Sequence in context: A037301 A163247 A085267 * A037303 A135121 A309854

Adjacent sequences:  A118954 A118955 A118956 * A118958 A118959 A118960

KEYWORD

nonn

AUTHOR

Reinhard Zumkeller, May 07 2006

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 28 20:50 EST 2020. Contains 338755 sequences. (Running on oeis4.)