The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A100813 Smallest number in base 2 which is also prime in base 2+n, or 0 if no such number exists. 1
10, 11, 10, 11, 10, 111, 1011, 11, 10, 11, 10, 101, 111, 11, 10, 11, 10, 101, 111, 11, 10, 101, 111011, 101, 111, 11, 10, 11, 10, 1011, 111, 10001, 1101, 11, 10, 111, 1011, 11, 10, 11, 10, 1011, 1101, 11, 10, 1011, 1100111, 111, 101001, 11, 10, 101, 111011, 101 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
a(6) = 111: 111 (base 2) = 7, which is prime; 111 (base 2+6) = 73, which is prime.
MATHEMATICA
a = {}; Do[ k = 1; While[ ! PrimeQ[FromDigits[IntegerDigits[Prime[k], 2], 2 + n]], k++ ]; AppendTo[a, FromDigits[IntegerDigits[Prime[k], 2], 10]]; , {n, 50}]; a (* Ray Chandler, Jan 10 2005 *)
PROG
(Python)
from sympy import isprime, nextprime
def fd(s, b): return sum(b**i for i, si in enumerate(s[::-1]) if si=='1')
def a(n):
p = 2
while not isprime(fd(bin(p)[2:], n+2)): p = nextprime(p)
return int(bin(p)[2:])
print([a(n) for n in range(1, 55)]) # Michael S. Branicky, Aug 20 2022
CROSSREFS
Sequence in context: A004499 A020509 A103181 * A085209 A085217 A085210
KEYWORD
base,nonn
AUTHOR
Ray G. Opao, Jan 05 2005
EXTENSIONS
Corrected and extended by Ray Chandler, Jan 10 2005
a(51) and beyond from Michael S. Branicky, Aug 09 2022
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 29 20:46 EDT 2024. Contains 372952 sequences. (Running on oeis4.)