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-10 of 13 results. Next

A034808 Concatenation of 'prevprime(k) and k' is a prime.

Original entry on oeis.org

3, 9, 37, 39, 51, 63, 87, 89, 111, 117, 123, 153, 157, 163, 173, 177, 183, 207, 211, 213, 217, 219, 239, 249, 257, 263, 267, 269, 273, 277, 279, 289, 321, 323, 327, 333, 337, 339, 343, 359, 369, 379, 407, 423, 439, 441, 459, 471, 473, 477, 479, 489, 497, 513
Offset: 1

Views

Author

Patrick De Geest, Oct 15 1998

Keywords

Comments

Since there are primes in the sequence, and concat(p,p) = p*(10^x+1) is always composite, it is clear that here the variant 2 (A151799(n) < n) of the prevprime function is used, rather than the variant 1 (A007917(n) <= n). - M. F. Hasler, Sep 09 2015

Examples

			n=333 -> previous prime is 331, thus '331333' is a prime.
		

Crossrefs

Programs

  • Mathematica
    coQ[n_]:=PrimeQ[FromDigits[Flatten[IntegerDigits[{NextPrime[n,-1],n}]]]]; Select[Range[3,513],coQ[#]&] (* Jayanta Basu, May 30 2013 *)
    Select[Range[2,550],PrimeQ[NextPrime[#,-1]*10^IntegerLength[#]+#]&] (* Harvey P. Dale, Nov 22 2020 *)
  • PARI
    isok(n)=n>2 && isprime(fromdigits(concat(digits(precprime(n-1)), digits(n)))) \\ Andrew Howroyd, Aug 13 2024
  • Python
    from sympy import isprime, prevprime
    def aupto(m):
      return [k for k in range(3, m+1) if isprime(int(str(prevprime(k))+str(k)))]
    print(aupto(513)) # Michael S. Branicky, Mar 09 2021
    

Extensions

Offset changed by Andrew Howroyd, Aug 13 2024

A034809 Numbers k such that the concatenation of k and previous_prime(k) is a prime.

Original entry on oeis.org

4, 5, 9, 10, 16, 24, 33, 36, 42, 46, 51, 53, 56, 59, 63, 66, 67, 69, 75, 76, 78, 81, 87, 96, 102, 106, 108, 111, 114, 116, 123, 125, 129, 130, 135, 137, 144, 145, 147, 148, 153, 156, 159, 170, 171, 177, 179, 180, 184, 187, 190, 192, 195, 196, 198, 207, 211, 214
Offset: 1

Views

Author

Patrick De Geest, Oct 15 1998

Keywords

Examples

			k=156 is a term because the largest prime < 156 is 151 and '156151' is a prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[250],PrimeQ[FromDigits[Join[IntegerDigits[#], IntegerDigits[ NextPrime[ #,-1]]]]]&] (* Harvey P. Dale, Jul 10 2017 *)
  • Python
    from sympy import isprime, prevprime
    def ok(n): return isprime(int(str(n) + str(prevprime(n))))
    print(list(filter(ok, range(3, 215)))) # Michael S. Branicky, Apr 05 2021

A034810 Concatenation of 'prevprime(k) and k and nextprime(k)' is a prime.

Original entry on oeis.org

7, 10, 13, 16, 19, 36, 37, 40, 43, 46, 58, 63, 74, 85, 88, 97, 98, 104, 125, 132, 143, 153, 156, 164, 168, 169, 175, 188, 196, 203, 206, 222, 224, 233, 241, 269, 292, 304, 305, 308, 311, 317, 331, 333, 338, 344, 359, 364, 367, 368, 372, 382, 389, 395, 397, 409
Offset: 1

Views

Author

Patrick De Geest, Oct 15 1998

Keywords

Examples

			n=88 --> previous prime is 83, next prime is 89, thus '838889' is a prime.
		

Crossrefs

Programs

  • Mathematica
    coQ[n_]:=PrimeQ[FromDigits[Flatten[IntegerDigits[{NextPrime[n,-1],n,NextPrime[n]}]]]]; Select[Range[3,409],coQ[#]&] (* Jayanta Basu, May 30 2013 *)
  • PARI
    isok(n)=n>2 && isprime(fromdigits(concat([digits(precprime(n-1)), digits(n), digits(nextprime(n+1))]))) \\ Andrew Howroyd, Aug 13 2024

Extensions

Offset changed by Andrew Howroyd, Aug 13 2024

A034814 Concatenations C1 and C2 are both prime (see the comment lines).

Original entry on oeis.org

9, 51, 63, 87, 111, 123, 153, 177, 207, 211, 239, 263, 273, 289, 327, 333, 343, 359, 407, 471, 489, 497, 513, 541, 597, 621, 651, 659, 663, 681, 687, 693, 697, 747, 753, 793, 819, 831, 869, 909, 977, 987, 1027, 1041, 1089, 1131, 1143, 1239, 1491, 1611
Offset: 1

Views

Author

Patrick De Geest, Oct 15 1998

Keywords

Comments

C1 = 'prevprime(k) followed by k'.
C2 = 'k followed by prevprime(k)'.

Examples

			n=747 -> previous prime is 743, thus '743747' and '747743' are both primes.
		

Crossrefs

Intersection of A034808 and A034809.

Extensions

Offset changed by Andrew Howroyd, Aug 13 2024

A034811 Concatenation of 'nextprime(k) and k and prevprime(k)' is a prime.

Original entry on oeis.org

8, 23, 32, 36, 44, 54, 66, 74, 77, 84, 91, 104, 113, 115, 122, 130, 132, 162, 174, 178, 187, 188, 191, 204, 212, 222, 224, 232, 235, 259, 267, 281, 286, 295, 302, 305, 317, 325, 344, 353, 367, 368, 384, 389, 391, 401, 406, 427, 430, 433, 457, 458, 461, 464
Offset: 1

Views

Author

Patrick De Geest, Oct 15 1998

Keywords

Examples

			n=353 -> next prime is 359, previous prime is 349, thus '359353349' is a prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[500],PrimeQ[FromDigits[Flatten[IntegerDigits/@ { NextPrime[#], #, NextPrime[ #,-1]}]]]&] (* Harvey P. Dale, Jan 12 2016 *)
  • PARI
    isok(n)=n>2 && isprime(fromdigits(concat([digits(nextprime(n+1)), digits(n), digits(precprime(n-1))]))) \\ Andrew Howroyd, Aug 13 2024

Extensions

Offset changed by Andrew Howroyd, Aug 13 2024

A034812 Concatenation of 'prevprime(k) and k and prevprime(k)' is a prime.

Original entry on oeis.org

5, 8, 9, 12, 14, 17, 19, 23, 25, 28, 31, 33, 38, 39, 41, 42, 47, 48, 51, 60, 61, 62, 63, 69, 71, 72, 75, 77, 78, 80, 81, 84, 85, 91, 102, 104, 105, 111, 124, 126, 149, 150, 167, 181, 182, 189, 192, 194, 215, 222, 227, 230, 233, 242, 243, 256, 271, 273, 283, 288, 308
Offset: 1

Views

Author

Patrick De Geest, Oct 15 1998

Keywords

Examples

			n=222 -> previous prime is 211, thus '211222211' is a prime.
		

Crossrefs

Programs

  • Mathematica
    okQ[n_] := Module[{idppn=IntegerDigits[NextPrime[n,-1]]}, PrimeQ[FromDigits[Join[idppn, IntegerDigits[n], idppn]]]]; Select[Range[350], okQ] (* Harvey P. Dale, Jan 07 2011 *)
  • PARI
    isok(n)=my(x=digits(precprime(n-1))); n>2 && isprime(fromdigits(concat([x, digits(n), x]))) \\ Andrew Howroyd, Aug 13 2024

Extensions

Offset changed by Andrew Howroyd, Aug 13 2024

A034813 Concatenations C1 and C2 are both prime (see the comment lines).

Original entry on oeis.org

36, 74, 104, 132, 188, 222, 224, 305, 317, 344, 367, 368, 389, 457, 458, 475, 540, 572, 584, 608, 631, 676, 682, 689, 697, 738, 756, 760, 781, 797, 829, 841, 893, 910, 911, 914, 928, 982, 1018, 1104, 1122, 1178, 1186, 1317, 1328, 1391, 1402, 1406, 1518
Offset: 0

Views

Author

Patrick De Geest, Oct 15 1998

Keywords

Comments

C1 = 'prevprime(n) followed by n followed by nextprime(n)'
C2 = 'nextprime(n) followed by n followed by prevprime(n)'

Examples

			n=797 -> previous prime is 787, next prime is 809, thus '787797809' and '809797787' are both primes.
		

Crossrefs

Programs

  • Mathematica
    c1c2Q[n_]:=Module[{ia=IntegerDigits[NextPrime[n,-1]],ib=IntegerDigits[n], ic= IntegerDigits[NextPrime[n]]}, AllTrue[{FromDigits[Join[ia,ib,ic]], FromDigits[Join[ic,ib,ia]]},PrimeQ]]; Select[Range[1600],c1c2Q] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Apr 06 2018 *)

A034820 Concatenations C1 and C2 and C3 and C4 are all prime (see the comment lines).

Original entry on oeis.org

16776, 41719, 164612, 188435, 188682, 312184, 317594, 392771, 397617, 450413, 476055, 486283, 492240, 497913, 539471, 584029, 620029, 640883, 648445, 656757, 903009, 992790, 993475, 995917, 1045387, 1082078, 1194606, 1252496, 1322841
Offset: 0

Views

Author

Patrick De Geest, Oct 15 1998

Keywords

Comments

C1 = 'prevprime(n) followed by n followed by prevprime(n)'
C2 = 'prevprime(n) followed by n followed by nextprime(n)'
C3 = 'nextprime(n) followed by n followed by prevprime(n)'
C4 = 'nextprime(n) followed by n followed by nextprime(n)'

Examples

			n=41719 -> next prime is 41729, previous prime is 41687, thus '416874171941687' and '416874171941729' and '417294171941687' and '417294171941729' are all four primes.
		

Crossrefs

A034815 Concatenations C1 and C2 are both prime (see the comment lines).

Original entry on oeis.org

33, 51, 53, 63, 111, 123, 129, 211, 237, 273, 357, 489, 519, 573, 597, 609, 639, 651, 653, 657, 669, 681, 687, 747, 753, 819, 831, 873, 891, 987, 997, 1071, 1611, 1881, 2037, 2049, 2247, 2271, 2613, 2763, 3063, 3267, 3393, 3573, 3969, 4251, 4263, 4293
Offset: 0

Views

Author

Patrick De Geest, Oct 15 1998

Keywords

Comments

C1 = 'nextprime(n) followed by n'
C2 = 'n followed by prevprime(n)'

Examples

			n=1881 -> next prime is 1889, previous prime is 1879, thus '18891881' and '18811879' are both primes.
		

Crossrefs

Programs

  • Mathematica
    okQ[n_]:=Module[{idn=IntegerDigits[n],ida,idb},ida=IntegerDigits[NextPrime[n,-1]];idb=IntegerDigits[NextPrime[n]];PrimeQ[FromDigits[Join[idn,ida]]]&&PrimeQ[FromDigits[Join[idb,idn]]]]
    Select[Range[5000],okQ]  (* Harvey P. Dale, Dec 25 2010 *)

A034816 Concatenations C1 and C2 are both prime (see the comment lines).

Original entry on oeis.org

9, 51, 63, 117, 123, 157, 183, 213, 217, 219, 257, 263, 321, 327, 333, 423, 441, 473, 541, 597, 621, 687, 693, 723, 777, 879, 909, 987, 1101, 1143, 1187, 1387, 1459, 1551, 1887, 2127, 2179, 2193, 2817, 3197, 3339, 3513, 3633, 4029, 4209, 4429, 4529, 4557
Offset: 0

Views

Author

Patrick De Geest, Oct 15 1998

Keywords

Comments

C1 = 'prevprime(n) followed by n'
C2 = 'n followed by nextprime(n)'

Examples

			n=1551 -> previous prime is 1549, next prime is 1553, thus '15491551' and '15511553' are both primes.
		

Crossrefs

Showing 1-10 of 13 results. Next