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

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

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

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
Showing 1-3 of 3 results.