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.

A259744 Smallest prime p such that, for every positive integer k <= n, the concatenation of p, prime(k)^2 and reverse(p) is prime.

Original entry on oeis.org

11, 17, 1097, 7949, 780587, 123638027, 3259714649, 76526081651
Offset: 1

Views

Author

Keywords

Comments

a(8) found by Hans Havermann.

Examples

			a(3)=1097 because 109747901 (1097&2^2&7901) and 109797901 (1097&3^2&7901) and 1097257901 (1097&5^2&7901) are prime numbers, and 1097 is the smallest prime for which this is the case.
		

Programs

  • Mathematica
    f[n_, k_] := FromDigits[Join[
       IntegerDigits[n], IntegerDigits[Prime[k]^2],
       Reverse[IntegerDigits[n]]]]
    a[n_] := Module[{p = 2, k = 1},
      While[k <= n,
       If[PrimeQ[f[p, k]], k++, p = NextPrime[p]; k = 1];
       ];
      Return[p]
    ](* Kellen Myers, Aug 16 2015 , note this is very slow *)