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

A113584 Beginning with 3, least prime such that concatenation of first n terms and its digit reversal both are primes.

Original entry on oeis.org

3, 7, 3, 3, 43, 101, 19, 269, 1873, 41, 241, 3137, 139, 9011, 9187, 641, 29881, 12227, 3169, 13499, 8539, 7019, 19447, 12899, 73243, 124769, 1063, 37847, 127, 32321, 104287, 3407, 93553, 256643, 165469, 744659, 60217, 54773, 49297, 214457, 314077, 271409, 602383, 56921, 193051, 255383, 75991, 25667, 583147, 121019
Offset: 1

Views

Author

Amarnath Murthy, Nov 06 2005

Keywords

Crossrefs

Programs

  • Maple
    rev:= proc(n) local L,i;
      L:= convert(n,base,10);
      add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    tcat:= proc(a,b)
      a*10^(1+ilog10(b))+b
    end proc:
    A:= 3: x:= 3:
    for i from 1 to 50 do
       p:= 2:
       do
         p:= nextprime(p);
         y:= tcat(x,p);
         if isprime(y) and isprime(rev(y)) then
              A:= A,p;
              x:= y;
              break
         fi;
       od
    od:
    A; # Robert Israel, Dec 26 2024
  • 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]]]]]]] &&
            PrimeQ[FromDigits[
              Join @@ IntegerDigits /@ Append[w, Prime[k]]]], Break[]]; k++];
         Prime[k]], k];
      w = Append[w, q], {i, 2, 50}];
    w (* J.W.L. (Jan) Eerland, Dec 19 2024 *)
  • Python
    from itertools import count, islice
    from gmpy2 import digits, is_prime, mpz, next_prime
    def agen(): # generator of terms
        s, r, an = "", "", 3
        while True:
            yield int(an)
            d = digits(an)
            s, r, p, sp = s+d, d[::-1]+r, 3, "3"
            while not is_prime(mpz(s+sp)) or not is_prime(mpz(sp[::-1]+r)):
                p = next_prime(p)
                sp = digits(p)
            an = p
    print(list(islice(agen(), 50))) # Michael S. Branicky, Jan 02 2025

Extensions

Corrected and extended by Hans Havermann, Nov 08 2005
a(40)-a(50) from J.W.L. (Jan) Eerland, Dec 19 2024

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

A379354 Beginning with 3, least prime such that concatenation of first n terms is prime.

Original entry on oeis.org

3, 7, 3, 3, 7, 29, 43, 11, 61, 71, 19, 191, 43, 53, 7, 239, 31, 173, 43, 137, 79, 53, 13, 557, 619, 47, 271, 797, 463, 83, 211, 467, 229, 131, 199, 359, 1249, 887, 853, 641, 109, 257, 1153, 1031, 613, 953, 607, 641, 499, 359, 1297, 1031, 2137, 401, 283, 29, 1321, 1499, 547, 83, 397, 2153, 1759, 1277
Offset: 1

Views

Author

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

Keywords

Crossrefs

Programs

  • Mathematica
    w = {3};
    Do[k = 1;
      q = Monitor[
        Parallelize[
         While[True,
          If[PrimeQ[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
        s, an = "", 3
        while True:
            yield int(an)
            s += digits(an)
            p = 3
            while not is_prime(mpz(s+digits(p))): p = next_prime(p)
            an = p
    print(list(islice(agen(), 57))) # Michael S. Branicky, Dec 21 2024

A379761 Beginning with 7, least prime such that concatenation of first n terms and its digit reversal both are primes.

Original entry on oeis.org

7, 3, 3, 31, 389, 1021, 2243, 1831, 5849, 15361, 9887, 3877, 4157, 919, 22637, 14449, 27617, 80221, 5039, 51043, 14009, 126079, 24443, 68311, 49193, 47059, 13049, 253681, 271409, 221227, 138869, 116953, 146297, 21841, 1211549, 322501, 212633, 281791, 216071, 1901749, 38747, 116437
Offset: 1

Views

Author

J.W.L. (Jan) Eerland, Jan 02 2025

Keywords

Examples

			31 is a term because the concatenation of {7,3,3,31} and {13,3,3,7} are respectively 73331 and 13337 which are both prime.
2243 is a term because the concatenation of {7,3,3,31,389,1021,2243} and {3422,1201,983,13,3,3,7} are respectively 7333138910212243 and 3422120198313337 which are both prime.
		

Crossrefs

Programs

  • Maple
    rev:= proc(n) local L,i;
      L:= convert(n,base,10);
      add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    tcat:= proc(a,b)
      a*10^(1+ilog10(b))+b
    end proc:
    A:= 7: x:= 7:
    for i from 1 to 50 do
       p:= 2:
       do
         p:= nextprime(p);
         y:= tcat(x,p);
         if isprime(y) and isprime(rev(y)) then
              A:= A,p;
              x:= y;
              break
         fi;
       od
    od:
    A; # after Robert Israel in A113584
  • Mathematica
    w={7};Do[k=1;q=Monitor[Parallelize[While[True,If[PrimeQ[FromDigits[Join@@IntegerDigits/@Reverse[IntegerDigits[FromDigits[Join@@IntegerDigits/@Append[w,Prime[k]]]]]]]&&PrimeQ[FromDigits[Join@@IntegerDigits/@Append[w,Prime[k]]]],Break[]];k++];Prime[k]],{i,k}];w=Append[w,q],{i,2,50}];w
  • Python
    from itertools import count, islice
    from gmpy2 import digits, is_prime, mpz, next_prime
    def agen(): # generator of terms
        s, r, an = "", "", 7
        while True:
            yield int(an)
            d = digits(an)
            s, r, p, sp = s+d, d[::-1]+r, 3, "3"
            while not is_prime(mpz(s+sp)) or not is_prime(mpz(sp[::-1]+r)):
                p = next_prime(p)
                sp = digits(p)
            an = p
    print(list(islice(agen(), 40))) # Michael S. Branicky, Jan 02 2025

A380010 Beginning with 7, least prime such that concatenation of the first n terms is prime.

Original entry on oeis.org

7, 3, 3, 3, 31, 23, 13, 3, 167, 13, 137, 3, 73, 383, 499, 431, 13, 101, 61, 47, 67, 101, 13, 83, 1237, 107, 97, 467, 499, 677, 1423, 353, 73, 431, 331, 683, 487, 2141, 3, 1753, 1787, 31, 443, 139, 653, 1327, 17, 919, 173, 2851, 137, 547, 557, 5167, 347, 7867, 839, 19, 179, 19
Offset: 1

Views

Author

J.W.L. (Jan) Eerland, Jan 09 2025

Keywords

Crossrefs

Programs

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

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

Original entry on oeis.org

7, 3, 3, 13, 3, 2, 13, 47, 43, 47, 37, 41, 109, 41, 139, 149, 109, 263, 73, 563, 163, 41, 19, 797, 61, 107, 31, 821, 43, 149, 37, 953, 211, 89, 547, 353, 337, 167, 67, 239, 1009, 449, 97, 23, 349, 41, 31, 911, 61, 929, 229, 797, 331, 191, 463, 107, 463, 809, 2887, 971
Offset: 1

Views

Author

J.W.L. (Jan) Eerland, Jan 09 2025

Keywords

Comments

"Reverse concatenation" here refers 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".

Crossrefs

Programs

  • Mathematica
    w={7};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,50}];w
  • Python
    from itertools import count, islice
    from gmpy2 import digits, is_prime, mpz, next_prime
    def agen(): # generator of terms
        r, an = "", 7
        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(), 50))) # after Michael S. Branicky in A379355

A380227 Beginning with 11, least prime such that concatenation of first n terms and its digit reversal both are primes.

Original entry on oeis.org

11, 3, 11, 31, 59, 463, 131, 103, 599, 3253, 7649, 439, 12791, 2953, 17321, 16651, 10007, 51787, 4871, 1483, 6857, 15649, 53051, 61441, 84449, 35533, 19913, 39097, 23081, 206527, 44939, 189517, 32369, 106657, 606899, 117703, 222977, 220903, 69779, 12007, 95063, 136471, 43973
Offset: 1

Views

Author

J.W.L. (Jan) Eerland, Jan 17 2025

Keywords

Crossrefs

Cf. A113584 (same for 3), A379761 (same for 7).

Programs

  • Maple
    rev:= proc(n) local L,i;
      L:= convert(n,base,10);
      add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    tcat:= proc(a,b)
      a*10^(1+ilog10(b))+b
    end proc:
    A:= 11: x:= 11:
    for i from 1 to 50 do
       p:= 2:
       do
         p:= nextprime(p);
         y:= tcat(x,p);
         if isprime(y) and isprime(rev(y)) then
              A:= A,p;
              x:= y;
              break
         fi;
       od
    od:
    A; # after Robert Israel in A113584
  • Mathematica
    w={11};Do[k=1;q=Monitor[Parallelize[While[True,If[PrimeQ[FromDigits[Join@@IntegerDigits/@Reverse[IntegerDigits[FromDigits[Join@@IntegerDigits/@Append[w,Prime[k]]]]]]]&&PrimeQ[FromDigits[Join@@IntegerDigits/@Append[w,Prime[k]]]],Break[]];k++];Prime[k]],{i,k}];w=Append[w,q],{i,2,50}];w
  • Python
    from itertools import count, islice
    from gmpy2 import digits, is_prime, mpz, next_prime
    def agen(): # generator of terms
        s, r, an = "", "", 11
        while True:
            yield int(an)
            d = digits(an)
            s, r, p, sp = s+d, d[::-1]+r, 3, "3"
            while not is_prime(mpz(s+sp)) or not is_prime(mpz(sp[::-1]+r)):
                p = next_prime(p)
                sp = digits(p)
            an = p
    print(list(islice(agen(), 40))) # after Michael S. Branicky in A113584

A382898 Beginning with 13, least prime such that concatenation of first n terms and its digit reversal both are primes.

Original entry on oeis.org

13, 151, 227, 2083, 887, 79, 2963, 1579, 6287, 1321, 6719, 54919, 26699, 8647, 4229, 3919, 102161, 42433, 1667, 192193, 11633, 186343, 47339, 3259, 65963, 14293, 29717, 61297, 28493, 231367, 43793, 145021, 566441, 475903, 92381, 80473, 139967, 882061, 72893, 709279, 6053, 114487, 1179389, 204331, 203351, 139831, 396239, 205327, 501173, 951589
Offset: 1

Views

Author

J.W.L. (Jan) Eerland, Apr 08 2025

Keywords

Crossrefs

Cf. A113584 (same for 3), A379761 (same for 7), A380227 (same for 11).

Programs

  • Maple
    rev:= proc(n) local L,i;
      L:= convert(n,base,10);
      add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    tcat:= proc(a,b)
      a*10^(1+ilog10(b))+b
    end proc:
    A:= 13: x:= 13:
    for i from 1 to 50 do
       p:= 2:
       do
         p:= nextprime(p);
         y:= tcat(x,p);
         if isprime(y) and isprime(rev(y)) then
              A:= A,p;
              x:= y;
              break
         fi;
       od
    od:
    A; # after Robert Israel in A113584
  • Mathematica
    w={13};Do[k=1;q=Monitor[Parallelize[While[True,If[PrimeQ[FromDigits[Join@@IntegerDigits/@Reverse[IntegerDigits[FromDigits[Join@@IntegerDigits/@Append[w,Prime[k]]]]]]]&&PrimeQ[FromDigits[Join@@IntegerDigits/@Append[w,Prime[k]]]],Break[]];k++];Prime[k]],{i,k}];w=Append[w,q],{i,2,50}];w
  • Python
    from itertools import count, islice
    from gmpy2 import digits, is_prime, mpz, next_prime
    def agen(): # generator of terms
        s, r, an = "", "", 13
        while True:
            yield int(an)
            d = digits(an)
            s, r, p, sp = s+d, d[::-1]+r, 3, "3"
            while not is_prime(mpz(s+sp)) or not is_prime(mpz(sp[::-1]+r)):
                p = next_prime(p)
                sp = digits(p)
            an = p
    print(list(islice(agen(), 40))) # after Michael S. Branicky in A113584
Showing 1-8 of 8 results.