cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-1 of 1 results.

A384958 a(n) is the first prime p such that the concatenations of n consecutive primes, starting with p, in both forward and backward directions, are prime.

Original entry on oeis.org

2, 199, 313, 139, 67, 113, 163, 1583, 23789, 941, 131, 5351, 26801, 2693, 4073, 15859, 4919, 23209, 176053, 86783, 29717, 20849, 151289, 50111, 51971, 23689, 11807, 180337, 563, 25153, 517381, 36313, 256121, 753091, 208441, 28573, 4049, 108943, 451361, 114343, 28447, 21001, 4001, 3137, 6833, 885919
Offset: 1

Views

Author

Robert Israel, Jun 13 2025

Keywords

Examples

			a(4) = 139 because the four consecutive primes starting with 139 are 139, 149, 151, 157, both 139149151157 and 157151149139 are prime, and no smaller prime works.
		

Crossrefs

Cf. A384953.

Programs

  • Maple
    rcat:= proc(L) local x,i;
      x:= L[1];
      for i from 2 to nops(L) do
        x:= 10^(1+ilog10(x))*L[i] + x
      od;
      x
    end proc:
    fcat:= proc(L) local x,i;
      x:= L[1];
      for i from 2 to nops(L) do
        x:= 10^(1+ilog10(L[i]))*x + L[i]
      od;
      x
    end proc:
    f:= proc(n) local L,i;
         L:= [0,seq(ithprime(i),i=1..n-1)];
         do
           L:= [op(L[2..-1]),nextprime(L[-1])];
           if isprime(fcat(L)) and isprime(rcat(L)) then return L[1] fi
         od
    end proc:
    map(f, [$1..50]);
Showing 1-1 of 1 results.