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

A228324 Primes arising from A228323 in order of their appearance.

Original entry on oeis.org

13, 23, 29, 59, 521, 421, 47, 67, 613, 1013, 1019, 1619, 1627, 827, 811, 1511, 1523, 1223, 1217, 2017, 2029, 1429, 1433, 2633, 2647, 1847, 1831, 2531, 2539, 2239, 2237, 2437, 2441, 3041, 3049, 3449, 3457, 2857, 2843, 3643, 3659, 3259, 3251, 3851, 3853, 4253
Offset: 1

Views

Author

N. J. A. Sloane, Aug 20 2013

Keywords

References

  • Eric Angelini, Posting to the Sequence Fans Mailing List, Aug 14 2013.

Crossrefs

Cf. A228323.

Programs

  • Python
    from sympy import isprime
    from itertools import islice
    def c(s, t):
        u, v = int(s+t), int(t+s)
        if isprime(u): return u
        if isprime(v): return v
        return False
    def agen():
        aset, k, mink = set(), 1, 2
        while True:
            an = k; aset.add(an); s, k = str(an), mink
            while k in aset or not c(s, str(k)): k += 1
            while mink in aset: mink += 1
            yield c(s, str(k))
    print(list(islice(agen(), 46))) # Michael S. Branicky, Oct 17 2022

Extensions

More terms from Alois P. Heinz, Aug 20 2013

A228325 a(n) is the smallest number m>n such that the concatenation nm is prime.

Original entry on oeis.org

3, 3, 7, 7, 9, 7, 9, 9, 11, 13, 17, 13, 19, 23, 23, 19, 21, 23, 31, 27, 29, 37, 33, 37, 31, 33, 29, 33, 39, 37, 37, 51, 43, 49, 39, 37, 39, 47, 43, 49, 53, 43, 49, 47, 47, 49, 51, 61, 51, 51, 53, 61, 81, 71, 57, 57, 79, 61, 81, 67, 63, 63, 67, 69, 69, 73, 79
Offset: 1

Views

Author

N. J. A. Sloane, Aug 20 2013

Keywords

Comments

Max Alekseyev (see link in A068695) shows that a(n) always exists. - N. J. A. Sloane, Nov 13 2020
Suggested by the existence question in A228323.

Examples

			12 is not prime but 13 is, so a(1)=3.
23 is prime so a(2)=3.
34, 35, 36 are not prime but 37 is, so a(3)=7.
		

Crossrefs

Programs

  • Mathematica
    smc[n_]:=Module[{m=n+1},If[OddQ[n],m++];While[!PrimeQ[n*10^IntegerLength[ m]+ m],m=m+2];m]; Array[smc,70] (* Harvey P. Dale, Apr 30 2016 *)
  • Python
    from sympy import isprime
    from itertools import count
    def a(n): return next(k for k in count(n+1) if isprime(int(str(n)+str(k))))
    print([a(n) for n in range(1, 68)]) # Michael S. Branicky, Oct 18 2022

A338366 a(n) = smallest positive number k with all digits equal such that the concatenation k||n||k is prime, or -1 if no such k exists.

Original entry on oeis.org

1, 3, 7, 1, 11, 1, 7777, 3, 1, 1, 9, -1, 7, 33, 99, 1, 3, 1, 1, 9, 1, 11, -1, 1, 7, 3, 7777777777, 1111, 111, 1, 1, 3, 1, -1, 3, 33, 1, 3, 1, 77777777777777, 111, 3, 1111111111111111111111111111111111111111, 3, -1, 1, 3, 1, 1, 999, 7, 1, 11, 1, 7, -1, 33, 1, 3, 3, 1, 3, 1
Offset: 0

Views

Author

N. J. A. Sloane, Nov 08 2020

Keywords

Comments

See A090287 for more information.
From Robert Price, Sep 20 2023: (Start)
For a(366), k is a string of 8441 1's.
The sequence then continues: 77, 1, 1, 3, 1, 1, 9, 7777777, 1, 11, 3, 1, 11, 9, 77, 11111, 1, 1, 33333, 3, 7, 9, 3, 1, 77, 1, 1, 9, 7777777777 until a(396) where k is a sequence of 269 1's.
The sequence then continues: 9, 777, 11, 9, 1, 7, 3, 7, 1, 11, 1, 1, 9, 9, 1111, 3, 999, 77777, 99, 7, 7, 3, 7, -1, 3, 1, 11, 77, 1, 77, 3, 1, 7, 3, 3, 1, 111111, 1, 7, 99, 7, 1111, 9, 1, 1, 11, 1, 7777777, 11, 1, 1111, 3, 1111, 7, 3, 7, 11, 3, 1, 1, 111, 3, 1, 3, 3, 1, 33, 9, 11, 33, 3, 7, 3, 3, 7, 99, 1, 1, 11, 3, 1, 9, 7, 77, 9, 1, 1, 3, 1, 7777, 33, 3, 1, 33, 3, 77, 77, 9, 1, 3, 33, 11111, 9, 9. (End)

Examples

			a(3) = 1 because 131 is prime.
a(4) = 11 because 11411 is prime, and all of 141, 242, 343, ..., 949 are composite.
		

Crossrefs

Cf. A090287.
Related sequences: A010785, A068695, A091088, A228323, A228325, A336893, A338712 (see also the Index link above).

Extensions

More terms from Alois P. Heinz, Nov 08 2020

A246805 Lexicographically earliest sequence of distinct terms such that, when i

Original entry on oeis.org

1, 3, 4, 7, 19, 31, 67, 391, 583, 4549, 917467, 6777061, 86794921, 1421517037, 171234891469
Offset: 1

Views

Author

Paul Tek, Nov 16 2014

Keywords

Comments

Two distinct terms can always be concatenated in some way to form a prime number.
Is this sequence infinite?

Examples

			The following concatenations are prime:
- j=2: a(1) U a(2)=13, a(2) U a(1)=31
- j=3: a(3) U a(1)=41, a(3) U a(2)=43
- j=4: a(1) U a(4)=17, a(4) U a(1)=71, a(2) U a(4)=37, a(4) U a(2)=73, a(3) U a(4)=47
- j=5: a(5) U a(1)=191, a(5) U a(2)=193, a(3) U a(5)=419, a(4) U a(5)=719, a(5) U a(4)=197
- j=6: a(1) U a(6)=131, a(6) U a(1)=311, a(2) U a(6)=331, a(6) U a(2)=313, a(3) U a(6)=431, a(6) U a(4)=317, a(5) U a(6)=1931, a(6) U a(5)=3119
		

Crossrefs

Programs

  • PARI
    See Link section.
    
  • Python
    from sympy import isprime
    from itertools import islice
    def c(s, slst):
        return all(isprime(int(s+t)) or isprime(int(t+s)) for t in slst)
    def agen():
        slst, an, mink = [], 1, 2
        while True:
            yield an; slst.append(str(an)); an += 1
            while not c(str(an), slst): an += 1
    print(list(islice(agen(), 10))) # Michael S. Branicky, Oct 17 2022

Extensions

a(15) from Michael S. Branicky, Nov 07 2022

A306581 Lexicographically earliest sequence of distinct positive terms such that the binary representations of two consecutive terms can always been concatenated in some order, without leading zero, to produce the binary representation of a prime number.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 11, 8, 7, 9, 13, 10, 17, 12, 25, 18, 23, 15, 14, 19, 20, 21, 26, 27, 31, 29, 16, 37, 34, 45, 22, 39, 28, 55, 46, 57, 35, 24, 43, 36, 47, 33, 32, 41, 38, 67, 30, 53, 42, 61, 40, 49, 48, 73, 50, 51, 59, 56, 69, 44, 63, 52, 77, 60, 79, 54, 65
Offset: 1

Views

Author

Rémy Sigrist, Feb 25 2019

Keywords

Comments

This sequence is the binary variant of A228323.
The sequence is well defined; the argument used to prove that A018800(n) always exists applies here also.

Examples

			The first terms, alongside their binary representations, and the concatenation of consecutive terms, with prime numbers denoted by a star, are:
  n   a(n)  bin(a(n))  bin(a(n)a(n+1))  bin(a(n+1)a(n))
  --  ----  ---------  ---------------  ---------------
   1     1          1              110              101*
   2     2         10             1011*            1110
   3     3         11            11100            10011*
   4     4        100           100101*          101100
   5     5        101           101110           110101*
   6     6        110          1101011*         1011110
   7    11       1011         10111000         10001011*
   8     8       1000          1000111*         1111000
   9     7        111          1111001          1001111*
  10     9       1001         10011101*        11011001
		

Crossrefs

See A228323 for the decimal variant.
Cf. A018800.

Programs

  • Mathematica
    a = {1}; c[x_, y_] := FromDigits[Join @@ IntegerDigits[{x, y}, 2], 2]; While[Length@a < 67, j=1; While[MemberQ[a, j] || ! (PrimeQ@ c[a[[-1]], j] || PrimeQ@ c[j, a[[-1]]]), j++]; AppendTo[a, j]]; a (* Giovanni Resta, Feb 27 2019 *)
  • PARI
    See Links section.
Showing 1-5 of 5 results.