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.

A068660 Primes formed from the concatenation of k, k+1 and k for some k.

Original entry on oeis.org

787, 9109, 111211, 131413, 333433, 373837, 394039, 414241, 474847, 575857, 596059, 616261, 697069, 717271, 777877, 798079, 818281, 838483, 101102101, 103104103, 129130129, 149150149, 181182181, 187188187, 189190189, 191192191, 193194193, 207208207, 217218217
Offset: 1

Views

Author

Amarnath Murthy, Mar 01 2002

Keywords

Crossrefs

These are the primes in A261618. - M. F. Hasler, Nov 25 2015

Programs

  • Magma
    [m: n in [2..300] | IsPrime(m) where m is Seqint(Intseq(n) cat Intseq(n+1) cat Intseq(n))]; // Vincenzo Librandi, Sep 28 2015
    
  • Maple
    ncat:= (a,b) -> a*10^(1+ilog10(b))+b:
    select(isprime, [seq(ncat(n,ncat(n+1,n)),n=1..1000,2)]); # Robert Israel, Oct 23 2015
  • Mathematica
    concat[n_]:=Module[{idn=IntegerDigits[n]},FromDigits[Join[idn, IntegerDigits[ n+1],idn]]]; Select[concat/@Range[200],PrimeQ] (* Harvey P. Dale, Aug 20 2014 *)
    A = Table[(n*10^(Floor[Log[10, 10(n+1)]])+(n+1))*10^(Floor[Log[10, 10(n)]])+n, {n, 1, 120}]; Select[A, PrimeQ] (* José de Jesús Camacho Medina, Sep 09 2015 *)
    Select[Table[FromDigits[Join[Flatten[IntegerDigits[{n, n + 1, n}]]]], {n, 200}], PrimeQ] (* Vincenzo Librandi, Sep 28 2015 *)
  • PARI
    for(n=1, 1e3, if(isprime(k=eval(Str(n, n+1, n))), print1(k", "))) \\ Altug Alkan, Sep 28 2015
    
  • Python
    from sympy import isprime
    def aupto(N):
      return [t for t in (int(str(k)+str(k+1)+str(k)) for k in range(1, N+1, 2)) if isprime(t)]
    print(aupto(217)) # Michael S. Branicky, Jul 09 2021

A264814 Numbers k such that concatenate(k,k+1,k) is prime.

Original entry on oeis.org

7, 9, 11, 13, 33, 37, 39, 41, 47, 57, 59, 61, 69, 71, 77, 79, 81, 83, 101, 103, 129, 149, 181, 187, 189, 191, 193, 207, 217, 229, 231, 241, 289, 291, 299, 301, 303, 307, 317, 333, 347, 359, 373, 377, 383, 387, 409, 439, 451, 467, 473, 487, 489, 509, 517, 527
Offset: 1

Views

Author

M. F. Hasler, Nov 25 2015

Keywords

Comments

Motivated by sequence A068660 which lists these primes.

Examples

			11 is in the sequence because 111211 is prime.
13 is in the sequence because 131413 is prime.
15 is not in the sequence because 151615 = 5 * 30323.
		

Crossrefs

Programs

  • Magma
    [n: n in [1..700] | IsPrime(Seqint(Intseq(n) cat Intseq(n+1) cat Intseq(n)))]; // Vincenzo Librandi, Nov 30 2015
    
  • Mathematica
    Select[Range[800], PrimeQ[FromDigits[Join[IntegerDigits[#], IntegerDigits[# + 1], IntegerDigits[#]]]] &] (* Alonso del Arte, Nov 25 2015 *)
  • PARI
    is(n)=isprime(eval(Str(n,n+1,n)))
    
  • Python
    from sympy import isprime
    def aupto(N):
      return [k for k in range(1, N+1, 2) if isprime(int(str(k)+str(k+1)+str(k)))]
    print(aupto(530)) # Michael S. Branicky, Jul 09 2021
Showing 1-2 of 2 results.