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 11-16 of 16 results.

A288519 a(n) = least k such that A080670(k) begins with n.

Original entry on oeis.org

1, 2, 3, 41, 5, 61, 7, 83, 97, 101, 11, 127, 13, 149, 151, 163, 17, 181, 19, 2003, 22, 4, 6, 16, 10, 64, 14, 166, 29, 307, 31, 9, 27, 81, 15, 183, 21, 249, 291, 401, 41, 421, 43, 443, 457, 461, 47, 487, 491, 503, 55, 25, 53, 205, 265, 305, 35, 415, 59, 601, 61
Offset: 1

Views

Author

Rémy Sigrist, Jun 10 2017

Keywords

Comments

a(p) <= p for any prime p.
a(n) <= A018800(n) for any n > 0.

Examples

			The following table shows the first values from A080670, as well as the terms that can be derived from it:
k       A080670(k)      Derived terms
--      ----------      -------------
1       1               a(1) = 1
2       2               a(2) = 2
3       3               a(3) = 3
4       22              a(22) = 4
5       5               a(5) = 5
6       23              a(23) = 6
7       7               a(7) = 7
8       23              none
9       32              a(32) = 9
10      25              a(25) = 10
11      11              a(11) = 11
12      223             a(223) = 12
13      13              a(13) = 13
14      27              a(27) = 14
15      35              a(35) = 15
16      24              a(24) = 16
17      17              a(17) = 17
18      232             a(232) = 18
19      19              a(19) = 19
20      225             a(225) = 20
21      37              a(37) = 21
22      211             a(211) = 22, a(21) = 22
23      23              none
24      233             a(233) = 24
25      52              a(52) = 25
		

Crossrefs

Programs

  • Mathematica
    s = Array[Flatten@ Map[IntegerDigits, DeleteCases[ Flatten@ FactorInteger@ #, 1] /. {} -> {1}] &, 10^4]; FromDigits /@ Table[ Function[k, SelectFirst[s, If[Length@# > 0, #[[1, 1]] == 1, False] &@ SequencePosition[#, k] &]]@ IntegerDigits[n], {n, 61}] (* Michael De Vlieger, Jun 11 2017 *)

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.

A308438 a(n) is the smallest prime p whose decimal expansion begins with n and is such that the next prime is p+2n, or -1 if no such prime exists.

Original entry on oeis.org

11, 223, 31, 401, 547, 619, 773, 8581, 9109, 10223, 1129, 12073, 130553, 14563, 150011, 161471, 17257, 18803, 191189, 20809, 210557, 225383, 237091, 240209, 2509433, 2613397, 277429, 283211, 2901649, 308153, 313409, 3204139, 3300613, 3419063, 3507739, 360091, 3727313, 3806347, 3930061, 4045421, 41018911
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, May 30 2019

Keywords

Examples

			For n = 5, 547 is a prime starting with 5, and the next prime after 547 is 557 = 547 + 2*5.  Since this is the least number with these properties, a(5) = 547.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local d,p,q;
      for d from 0 do
        p:= nextprime(n*10^d-1);
        do
          q:= nextprime(p);
          if q - p = 2*n then return p fi;
          if q >= (n+1)*10^d then break fi;
          p:= q;
        od;
      od;
    end proc:
    map(f, [$1..50]);
  • Python
    from sympy import nextprime
    def A308438(n):
        l, p = 1, nextprime(n)
        while True:
            q = nextprime(p)
            if q-p == 2*n:
                return p
            p = q
            if p >= (n+1)*l:
                l *= 10
                p = nextprime(n*l) # Chai Wah Wu, May 31 2019

A095208 n if n is composite else 10*n.

Original entry on oeis.org

10, 20, 30, 4, 50, 6, 70, 8, 9, 10, 110, 12, 130, 14, 15, 16, 170, 18, 190, 20, 21, 22, 230, 24, 25, 26, 27, 28, 290, 30, 310, 32, 33, 34, 35, 36, 370, 38, 39, 40, 410, 42, 430, 44, 45, 46, 470, 48, 49, 50, 51, 52, 530, 54, 55, 56, 57
Offset: 1

Views

Author

Amarnath Murthy, Jun 07 2004

Keywords

Comments

In base 10 the smallest composite number starting with the same digits as n.
The average of the first n terms is n/2 + 9n/(2 log n) + O(n log log n/log^2 n). - Charles R Greathouse IV, Jun 08 2015

Examples

			4 is composite, therefore a(4) = 4. 5 is prime, hence a(5) = 50.
		

Crossrefs

Cf. A018800.

Programs

Extensions

Edited and extended by Stefan Steinerberger, Jun 15 2007
Edited by Arkadiusz Wesolowski, Jul 05 2011

A109944 a(1) = 1, a(n) = smallest prime number beginning with n if n is composite or vice versa. If n is prime a(n) = 10n.

Original entry on oeis.org

1, 20, 30, 41, 50, 61, 70, 83, 97, 101, 110, 127, 130, 149, 151, 163, 170, 181, 190, 2003, 211, 223, 230, 241, 251, 263, 271, 281, 290, 307, 310, 3203, 331, 347, 353, 367, 370, 383, 397, 401, 410, 421, 430, 443, 457, 461, 470, 487, 491, 503, 5101, 521, 530, 541
Offset: 1

Views

Author

Amarnath Murthy, Jul 19 2005

Keywords

Comments

If n is composite, a(n) = A018800(n). - David Wasserman, Jul 19 2005

Extensions

More terms from David Wasserman, Jul 19 2005

A110743 Smallest prime beginning with n reversed.

Original entry on oeis.org

11, 2, 3, 41, 5, 61, 7, 83, 97, 11, 11, 211, 31, 41, 5101, 61, 71, 811, 911, 2, 127, 223, 3203, 421, 521, 6203, 727, 821, 929, 3, 13, 23, 331, 43, 53, 631, 73, 83, 937, 41, 149, 241, 347, 443, 541, 641, 743, 8419, 941, 5, 151, 251, 353, 457, 557, 653, 751, 853, 953, 61, 163, 263, 367, 461, 563, 661, 761, 863, 967
Offset: 1

Views

Author

Amarnath Murthy, Aug 10 2005

Keywords

Examples

			a(10) = least prime beginning with 01, i.e. with 1, which is 11.
		

Crossrefs

Programs

  • PARI
    okdigs(np, dfp) = {dnp = digits(np); xdnp = vector(#dfp, id, dnp[id]); return (xdnp == dfp);}
    a(n) = {revn = subst(Polrev(digits(n), x), x, 10); dn = digits(revn); if (revn == 1, p = 2, p = precprime(revn)); while(! okdigs(p, dn), p = nextprime(p+1);); p;} \\ Michel Marcus, Sep 16 2013

Extensions

More terms from Peter Soung (soung3(AT)hotmail.com), Mar 06 2006
Previous Showing 11-16 of 16 results.