|
|
A090497
|
|
Smallest prime p such that the concatenation 2,3,5,7, ... (primes) ... p is a multiple of prime(n).
|
|
1
|
|
|
2, 29, 5, 11, 17, 61, 31, 271, 3, 13, 107, 1051, 439, 211, 5, 1153, 149, 23, 37, 173, 593, 173, 281, 347, 191, 433, 2083, 109, 389, 1453, 277, 383, 227, 443, 1879, 11, 233, 353, 191, 1723, 547, 241, 397, 181, 199, 7549, 79, 11, 547, 877, 313, 1213, 409, 79, 2969
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
EXAMPLE
|
a(4) = 11 and 235711 is a multiple of prime(4) = 7.
|
|
MAPLE
|
N:= 100: # for a(1)..a(N)
P:= [seq(ithprime(i), i=1..N)]:
R:= Vector(N): count:= 0:
p:= 1: s:= 0:
while count < N do
p:= nextprime(p);
s:= 10^(1+ilog10(p))*s+p;
r:= select(t -> R[t]=0 and s mod P[t] = 0, [$1..N]);
R[r]:= p;
count:= count+nops(r);
od:
|
|
MATHEMATICA
|
f[n_] := Block[{p = Prime[n], k = 1, q = 2}, While[ Mod[q, p] != 0, k++; q = FromDigits[ Join[ IntegerDigits[q], IntegerDigits[ Prime[k]]]]]; Prime[k]]; Table[ f[n], {n, 1, 55}]
|
|
PROG
|
(Python)
from sympy import prime, nextprime
def a(n):
pstr, pn, p = "2", prime(n), 2
while int(pstr)%pn != 0:
p = nextprime(p)
pstr += str(p)
return p
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|