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.

Showing 1-4 of 4 results.

A118952 Characteristic function of numbers that can be written as p+2^k, where p is prime and p less than 2^k (A118957).

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1
Offset: 1

Views

Author

Reinhard Zumkeller, May 07 2006

Keywords

Comments

0 <= a(n) <= 1, a(n) <= A109925(n);
a(A118956(n)) = 0, a(A118957(n)) = 1;
A118953(n) = a(A000040(n)).

A118955 Numbers of the form 2^k + prime.

Original entry on oeis.org

3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 23, 24, 25, 27, 29, 30, 31, 32, 33, 34, 35, 37, 38, 39, 41, 42, 43, 44, 45, 47, 48, 49, 51, 53, 54, 55, 57, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 77, 79, 80, 81, 83, 84, 85, 87, 89, 90, 91, 93
Offset: 1

Views

Author

Reinhard Zumkeller, May 07 2006

Keywords

Comments

A109925(a(n)) > 0, complement of A118954;
The lower density is at least 0.09368 (Pintz) and upper density is at most 0.49095 (Habsieger & Roblot). The density, if it exists, is called Romanov's constant. Romani conjectures that it is around 0.434. - Charles R Greathouse IV, Mar 12 2008
Elsholtz & Schlage-Puchta improve the bound on lower density to 0.107648. Unpublished work by Jie Wu improves this to 0.110114, see Remark 1 in Elsholtz & Schlage-Puchta. - Charles R Greathouse IV, Aug 06 2021

References

  • Steven R. Finch, Mathematical Constants, Encyclopedia of Mathematics and its Applications, vol. 94, Cambridge University Press, 2003, Section 2.1, p. 87.

Crossrefs

Subsequence of A081311; A118957 is a subsequence.

Programs

  • Haskell
    a118955 n = a118955_list !! (n-1)
    a118955_list = filter f [1..] where
       f x = any (== 1) $ map (a010051 . (x -)) $ takeWhile (< x) a000079_list
    -- Reinhard Zumkeller, Jan 03 2014
    
  • Mathematica
    Select[Range[100], (For[r=False; k=1, #>k, k*=2, If[PrimeQ[#-k], r=True]]; r)& ] (* Jean-François Alcover, Dec 26 2013, after Charles R Greathouse IV *)
  • PARI
    is(n)=my(k=1);while(n>k,if(isprime(n-k),return(1),k*=2));0 \\ Charles R Greathouse IV, Mar 12 2008
    
  • PARI
    list(lim)=my(v=List(),t=1); while(tCharles R Greathouse IV, Aug 06 2021
    
  • Python
    from itertools import count, islice
    from sympy import isprime
    def A118955_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n: any(isprime(n-(1<A118955_list = list(islice(A118955_gen(),30)) # Chai Wah Wu, Nov 29 2023

A118958 Primes that cannot be written as 2^k + p with p prime < 2^k.

Original entry on oeis.org

2, 3, 5, 17, 31, 41, 47, 53, 59, 73, 79, 89, 97, 103, 109, 113, 127, 137, 149, 163, 167, 173, 179, 191, 193, 197, 223, 227, 233, 239, 251, 257, 271, 277, 281, 283, 307, 311, 313, 331, 337, 347, 349, 367, 373, 379, 389, 397, 401, 409, 421, 431, 433, 439, 443
Offset: 1

Views

Author

Reinhard Zumkeller, May 07 2006

Keywords

Comments

A118953(A049084(a(n))) = 0; A065381 is a subsequence.

Crossrefs

Programs

  • Maple
    filter:= proc(n) not isprime(n-2^ilog2(n)) end proc:
    select(filter, [seq(ithprime(i),i=1..100)]); # Robert Israel, Jan 27 2021
  • Mathematica
    okQ[n_] := !PrimeQ[n-2^(Length[IntegerDigits[n, 2]]-1)];
    Select[Prime[Range[100]], okQ] (* Jean-François Alcover, Feb 04 2023 *)

A118956 Numbers that cannot be written as 2^k + p with p prime < 2^k.

Original entry on oeis.org

1, 2, 3, 4, 5, 8, 9, 12, 14, 16, 17, 20, 22, 24, 25, 26, 28, 30, 31, 32, 33, 36, 38, 40, 41, 42, 44, 46, 47, 48, 50, 52, 53, 54, 56, 57, 58, 59, 60, 62, 64, 65, 68, 70, 72, 73, 74, 76, 78, 79, 80, 82, 84, 85, 86, 88, 89, 90, 91, 92, 94, 96, 97, 98, 99, 100, 102, 103, 104, 106
Offset: 1

Views

Author

Reinhard Zumkeller, May 07 2006

Keywords

Comments

Complement of A118957.
A118954 is a subsequence.

Crossrefs

Programs

  • Mathematica
    nn=15;Complement[Range[nn^2],Flatten[Table[c=2^n;c+Prime[ Range[ PrimePi[ c]]],{n,2,nn}]]] (* Harvey P. Dale, Sep 14 2012 *)
  • Python
    from sympy import primepi
    def A118956(n):
        def f(x): return int(n+sum(primepi(min(x-(m:=1<Chai Wah Wu, Feb 23 2025

Formula

A118952(a(n)) = 0.
Showing 1-4 of 4 results.