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

A030458 Primes formed by concatenating n with n+1.

Original entry on oeis.org

23, 67, 89, 1213, 3637, 4243, 5051, 5657, 6263, 6869, 7879, 8081, 9091, 9293, 9697, 102103, 108109, 120121, 126127, 138139, 150151, 156157, 180181, 186187, 188189, 192193, 200201, 216217, 242243, 246247, 252253, 270271, 276277, 278279, 300301, 308309, 312313, 318319
Offset: 1

Views

Author

Keywords

Comments

Primes in A030656.

Crossrefs

Programs

  • Magma
    [m: n in [2..270 by 2] | IsPrime(m) where m is Seqint(Intseq(n+1) cat Intseq(n))];  // Bruno Berselli, Jun 18 2011
    
  • Mathematica
    Select[Table[FromDigits[Join[Flatten[IntegerDigits[{n,n+1}]]]],{n,270}],PrimeQ] (* Jayanta Basu, May 16 2013 *)
  • PARI
    forstep(n=2,1e3,2,if(isprime(k=eval(Str(n,n+1))),print1(k", "))) \\ Charles R Greathouse IV, Jun 18 2011
    
  • Python
    from sympy import isprime
    from itertools import count, islice
    def agen(): yield from filter(isprime, (int(str(k)+str(k+1)) for k in count(2, 2)))
    print(list(islice(agen(), 38))) # Michael S. Branicky, Aug 05 2022

A052089 Primes formed by concatenating k with k-1.

Original entry on oeis.org

43, 109, 2221, 2423, 3433, 4241, 5857, 7069, 7877, 8887, 10099, 102101, 108107, 112111, 114113, 124123, 148147, 154153, 160159, 172171, 180179, 192191, 198197, 202201, 208207, 210209, 214213, 238237, 244243, 262261, 264263, 268267, 270269, 282281, 294293, 300299
Offset: 1

Views

Author

Patrick De Geest, Jan 15 2000

Keywords

Examples

			2423 is a prime and a concatenation of 24 and 23.
		

Crossrefs

Programs

  • Magma
    [Seqint(Intseq(n-1) cat Intseq(n)): n in [2..300 by 2] | IsPrime(Seqint(Intseq(n-1) cat Intseq(n)))]; // Marius A. Burtea, Mar 21 2019
    
  • Mathematica
    Sort[Select[FromDigits[Flatten[IntegerDigits/@#]]&/@Partition[ Range[ 300,1,-1],2,1],PrimeQ]] (* Harvey P. Dale, May 09 2012 *)
    Select[Table[n 10^IntegerLength[n-1]+n-1,{n,2,300}],PrimeQ] (* Harvey P. Dale, Aug 20 2025 *)
  • PARI
    for(n=4,1e4,if(isprime(t=eval(Str(n,n-1))),print1(t", "))) \\ Charles R Greathouse IV, May 07 2013
    
  • Python
    from sympy import isprime
    from itertools import count, islice
    def agen(): yield from filter(isprime, (int(str(k)+str(k-1)) for k in count(2, 2)))
    print(list(islice(agen(), 36))) # Michael S. Branicky, Aug 05 2022

A052087 Primes whose decimal expansion is a concatenation of two or more consecutive increasing numbers (no leading zeros allowed).

Original entry on oeis.org

23, 67, 89, 1213, 3637, 4243, 4567, 5051, 5657, 6263, 6869, 7879, 8081, 9091, 9293, 9697, 102103, 108109, 120121, 126127, 138139, 150151, 156157, 180181, 186187, 188189, 192193, 200201, 216217, 242243, 246247, 252253, 270271
Offset: 1

Views

Author

Patrick De Geest, Jan 15 2000

Keywords

Crossrefs

Primes in A035333.

Programs

  • Mathematica
    With[{e = 6}, TakeWhile[Select[Function[s, Union@ Flatten@ Map[Function[k, Map[FromDigits@ Flatten@ IntegerDigits@ # &, Partition[Take[s, 10^(e - k)], k, 1]]], Range[2, e]]]@ Range[10^e], PrimeQ], IntegerLength@ # <= e &]] (* Michael De Vlieger, Apr 23 2017 *)

Extensions

Initial data corrected by Paul Tek, May 07 2013

A030457 Numbers k such that k concatenated with k+1 is prime.

Original entry on oeis.org

2, 6, 8, 12, 36, 42, 50, 56, 62, 68, 78, 80, 90, 92, 96, 102, 108, 120, 126, 138, 150, 156, 180, 186, 188, 192, 200, 216, 242, 246, 252, 270, 276, 278, 300, 308, 312, 318, 330, 338, 342, 350, 362, 368, 378, 390, 402, 410, 416, 420, 426, 428, 432
Offset: 1

Views

Author

Keywords

Comments

k is not congruent to 1 (mod 2), 1 (mod 3), or 4 (mod 5). - Charles R Greathouse IV, Apr 16 2012

Examples

			1213 is prime, therefore 12 is a term.
		

Crossrefs

Cf. A010051, A001704, A068700 (subsequence).
Numbers k such that k concatenated with k+m is prime: this sequence (m=1), A032617 (m=2), A032618 (m=3), A032619 (m=4), A032620 (m=5), A032621 (m=6), A032622 (m=7), A032623 (m=8), A032624 (m=9).

Programs

  • Haskell
    a030457 n = a030457_list !! (n-1)
    a030457_list = filter ((== 1) . a010051' . a001704) [1..]
    -- Reinhard Zumkeller, Jun 27 2015, Apr 26 2011
    
  • Magma
    [n: n in [1..500] | IsPrime(Seqint(Intseq(n+1) cat Intseq(n)))]; // Vincenzo Librandi, Jul 23 2016
    
  • Maple
    concat:=proc(a,b) local bb: bb:=nops(convert(b,base,10)): 10^bb*a+b end proc: a:=proc(n) if isprime(concat(n,n+1))=true then n else end if end proc: seq(a(n),n=0..500); # Emeric Deutsch, Nov 23 2007
  • Mathematica
    Select[ Range[500], PrimeQ[ ToExpression[ StringJoin[ ToString[#], ToString[#+1]]]]&] (* Jean-François Alcover, Nov 18 2011 *)
    Select[Range[500],PrimeQ[FromDigits[Join[IntegerDigits[#], IntegerDigits[ #+1]]]]&] (* Harvey P. Dale, Dec 23 2015 *)
    Position[#[[1]]*10^IntegerLength[#[[2]]]+#[[2]]&/@Partition[Range[ 500], 2,1],?PrimeQ]//Flatten (* _Harvey P. Dale, Jul 14 2019 *)
  • PARI
    for(n=1,10^5,if(isprime(eval(concat(Str(n),n+1))),print1(n,", "))); /* Joerg Arndt, Apr 27 2011 */
    
  • Python
    from sympy import isprime
    def ok(n): return isprime(int(str(n)+str(n+1)))
    print([k for k in range(500) if ok(k)]) # Michael S. Branicky, Apr 19 2023

A054211 Numbers k such that k concatenated with k-1 is prime.

Original entry on oeis.org

4, 10, 22, 24, 34, 42, 58, 70, 78, 88, 100, 102, 108, 112, 114, 124, 148, 154, 160, 172, 180, 192, 198, 202, 208, 210, 214, 238, 244, 262, 264, 268, 270, 282, 294, 300, 304, 312, 328, 330, 334, 340, 342, 354, 372, 384, 390, 394, 412, 414, 420, 424, 444, 454
Offset: 1

Views

Author

Patrick De Geest, Feb 15 2000

Keywords

Comments

A010051(A127423(a(n))) = 1. - Reinhard Zumkeller, Jun 27 2015
All terms are even. - Michel Marcus, Oct 14 2016

Crossrefs

Programs

  • Haskell
    a054211 n = a054211_list !! (n-1)
    a054211_list = filter ((== 1) . a010051' . a127423) [1..]
    -- Reinhard Zumkeller, Jun 27 2015 Jul 15 2012
    
  • Mathematica
    ncpQ[{a_,b_}]:=PrimeQ[FromDigits[Flatten[IntegerDigits[{b,a}]]]]; Transpose[ Select[Partition[Range[500],2,1],ncpQ]][[2]] (* Harvey P. Dale, Nov 25 2012 *)
    Select[Range[500],PrimeQ[#*10^IntegerLength[#-1]+#-1]&] (* Harvey P. Dale, Mar 16 2019 *)
  • PARI
    isok(n) = isprime(eval(Str(n, n-1))); \\ Michel Marcus, Oct 14 2016

A084559 Smallest a(n) > n such that concatenation of numbers from n to a(n) is a prime or 0 if no such number exists.

Original entry on oeis.org

3, 19, 7, 17, 7, 13, 9, 187
Offset: 2

Views

Author

Zak Seidov, Jun 27 2003

Keywords

Comments

Terms a(1) and a(10) (and many other terms) are currently unknown.
a(11) = 309, a(12) = 13.
a(1) > 344869 (see A007908). - Sean A. Irvine, Jun 17 2019
More terms: a(14..17) = (17, 19, 43, 39), a(20) = 23, a(23) = 41, a(25) = 49, a(26) = 147, a(28) = 73, a(33..39) = (103, 37, 603, 37, 43, 57, 43), a(42) = 43, a(44) = 51, a(49) = 241, a(50) = 51, a(n) > 1000 for 12 < n < 50 not mentioned here. - M. F. Hasler, Feb 22 2021
a(10) > 10010, a(18) = 3607, a(66) = 1003, a(275) = 1089. If n == 2 (mod 3), then a(n) == 3 or 5 (mod 6). If n == 0 or 1 (mod 3), then a(n) == 1 (mod 6) (see A341716). - Chai Wah Wu, Feb 22 2021
a(10) > 50000. - Michael S. Branicky, Feb 25 2025

Examples

			a(4) = 7 because 4567 is a prime.
		

Crossrefs

Cf. also A341715, A341716, A341717 (similar but a(n) = n when n is prime).

Programs

  • PARI
    A084559(n,N=n,T=10^logint(n,10))=while(T*=10,for(m=n+1,n=T-1,ispseudoprime(N=N*T+m)&&return(m))) \\ M. F. Hasler, Feb 22 2021

Extensions

Edited by Max Alekseyev, Jan 28 2012
a(4) corrected by Daniel Suteu, Jun 16 2019
Escape clause added to definition by Chai Wah Wu, Feb 22 2021

A341701 a(n) = largest m > 0 such that the decimal concatenation n||n-1||n-2||...||m is prime, or -1 if no such prime exists.

Original entry on oeis.org

-1, -1, 2, 3, 3, 5, -1, 7, -1, -1, 9, 11, -1, 13, -1, -1, -1, 17, -1, 19, -1, -1, 21, 23, 23, 13, -1, 23, -1, 29, -1, 31, -1, -1, 33, -1, -1, 37, -1, -1, -1, 41, 41, 43, -1, -1, 39, 47, 41, -1, -1, 47, 37, 53, -1, 43, 47, -1, 57, 59, 47, 61, -1, -1, -1, -1, -1
Offset: 0

Views

Author

Chai Wah Wu, Feb 23 2021

Keywords

Comments

A variant of A341717. a(82) = 1. Are there other n such that a(n) = 1?
Similar argument as in A341716 shows that if n > 3 and a(n) >= 0, then a(n) is odd, n-a(n) !== 2 (mod 3) and n+a(n) !== 0 (mod 3).

Examples

			a(4) = 3 since 43 is prime, a(25) = 13 since 25242322212019181716151413 is prime.
		

Crossrefs

Programs

  • Python
    from sympy import isprime
    def A341701(n):
        k, m = n, n-1
        while not isprime(k) and m > 0:
            k = int(str(k)+str(m))
            m -= 1
        return m+1 if isprime(k) else -1

Formula

a(p) = p if and only if p is prime.

A341702 a(n) is the smallest k < n such that the decimal concatenation n||n-1||n-2||...||n-k is prime, or -1 if no such prime exists.

Original entry on oeis.org

-1, -1, 0, 0, 1, 0, -1, 0, -1, -1, 1, 0, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, 1, 0, 1, 12, -1, 4, -1, 0, -1, 0, -1, -1, 1, -1, -1, 0, -1, -1, -1, 0, 1, 0, -1, -1, 7, 0, 7, -1, -1, 4, 15, 0, -1, 12, 9, -1, 1, 0, 13, 0, -1, -1, -1, -1, -1, 0, 57, -1, 1, 0, -1, 0
Offset: 0

Views

Author

Chai Wah Wu, Feb 23 2021

Keywords

Comments

A variation of A341716. a(n) = n-1 for n = 82. Are there other n such that a(n) = n-1?
Similar argument as in A341716 shows that if n > 3 and a(n) >= 0, then n-a(n) is odd, a(n) !== 2 (mod 3) and 2n-a(n) !== 0 (mod 3).

Examples

			a(10) = 1 since 109 is prime. a(22) = 1 since 2221 is prime.
		

Crossrefs

Programs

  • Maple
    tcat:= proc(x,y) x*10^(1+ilog10(y))+y end proc:
    f:= proc(n) local x,k;
      x:= n;
      for k from 0 to n-1 do
        if isprime(x) then return k fi;
        x:= tcat(x,n-k-1)
      od;
      -1
    end proc:
    map(f, [$0..100]); # Robert Israel, Mar 02 2022
  • PARI
    a(n) = my(k=0, s=Str(n)); while (!isprime(eval(s)), k++; n--; if (k>=n, return(-1)); s = concat(s, Str(n-k))); return(k); \\ Michel Marcus, Mar 02 2022
  • Python
    from sympy import isprime
    def A341702(n):
        k, m = n, n-1
        while not isprime(k) and m > 0:
            k = int(str(k)+str(m))
            m -= 1
        return n-m-1 if isprime(k) else -1
    

Formula

a(n) = n-A341701(n).
a(p) = 0 if and only if p is prime.

A084551 Primes which are a concatenation of five consecutive numbers.

Original entry on oeis.org

1516171819, 3940414243, 5758596061, 6566676869, 7778798081, 8384858687, 8990919293, 129130131132133, 153154155156157, 197198199200201, 213214215216217, 239240241242243, 269270271272273, 387388389390391, 399400401402403, 443444445446447, 459460461462463
Offset: 1

Views

Author

Zak Seidov, Jun 27 2003

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Table[FromDigits[Flatten[IntegerDigits[n+Range[-2,2]]]],{n,2,500}],PrimeQ] (* Jayanta Basu, May 24 2013 *)
    Select[FromDigits[Flatten[IntegerDigits[#]]]&/@Partition[Range[600],5,1], PrimeQ] (* Harvey P. Dale, Nov 11 2014 *)

A341931 a(n) = smallest m > 0 such that the decimal concatenation n||n-1||n-2||...||m is prime, or -1 if no such prime exists.

Original entry on oeis.org

-1, -1, 2, 3, 3, 5, -1, 3, -1, -1, 7, 11, -1, 13, -1, -1, -1, 17, -1, 19, -1, -1, 19, 23, 23, 13, -1, 23, -1, 29, -1, 31, -1, -1, 33, -1, -1, 37, -1, -1, -1, 41, 41, 43, -1, -1, 3, 47, 17, -1, -1, 47, 37, 41, -1, 27, 47, -1, 57, 59, 47, 61, -1, -1, -1, -1, -1
Offset: 0

Views

Author

Chai Wah Wu, Feb 23 2021

Keywords

Comments

a(n) <= A341701(n). a(82) = 1, are there any other n such that a(n) = 1?
Primes p such that a(p) < p: 7, 53, 73, 79, 89, 103, ...
n such that a(n) < A341701(n): 7, 10, 22, 46, 48, 53, 55, 73, ...
Similar argument as in A341716 shows that if n > 3 and a(n) >= 0, then a(n) is odd, n-a(n) !== 2 (mod 3) and n+a(n) !== 0 (mod 3).

Examples

			a(7) = 3 since 76543 is prime and 765432, 7654321 are not. a(10) = 7 since 10987 is prime.
		

Crossrefs

Programs

  • Python
    from sympy import isprime
    def A341931(n):
        k, m, r = n, n-1, n if isprime(n) else -1
        while m > 0:
            k = int(str(k)+str(m))
            if isprime(k):
                r = m
            m -= 1
        return r
Showing 1-10 of 13 results. Next