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 14 results. Next

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

Original entry on oeis.org

5, 17, 103, 127, 157, 191, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 227, 234, 235, 236, 237, 238, 258, 259, 260, 261, 262, 307, 347, 354, 355, 356, 357, 358, 431, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539
Offset: 0

Views

Author

Patrick De Geest, Oct 15 1998

Keywords

Comments

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

Examples

			n=17 -> next prime is 19, previous prime is 13, thus '1319' and '1913' are both primes.
		

Crossrefs

Programs

  • Mathematica
    c1c2pQ[n_]:=Module[{c1=NextPrime[n,-1],c2=NextPrime[n]},AllTrue[ {c1* 10^IntegerLength[ c2]+c2,c2*10^IntegerLength[c1]+c1},PrimeQ]]; Select[ Range[600],c1c2pQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 23 2019 *)

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

A034595 Concatenation of 'nextprime(a(n)) and a(n)' and 'a(n) and nextprime(a(n))' are both prime.

Original entry on oeis.org

27, 51, 63, 123, 199, 217, 219, 233, 257, 341, 353, 357, 417, 423, 429, 473, 501, 519, 523, 551, 579, 597, 609, 653, 657, 667, 669, 687, 703, 717, 777, 783, 801, 873, 891, 971, 987, 1017, 1043, 1139, 1157, 1161, 1271, 1337, 1343, 1389, 1671, 1973, 2019
Offset: 1

Views

Author

Patrick De Geest, Oct 15 1998

Keywords

Examples

			a(n)=353 -> nextprime(a(n)) is 359 so '353359' and '359353' are both prime.
		

Crossrefs

Intersection of A034591 and A034594.

Programs

  • Mathematica
    bpQ[n_]:=Module[{np=NextPrime[n]},AllTrue[{n*10^IntegerLength[np]+ np, np* 10^IntegerLength[ n]+n}, PrimeQ]]; Select[Range[2100],bpQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, May 19 2016 *)

Extensions

Offset changed by Andrew Howroyd, Aug 13 2024

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 *)
Showing 1-10 of 14 results. Next