OFFSET
1,1
COMMENTS
Any term in the sequence (apart from the first) must be a concatenation of consecutive primes differing by a multiple of 6. - Francis J. McDonnell, Jun 26 2005
LINKS
Georg Fischer, Table of n, a(n) for n = 1..5720 [First 1000 terms from Zak Seidov]
FORMULA
EXAMPLE
a(2) is 3137 because 31 and 37 are consecutive primes and after concatenation 3137 is also prime. - Enoch Haga, Sep 30 2007
MAPLE
conc:=proc(a, b) local bb: bb:=convert(b, base, 10): 10^nops(bb)*a+b end: p:=proc(n) local w: w:=conc(ithprime(n), ithprime(n+1)): if isprime(w) then w fi end: seq(p(n), n=1..250); # Emeric Deutsch, Jul 19 2005
MATHEMATICA
Select[Table[p=Prime[n]; FromDigits[Join[Flatten[IntegerDigits[{p, NextPrime[p]}]]]], {n, 170}], PrimeQ] (* Jayanta Basu, May 16 2013 *)
Select[#[[1]]10^IntegerLength[#[[2]]]+#[[2]]&/@Partition[Prime[Range[200]], 2, 1], PrimeQ] (* Harvey P. Dale, Nov 03 2025 *)
PROG
(PARI) {m=1185; p=2; while(p<m, q=nextprime(p+1); s=""; v=digits(p); for(j=1, length(v), s=concat(s, v[j])); v=digits(q); for(j=1, length(v), s=concat(s, v[j])); if(isprime(k=eval(s)), print1(k, ", ")); p=q)} \\ Klaus Brockhaus
(PARI) o=2; forprime(p=3, 1e4, isprime(eval(Str(o, o=p))) & print1(precprime(p-1), p", ")) \\ M. F. Hasler, Feb 06 2011
(Haskell)
a030461 n = a030461_list !! (n-1)
a030461_list = filter ((== 1) . a010051') a045533_list
-- Reinhard Zumkeller, Apr 20 2012
(Magma) [Seqint( Intseq(NthPrime(n+1)) cat Intseq(NthPrime(n)) ): n in [1..200 ]| IsPrime(Seqint( Intseq(NthPrime(n+1)) cat Intseq(NthPrime(n)) )) ]; // Marius A. Burtea, Mar 21 2019
CROSSREFS
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
Edited by N. J. A. Sloane, Apr 19 2009 at the suggestion of Zak Seidov
STATUS
approved
