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.

Previous Showing 21-30 of 34 results. Next

A239992 Primes formed by concatenating a square number S with S+1, where S+1 is a prime number.

Original entry on oeis.org

3637, 576577, 2433624337, 3240032401, 4410044101, 6969669697, 352836352837, 404496404497, 746496746497, 16641001664101, 17424001742401, 20050562005057, 20736002073601, 24523562452357, 26049962604997, 28022762802277, 34596003459601, 35494563549457, 42600964260097
Offset: 1

Views

Author

K. D. Bajpai, Mar 30 2014

Keywords

Comments

It is observed that each term in the sequence ends either with digit 1 or 7.

Examples

			3637 is a prime formed by concatenaing 36 with 37 where 36= 6^2 and (36+1)= 37 is a prime.
576577 is a prime formed by concatenaing 576 with 577 where 576= 24^2 and (576+1)= 577 is a prime.
		

Crossrefs

Programs

  • Maple
    with(StringTools):KD := proc() local a,b,s;s:=n*n;b:=s+1; if isprime(b) then a:= parse(cat(s,b )); if isprime(a) then RETURN (a); fi; fi;end: seq(KD(), n=1..5000);

A256176 Primes formed by concatenating n with n+1 and by concatenating n+2 with n+3.

Original entry on oeis.org

67, 89, 7879, 8081, 9091, 9293, 186187, 188189, 276277, 278279, 426427, 428429, 438439, 440441, 450451, 452453, 600601, 602603, 606607, 608609, 798799, 800801, 816817, 818819, 858859, 860861, 936937, 938939, 960961, 962963, 11401141, 11421143
Offset: 1

Views

Author

Bui Quang Tuan, Mar 18 2015

Keywords

Comments

Subsequence of A030458.
First bisection: A156121.

Examples

			67, 89 are in the sequence because they are primes and 6, 7, 8, 9 are four consecutive integers.
7879, 8081 are in the sequence because they are primes and 78, 79, 80, 81 are four consecutive integers.
186187, 188189 are in the sequence because they are primes and 186, 187, 188, 189 are four consecutive integers.
		

Programs

  • Mathematica
    f[n_] := FromDigits@ Flatten[IntegerDigits /@ Range[n, n + 1]]; {f@ #, f[# + 2]} & /@ Select[Range@ 1200, AllTrue[{f@ #, f[# + 2]}, PrimeQ] &] // Flatten (* Michael De Vlieger, Mar 18 2015 *)
    fd[{a_,b_}]:=FromDigits[Join[IntegerDigits[a],IntegerDigits[b]]]; Select[ {fd[ Take[#,2]],fd[Take[#,-2]]}&/@Partition[Range[1500],4,1],AllTrue[ #,PrimeQ]&]//Flatten (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Nov 17 2018 *)
  • PARI
    lista(nn) = {for (n=1, nn, if (isprime(p=eval(concat(Str(n), Str(n+1)))) && isprime(q=eval(concat(Str(n+2), Str(n+3)))), print1(p, ", ", q, ", ")););} \\ Michel Marcus, Mar 18 2015

A287018 Primes that can be generated by the concatenation in base 2, in ascending order, of two consecutive integers read in base 10.

Original entry on oeis.org

11, 37, 137, 239, 661, 727, 859, 991, 2081, 2341, 2731, 2861, 3121, 3251, 3511, 9547, 10321, 10837, 11353, 13159, 13417, 13933, 14449, 15739, 34439, 40093, 43177, 43691, 45233, 46261, 60139, 61681, 63737, 135433, 138511, 139537, 144667, 146719, 151849, 154927
Offset: 1

Views

Author

Paolo P. Lava, May 18 2017

Keywords

Examples

			2 and 3 in base 2 are 10 and 11 and concat(10,11) = 1011 is 11 in base 10.
4 and 5 in base 2 are 100 and 101 and concat(100,101) = 100101 is 37 in base 10.
		

Crossrefs

Subsequence of primes of A087737.

Programs

  • Maple
    with(numtheory): P:= proc(q) local a,b,c,n; a:=convert(q+1,binary,decimal); b:=convert(q,binary,decimal); c:=convert(b*10^(ilog10(a)+1)+a,decimal,binary); if isprime(c) then c; fi; end: seq(P(i),i=1..1000);
  • Mathematica
    Select[Map[FromDigits[Apply[Join, IntegerDigits[#, 2]], 2] &, Partition[Range@ 320, 2, 1]], PrimeQ] (* Michael De Vlieger, May 18 2017 *)
  • PARI
    lista(nn) = {for (n=1, nn, if (isprime(p=fromdigits(Vec(concat(binary(n), binary(n+1))), 2)), print1(p, ", ")));} \\ Michel Marcus, May 20 2017

A287300 Primes that can be generated by the concatenation in base 3, in ascending order, of two consecutive integers read in base 10.

Original entry on oeis.org

5, 31, 41, 61, 71, 281, 337, 421, 449, 617, 673, 701, 2297, 2543, 2707, 2789, 2953, 3527, 3691, 4019, 5003, 5167, 5413, 5659, 5741, 5987, 6151, 6397, 21961, 22937, 23669, 24889, 25621, 26597, 27329, 27817, 28549, 28793, 30013, 31477, 31721, 32941, 34649, 35381
Offset: 1

Views

Author

Paolo P. Lava, May 23 2017

Keywords

Examples

			1 and 2 in base 3 are 1 and 2 and concat(1,2) = 12 in base 10 is 5;
3 and 4 in base 3 are 10 and 11 and concat(10,11) = 1011 in base 10 is 31.
		

Crossrefs

Programs

  • Maple
    with(numtheory): P:= proc(q,h) local a,b,c,d,k,n; a:=convert(q+1,base,h); b:=convert(q,base,h); c:=[op(a),op(b)]; d:=0; for k from nops(c) by -1 to 1 do d:=h*d+c[k]; od; if isprime(d) then d; fi; end: seq(P(i,3),i=1..1000);
  • Mathematica
    With[{b = 3}, Select[Map[FromDigits[Flatten@ IntegerDigits[#, b], b] &, Partition[Range@ 150, 2, 1]], PrimeQ]] (* Michael De Vlieger, May 23 2017 *)

A309851 Primes formed by concatenating n and 2n-1.

Original entry on oeis.org

11, 23, 47, 59, 1019, 1223, 1427, 1733, 2039, 2141, 2243, 2447, 2549, 2753, 2957, 3467, 3671, 4079, 4283, 4691, 4793, 5099, 52103, 55109, 61121, 65129, 70139, 75149, 77153, 82163, 86171, 95189, 102203, 104207, 112223, 119237, 124247, 130259, 132263, 137273, 145289, 146291, 147293, 149297, 150299, 160319
Offset: 1

Views

Author

A.H.M. Smeets, Aug 20 2019

Keywords

Crossrefs

Cf. A000040, A052089 (n and n-1), A030458 (n and n+1), A309808 (n and 2n+1).

Programs

  • Magma
    [a:m in [1..170]|IsPrime(a) where a is 10^(#Intseq(2*m-1))*m+2*m-1]; // Marius A. Burtea, Oct 09 2019
    
  • Mathematica
    f[n_] := FromDigits @ (Join @@ IntegerDigits[{n, 2n-1}]); Select[f /@ Range[160], PrimeQ]  (* Amiram Eldar, Sep 24 2019 *)
  • Python
    from sympy import isprime
    A309851_list = [m for m in (int(str(n)+str(2*n-1)) for n in range(1,10**5)) if isprime(m)] # Chai Wah Wu, Oct 23 2019

A317744 Prime numbers which result as a concatenation of a decimal number and its binary representation.

Original entry on oeis.org

11, 311, 5101, 131101, 2511001, 37100101, 51110011, 59111011, 731001001, 931011101, 971100001, 1191110111, 12910000001, 13110000011, 13710001001, 15310011001, 17310101101, 19311000001, 21311010101, 21511010111, 24711110111, 25511111111, 319100111111
Offset: 1

Views

Author

Philip Mizzi, Aug 05 2018

Keywords

Comments

The decimal number plus its Hamming weight A000120 must not be divisible by 3. - M. F. Hasler, Apr 05 2024

Examples

			11 is in the sequence because the binary representation of 1 is 1 and the concatenation of 1 and 1 gives 11, which is prime.
931011101 is in the sequence because it is the concatenation of 93 and 1011101 (the binary representation of 93) and is prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Table[FromDigits[Join[IntegerDigits[n],IntegerDigits[n,2]]],{n,400}],PrimeQ] (* Harvey P. Dale, Jul 15 2020 *)
  • PARI
    nb(n)=fromdigits(concat(n,binary(n)))
    A317744_upto(N=666)=[p|n<-[1..N], is/*pseudo*/prime(p=nb(n))] \\ M. F. Hasler, Apr 05 2024
  • Python
    from sympy import isprime
    def nbinn(n): return int(str(n)+bin(n)[2:])
    def ok(n): return isprime(nbinn(n))
    def aprefixupto(p): return [nbinn(k) for k in range(1, p+1, 2) if ok(k)]
    print(aprefixupto(319)) # Michael S. Branicky, Dec 27 2020
    

A342049 Primes formed by the concatenation of exactly two consecutive composite numbers.

Original entry on oeis.org

89, 5051, 5657, 6263, 6869, 8081, 9091, 9293, 120121, 186187, 188189, 200201, 216217, 242243, 246247, 252253, 278279, 300301, 308309, 318319, 338339, 342343, 350351, 362363, 368369, 390391, 402403, 410411, 416417, 426427, 428429, 440441, 446447, 450451, 452453, 470471, 476477, 482483
Offset: 1

Views

Author

Bernard Schott, Feb 26 2021

Keywords

Comments

When a prime is obtained by the concatenation of exactly two consecutive composite numbers, the first one always ends with 0, 2, 6, 8 while the second one ends respectively with 1, 3, 7, 9.
a(1) = 89 is also the smallest prime whose digits are composite (A051416).
a(n) has an even number of digits. If it would have an odd number of digits then it is like 99..99100..00 but that is composite. - David A. Corneth, Feb 27 2021

Examples

			If (2,q) is the smallest term formed by the concatenation of 2 consecutive composite numbers with each q digits: (2,1) = a(1) = 89, (2,2) = a(2) = 5051, (2,3) = a(9) = 120121, (2,4) = 10021003, (2,5) = 1001010011, (2,6) = 100010100011.
		

Crossrefs

Subsequence of A030458 and A121608.

Programs

  • PARI
    isc(c) = (c>1) && ! isprime(c);
    isok(p) = {if (isprime(p), my(d=digits(p)); for (i=1, #d-1, my(b = fromdigits(vector(i, k, d[k]))); if (d[i+1], my(c = fromdigits(vector(#d-i, k, d[k+i]))); if (isc(b) && isc(c) && ((primepi(c) - primepi(b)) == c-b-1), return (1)); ); ); ); } \\ Michel Marcus, Feb 27 2021
    
  • PARI
    first(n) = { pc = 4; my(res = vector(n)); t = 0; forcomposite(c = 6, oo, nc = pc * 10^#digits(c) + c; if(isprime(nc), t++; res[t] = nc; if(t >= n, return(res) ) ); pc = c; ) } \\ David A. Corneth, Feb 27 2021
    
  • PARI
    is(n) = { my(d = digits(n)); if(#d % 2 == 1, return(0) ); fc = fromdigits(vector(#d \ 2, i, d[i])); lc = fromdigits(vector(#d \ 2, i, d[i+#d\2])); lc - fc == 1 && !isprime(fc) && !isprime(lc) && nextprime(fc)==nextprime(lc) && isprime(n) } \\ David A. Corneth, Feb 27 2021
    
  • Python
    from sympy import isprime
    def agento(lim):
      digs, pow10 = 1, 10
      while True:
        for c2 in range(max(pow10//10+1, 3), pow10, 2):
          if not isprime(c2) and not isprime(c2-1):
            c1c2 = (c2-1)*pow10+c2
            if c1c2 > lim: return
            if isprime(c1c2): yield c1c2
        digs, pow10 = digs+1, pow10*10
    print([an for an in agento(482483)]) # Michael S. Branicky, Feb 27 2021

A372207 a(n) is the smallest prime number that is obtained by concatenating 2 consecutive n-digit integers.

Original entry on oeis.org

23, 1213, 102101, 10021001, 1000810007, 100010100011, 10000241000023, 1000004210000041, 100000002100000003, 10000000081000000009, 1000000000810000000007, 100000000002100000000001, 10000000000021000000000001, 1000000000001010000000000011, 100000000000002100000000000003
Offset: 1

Views

Author

Gonzalo Martínez, May 19 2024

Keywords

Comments

It is possible to form primes by concatenating an integer with its successor (A030458), as well as by concatenating an integer with its predecessor (A052089).

Examples

			a(3) = 102101, since when concatenating 3-digit numbers, the first three numbers obtained, in increasing order, are 100101, 101100, 101102, which are composite, while the next number in the list is 102101, which is prime.
		

Crossrefs

Programs

  • Python
    from sympy import isprime
    def a(n):
        if n == 1: return 23
        lb, ub = 10**(n-1), 10**n
        for k in range(lb, ub, 2):
            base = k*ub
            for inc in [k-1, k+1]:
                if inc >= lb and isprime(t:=base+inc):
                    return t
    print([a(n) for n in range(1, 16)]) # Michael S. Branicky, May 19 2024

Extensions

a(12) and beyond from Michael S. Branicky, May 19 2024

A275238 a(n) = n*(10^floor(log_10(n)+1) + 1) + (-1)^n.

Original entry on oeis.org

1, 10, 23, 32, 45, 54, 67, 76, 89, 98, 1011, 1110, 1213, 1312, 1415, 1514, 1617, 1716, 1819, 1918, 2021, 2120, 2223, 2322, 2425, 2524, 2627, 2726, 2829, 2928, 3031, 3130, 3233, 3332, 3435, 3534, 3637, 3736, 3839, 3938, 4041, 4140, 4243, 4342, 4445, 4544, 4647, 4746, 4849, 4948, 5051, 5150, 5253, 5352, 5455, 5554
Offset: 0

Views

Author

Ilya Gutkovskiy, Jul 21 2016

Keywords

Comments

Concatenation of n with n+(-1)^n (A004442).
Subsequence of A248378.
Primes in this sequence: 23, 67, 89, 1213, 3637, 4243, 5051, 5657, 6263, 6869, 7879, 8081, 9091, 9293, 9697, 102103, ... (A030458).
Numbers n such that a(n) is prime: 2, 6, 8, 12, 36, 42, 50, 56, 62, 68, 78, 80, 90, 92, 96, 102, 108, 120, 126, 138, ... (A030457).

Examples

			a(0) =  0 + 1 = 1;
a(1) = 11 - 1 = 10;
a(2) = 22 + 1 = 23;
a(3) = 33 - 1 = 32;
a(4) = 44 + 1 = 45;
a(5) = 55 - 1 = 54, etc.
or
a(0) =  1 -> concatenation of 0 with 0 + (-1)^0 = 1;
a(1) = 10 -> concatenation of 1 with 1 + (-1)^1 = 0;
a(2) = 23 -> concatenation of 2 with 2 + (-1)^2 = 3;
a(3) = 32 -> concatenation of 3 with 3 + (-1)^3 = 2;
a(4) = 45 -> concatenation of 4 with 4 + (-1)^4 = 5;
a(5) = 54 -> concatenation of 5 with 5 + (-1)^5 = 4, etc.
........................................................
a(2k) = 1, 23, 45, 67, 89, 1011, 1213, 1415, 1617, 1819, ...
		

Crossrefs

Programs

  • Mathematica
    Table[n (10^Floor[Log[10, n] + 1] + 1) + (-1)^n, {n, 0, 55}]
  • PARI
    a(n) = if(n, n*(10^(logint(n,10)+1) + 1) + (-1)^n, 1) \\ Charles R Greathouse IV, Jul 21 2016

Formula

a(n) = A020338(n) + A033999(n).
a(2k) = A030656(k).
A064834(a(n)) > 0, for n > 0.
a(n) ~ 10*n*10^floor(c*log(n)), where c = 1/log(10) = 0.4342944819... = A002285.

A287302 Primes that can be generated by the concatenation in base 4, in ascending order, of two consecutive integers read in base 10.

Original entry on oeis.org

11, 103, 137, 239, 1171, 1301, 1951, 2081, 2341, 2731, 2861, 3121, 3251, 3511, 16963, 17477, 20047, 21589, 23131, 26729, 30841, 34439, 40093, 43177, 43691, 45233, 46261, 60139, 61681, 63737, 270601, 272651, 278801, 291101, 295201, 297251, 315701, 321851, 325951
Offset: 1

Views

Author

Paolo P. Lava, May 23 2017

Keywords

Examples

			2 and 3 in base 4 are 2 and 3 and concat(2,3) = 23 in base 10 is 11;
6 and 7 in base 4 are 12 and 13 and concat(12,13) = 1213 in base 10 is 103.
		

Crossrefs

Programs

  • Maple
    with(numtheory): P:= proc(q,h) local a,b,c,d,k,n; a:=convert(q+1,base,h); b:=convert(q,base,h); c:=[op(a),op(b)]; d:=0; for k from nops(c) by -1 to 1 do d:=h*d+c[k]; od; if isprime(d) then d; fi; end: seq(P(i,4),i=1..1000);
  • Mathematica
    With[{b = 4}, Select[Map[FromDigits[Flatten@ IntegerDigits[#, b], b] &, Partition[Range@ 320, 2, 1]], PrimeQ]] (* Michael De Vlieger, May 23 2017 *)
Previous Showing 21-30 of 34 results. Next