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!)
A348226 a(n) is the smallest positive integer that when expressed in bases 2 to n, but read in base n, is always prime. 1
2, 2, 43, 2, 45481, 2, 65484343, 186914543201, 50006393431, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
2,1
COMMENTS
a(n)=2 whenever n is prime.
Proof:
Let n be a prime number.
2 expressed in any base larger than 2 is still 2, which is prime.
2 expressed in base 2 is 10. And 10 read in base n is 1*n + 0 = n, which is prime.
The sequence, even when prime indexes are omitted, is not necessarily increasing.
Proof: a(9) > a(10).
LINKS
EXAMPLE
a(4) = 43, because
43 is prime
43 in base 3 is 1121 = 1*3^3 + 1*3^2 + 2*3 + 1 and
1*4^3 + 1*4^2 + 2*4 + 1 = 89, which is prime;
43 in base 2 is 101011 = 1*2^5 + 0*2^4 + 1*2^3 + 0*2^2 + 1*2^1 + 1 and
1*4^5 + 0*4^4 + 1*4^3 + 0*4^2 + 1*4^1 + 1 = 1093, which is prime;
and 43 is the smallest positive integer with this property.
a(10) = 50006393431
= 153060758677_9
= 564447201127_8
= 3420130221331_7
= 34550030320411_6
= 1304403114042211_5
= 232210213100021113_4
= 11210002000211222202121_3
= 101110100100100111010000001001010111_2;
if we read these numbers as base-10 numbers, they are all prime. And 50006393431 is the smallest positive integer with this property.
PROG
(PARI) isok(k, n) = {for (b=2, n, if (! ispseudoprime(fromdigits(digits(k, b), n)), return (0)); ); return (1); }
a(n) = my(k=1); while (!isok(k, n), k++); k; \\ Michel Marcus, Oct 09 2021
(Python)
from gmpy2 import digits, is_prime, next_prime
def A348226(n): # code assumes n <= 63 or n is prime
if is_prime(n):
return 2
p = 2
while True:
for i in range(n-1, 1, -1):
s = digits(p, i)
if not is_prime(int(s, n)):
break
else:
return p
p = next_prime(p) # Chai Wah Wu, Nov 19 2021
CROSSREFS
Sequence in context: A152016 A264516 A271845 * A280061 A349602 A156467
KEYWORD
nonn,base,more
AUTHOR
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 19 03:46 EDT 2024. Contains 371782 sequences. (Running on oeis4.)