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

A087388 a(1) = 2; a(n+1) is the least prime formed by adding one or more digits to the digit reversal of a(n).

Original entry on oeis.org

2, 23, 3203, 302317, 7132031, 130231711, 1171320317, 71302317113, 31171320317057, 7507130231711321, 123117132031705727, 7275071302317113213, 312311713203170572751, 157275071302317113213041
Offset: 1

Views

Author

Amarnath Murthy, Sep 09 2003

Keywords

Examples

			a(2) = 23, a(3) is the smallest prime beginning with 32 and is 3203.
		

Crossrefs

Extensions

More terms from David Wasserman, May 25 2005

A087390 a(1) = 7; a(n+1) is the least prime formed by adding one or more digits to the digit reversal of a(n).

Original entry on oeis.org

7, 71, 173, 3719, 91733, 3371947, 749173303, 3033719477, 774917330303, 30303371947759, 957749173303031, 13030337194775911, 1195774917330303119, 9113030337194775911093, 390119577491733030311941
Offset: 1

Views

Author

Amarnath Murthy, Sep 09 2003

Keywords

Examples

			a(2) = 71, a(3) is the smallest prime beginning with 17 and is 173.
		

Crossrefs

Extensions

More terms from David Wasserman, May 25 2005

A087391 a(1) = 11; a(n+1) is the least prime formed by adding one or more digits to the digit reversal of a(n).

Original entry on oeis.org

11, 113, 3119, 91139, 931193, 39113903, 3093119321, 12391139039, 9309311932111, 111239113903901, 109309311932111021, 12011123911390390141, 1410930931193211102109, 901201112391139039014103
Offset: 1

Views

Author

Amarnath Murthy, Sep 09 2003

Keywords

Examples

			a(2)= 113, a(3) is the smallest prime beginning with 113 and is 3119.
		

Crossrefs

Extensions

More terms from David Wasserman, May 25 2005

A224953 Number of ways a digit can be appended or prepended to n and form a prime.

Original entry on oeis.org

4, 9, 3, 9, 3, 3, 2, 9, 2, 6, 4, 6, 1, 7, 1, 2, 2, 5, 1, 9, 0, 4, 3, 6, 1, 2, 2, 6, 2, 5, 1, 8, 0, 5, 2, 2, 1, 6, 2, 6, 2, 6, 1, 7, 2, 1, 3, 6, 1, 5, 2, 3, 2, 5, 2, 1, 2, 8, 1, 6, 2, 7, 0, 6, 3, 2, 1, 7, 1, 4, 2, 5, 1, 7, 1, 2, 2, 6, 1, 5, 1, 4, 4, 7, 0, 3, 1
Offset: 0

Views

Author

Keywords

Comments

The prime number may be formed by adding a digit either before or after n, though only odd numbers can become prime by having digits added before n.
Appending a zero before n produces a prime if and only if n is prime. Conversely, for all prime numbers p, a(p) > 0.
In theory, a maximum of 7 digits could be added before any n, and 3 of the odd digits after n in cases where [10*n, 10*n+9] contains a number that is a factor of 3, 5 and 7 (the three single-digit odd primes). In practice, it appears that all 10 possibilities are never realized. There are 9 possibilities for n = {1, 3, 7, 19}.
The only example of a prime being formed two different ways is for n = 1, which can become 11 if a 1 is appended to either the front or the back. These are naively counted as two distinct alternatives. [This would also be true for n = A002275(A004023(k) - 1) for k > 1 as appending a 1 to either the front or the back forms the k-th repunit prime. - Michael S. Branicky, May 22 2024]
The term a(29587) is the first occurrence of 10. The primes are 29587, 129587, 329587, 429587, 729587, 929587, 295871, 295873, 295877, and 295879. This is the only occurrence of 10 for n < 10^8. - T. D. Noe, Apr 21 2013

Examples

			a(0) = 4 because there are 4 ways to concatenate a digit to 0 to produce a prime number: 02, 03, 05, and 07.
a(3) = 9 because a digit can be concatenated to 3 in 9 ways to produce a prime number: 03, 13, 23, 43, 53, 73, 83, 31, and 37.
		

Crossrefs

Cf. A069686.
Cf. A075595.
Index of zeros in this sequence: A124665.

Programs

  • Mathematica
    Table[num = IntegerDigits[n]; cnt = 0; Do[If[PrimeQ[FromDigits[Prepend[num, k]]], cnt++], {k, 0, 9}]; Do[If[PrimeQ[FromDigits[Append[num, k]]], cnt++], {k, 0, 9}]; cnt, {n, 0, 86}] (* T. D. Noe, Apr 20 2013 *)
  • R
    sapply(1:100, function(x) sum(sapply(as.numeric(c(paste0(0:9,x), paste0(x,c(1,3,7,9)))), is_prime  ))) # Christian N. K. Anderson, Apr 30 2024
Showing 1-4 of 4 results.