%I #35 Jul 09 2020 01:30:29
%S 2,2,4,2,16,12,72,6,30,54,22,54,26,3,24,204,182,110,286,15,60,7,228,8,
%T 252,38,68,18,178,11,280,15,164,20,170,6,140,27,76,93,140,54,166,129,
%U 216,68,322,90,8,301
%N The minimum positive integer base such that the concatenation of the first n primes in that base is also a prime.
%C a(2*n+1) is always even; a(2*n) may be even or odd.
%H Chai Wah Wu, <a href="/A333595/b333595.txt">Table of n, a(n) for n = 1..841</a>
%H Stephen Lipp, <a href="/A333595/a333595.cs.txt">C# program</a>
%H Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Smarandache-WellinPrime.html">Smarandache-Wellin Prime</a>
%e For n=3, the first 3 primes are 2, 3, 5.
%e In base 2, their concatenation is 1011101 = 93 base 10, composite.
%e In base 3, their concatenation is 21012 = 194 base 10, composite (and even as it is for all odd bases).
%e In base 4, their concatenation is 2311 = 181 base 10, prime.
%t a[n_] := Block[{b=2, p = Prime@ Range@ n}, While[! PrimeQ@ FromDigits[ Join @@ IntegerDigits[p, b], b], b++]; b]; Array[a, 50] (* _Giovanni Resta_, Apr 05 2020 *)
%o (PARI) fromfatdigits(v,b)=if(#v==0,return(0)); my(t=v[1]); for(i=2,#v, t*=b^(1+logint(v[i],b)); t+=v[i]); t;
%o a(n)=my(P=primes(n),b); for(b=2,P[n], if(ispseudoprime(fromfatdigits(P,b)), return(b))); b=P[n]+1; while(!ispseudoprime(fromdigits(P,b)), b++); b \\ _Charles R Greathouse IV_, Apr 15 2020
%Y Cf. A019518.
%K nonn,base
%O 1,1
%A _Stephen Lipp_, Mar 27 2020
|