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-2 of 2 results.

A379355 Beginning with 3, least prime such that the reversal concatenation of first n terms is prime.

Original entry on oeis.org

3, 2, 2, 13, 2, 13, 59, 31, 263, 73, 23, 31, 449, 31, 59, 313, 2, 3, 211, 317, 31, 449, 241, 887, 349, 911, 853, 887, 313, 173, 1777, 179, 967, 503, 331, 113, 163, 359, 1153, 281, 97, 1823, 13, 23, 1657, 269, 223, 3623, 2017, 233, 61, 1361, 367, 1031, 79, 389, 577, 2963, 1741, 59, 13, 1439, 463, 797
Offset: 1

Views

Author

J.W.L. (Jan) Eerland, Dec 21 2024

Keywords

Comments

"Reverse concatenation" here seems to refer to the decimal concatenation R(a(n)) || R(a(n-1)) || ... || R(a(3)) || R(a(2)) || R(a(1)) where R(k) means "reverse digits of k". - N. J. A. Sloane, Jan 03 2025

Crossrefs

The primes produced are in A379782.

Programs

  • Mathematica
    w = {3};
    Do[k = 1;
      q = Monitor[
        Parallelize[
         While[True,
          If[PrimeQ[
             FromDigits[
              Join @@ IntegerDigits /@
                Reverse[
                 IntegerDigits[
                  FromDigits[
                   Join @@ IntegerDigits /@ Append[w, Prime[k]]]]]]], Break[]]; k++];
         Prime[k]], k];
      w = Append[w, q], {i, 2, 57}];
    w
  • Python
    from itertools import count, islice
    from gmpy2 import digits, is_prime, mpz, next_prime
    def agen(): # generator of terms
        r, an = "", 3
        while True:
            yield int(an)
            r = digits(an)[::-1] + r
            p = 2
            while not is_prime(mpz(digits(p)[::-1]+r)): p = next_prime(p)
            an = p
    print(list(islice(agen(), 57))) # Michael S. Branicky, Dec 21 2024

A202997 a(1) = 3 ; a(n+1) is the prime number obtained by the concatenation {p, a(n)} where p is the smallest prime prefix.

Original entry on oeis.org

3, 23, 223, 31223, 231223, 31231223, 2931231223, 372931231223, 17372931231223, 1317372931231223, 1971317372931231223, 1571971317372931231223, 891571971317372931231223, 79891571971317372931231223, 25179891571971317372931231223, 4325179891571971317372931231223
Offset: 1

Views

Author

Michel Lagneau, Dec 27 2011

Keywords

Comments

By Xylouris' version of Linnik's theorem, a(n) << 3^(6.2^n + cn) for some constant c. [Charles R Greathouse IV, Dec 27 2011]

Examples

			a(1) = 3;
a(2) = 23 because 2 is the smallest prime prefix and 23 is prime;
a(3) = 223 because 2 is the smallest prime prefix and 223 is prime;
a(4) = 31223 because 31 is the smallest prime prefix and 31223 is prime.
		

Crossrefs

Programs

  • Maple
    a0:=3: printf(`%d, `,a0):for it from 1 to 20 do: i:=0:for n from 1 to 1000 while(i=0)  do:p0:=ithprime(n):n0:=length(a0):x:=p0*10^n0+a0: if type(x,prime)=true then printf(`%d, `,x):i:=1:a0:=x:else fi:od:od:
Showing 1-2 of 2 results.