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!)
A236174 Maximal prime among the base-k representations of the n-th prime, read in decimal, for k=2,3,...,10. 6
2, 11, 101, 13, 23, 31, 101, 103, 10111, 131, 43, 211, 131, 223, 101111, 311, 113, 331, 2111, 1013, 1021, 2221, 1103, 1011001, 1201, 1100101, 10211, 1223, 1231, 1301, 331, 2003, 211, 12011, 10010101, 2113, 10011101, 10100011, 2213, 10101101, 10110011, 20201, 2333, 21011, 3011, 11000111, 21211, 337, 3203, 11100101 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Let p = n-th prime. Write p in base k, k=2,3,4,5,..., and stop when the result is a prime when looked at in base 10. - N. J. A. Sloane, Jan 25 2014
LINKS
EXAMPLE
Let n=10, then prime(n)=29 (in base 10). The representations of 29 in bases 2,3,4,...,10 are 11101,1002,131,...,29 respectively. In this list 131 is the first and therefore the maximal prime. Thus a(10)=131.
MATHEMATICA
Map[First[First[Select[Map[{#, PrimeQ[#]}&, Map[FromDigits, IntegerDigits[Prime[#], Range[2, 10]]]], #[[2]]==True&]]]&, Range[50]]
PROG
(PARI)
base_b(n, b) = {
my(s=[], r, x);
while(n>0,
r = n%b;
n = n\b;
s = concat(r, s)
);
x=10;
eval(Pol(s))
}
A236174(maxp) = {
my(s=[], b, t);
forprime(p=2, maxp,
for(b=2, 10,
t=base_b(p, b);
if(isprime(t), s=concat(s, t); break)
)
);
s
} \\ Colin Barker, Jan 23 2014
(Python)
from sympy import prime, isprime
def A236174(n):
....p = prime(n)
....for b in range(2, 11):
........x, y, z = p, 0, 1
........while x >= b:
............x, r = divmod(x, b)
............y += r*z
............z *= 10
........y += x*z
........if isprime(y):
............return y # Chai Wah Wu, Jan 03 2015
CROSSREFS
Sequence in context: A157715 A001271 A038371 * A003021 A097463 A263607
KEYWORD
nonn,base,nice
AUTHOR
Vladimir Shevelev, Jan 19 2014
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 23 11:35 EDT 2024. Contains 371912 sequences. (Running on oeis4.)