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.

A261618 Concatenation of n, n+1 and n.

Original entry on oeis.org

121, 232, 343, 454, 565, 676, 787, 898, 9109, 101110, 111211, 121312, 131413, 141514, 151615, 161716, 171817, 181918, 192019, 202120, 212221, 222322, 232423, 242524, 252625, 262726, 272827, 282928, 293029, 303130, 313231, 323332, 333433, 343534, 353635, 363736
Offset: 1

Views

Author

Keywords

Comments

787, 9109, 111211, 131413, ... are primes. - N. J. A. Sloane, Sep 21 2015

Examples

			a(1) = concatenation(1, 2, 1) = 121.
a(10) = concatenation(10, 11, 10) = 101110.
		

Crossrefs

Programs

  • Magma
    [Seqint(Intseq(n) cat Intseq(n+1) cat Intseq(n)):n in [1..36]]; // Marius A. Burtea, Dec 29 2019
  • Maple
    f:= n -> n + 10^(1+ilog10(n))*(n+1)+10^(2+ilog10(n)+ilog10(n+1))*n:
    map(f, [$1..100]); # Robert Israel, Dec 29 2019
  • Mathematica
    Map[FromDigits@ Join[#1, #2, #1] & @@ IntegerDigits[#] &, Partition[Range@ 37, 2, 1]] (* Michael De Vlieger, Dec 29 2019 *)
  • PARI
    a(n) = eval(concat(Str(n), concat(Str(n+1), Str(n)))); \\ Michel Marcus, Sep 10 2015
    

Extensions

More terms from Michel Marcus, Sep 10 2015

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.