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!)
A086884 Smallest string of 1's and 0's which is prime in every base from 2 to n. 2
10, 10, 101111, 10010111, 111110100001, 111110100001, 11000011101101111, 10011110011011110110110011, 110100000010101111110001010011001110001, 1000000010000011110100010001000101001010110111001, 10100001011000101000110101011011011101111110100101011 (list; graph; refs; listen; history; text; internal format)
OFFSET
2,1
LINKS
Mersenneforum.org, Multibase primes
EXAMPLE
a(5) = 10010111 because 10010111 (base 2) = 151, 10010111 (base 3) = 2281, 10010111 (base 4) = 16661 and 10010111 (base 5) = 78781 are all prime and 10010111 is the smallest such string.
MATHEMATICA
a[n_] := (While[b = FromDigits[ IntegerDigits[k, 2]]; Union[ PrimeQ[ Table[ FromDigits[ IntegerDigits[b], i], {i, 2, n}]]] != {True}, k++ ]; b); k = 1; Do[ Print[ a[n]], {n, 2, 10}]
PROG
(Python)
from sympy import isprime
def conv(s, b): return sum(b**k for k, bk in enumerate(s[::-1]) if bk=='1')
def ok(s, n): return all(isprime(conv(s, b)) for b in range(2, n+1))
def a(n):
if n < 4: return 10
k = 3
while not ok(bin(k)[2:], n): k += 2
return int(bin(k)[2:])
print([a(n) for n in range(2, 9)]) # Michael S. Branicky, Oct 10 2021
CROSSREFS
See A086204 for decimal equivalents.
Sequence in context: A052983 A072804 A079793 * A284201 A324660 A336035
KEYWORD
nonn,base
AUTHOR
Richard FitzHugh (fitzhughrichard(AT)hotmail.com), Aug 22 2003
EXTENSIONS
Edited by Robert G. Wilson v, Aug 24 2003
a(10) from Phil Carmody's Web site added by Dario Alpern, May 14 2006
a(11) from Phil Carmody's website added by James G. Merickel, Feb 15 2010
a(12) from Jim Viebke on mersenneforum.org added by Andreas Höglund, Oct 17 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 April 24 14:54 EDT 2024. Contains 371960 sequences. (Running on oeis4.)