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

A145985 Primes resulting from subtracting primes from 10^n in order (see Comments for precise definition).

Original entry on oeis.org

7, 5, 3, 89, 83, 71, 59, 53, 47, 41, 29, 17, 11, 3, 887, 863, 827, 821, 809, 773, 761, 743, 719, 683, 653, 647, 641, 617, 599, 569, 557, 521, 509, 491, 479, 443, 431, 401, 383, 359, 353, 347, 317, 281, 257, 239, 227, 191, 179, 173, 137, 113, 89, 71, 59, 53, 47, 29, 23, 17, 3, 8969, 8951, 8849, 8837, 8819, 8807, 8783
Offset: 1

Views

Author

Enoch Haga, Oct 27 2008

Keywords

Comments

Comments from N. J. A. Sloane, Dec 18 2022 (Start)
A more precise definition is the following.
Start with k=1; let N=10^k, let i run from 10^(k-1)-1 to N-1, let j = N-i, if i and j are both primes, append j to the sequence; increment k.
This is derived from A068811 via a(n) = 10^d - A068811(n) where d is the number of digits in A068811(n). A068811 is more fundamental, for there the primes appear in order and there are no duplicates. (End)
Primes may appear more than once.

Examples

			887 is a term because 1000-887 = 113 and both 887 and 113 are prime.
		

Crossrefs

See A359120 for the length of the n-th block of decreasing terms.

Programs

  • Maple
    a:=[];
    for k from 1 to 6 do
    N := 10^k;
       for i from 10^(k-1)+1 to N-1 do
          j:=N-i;
          if isprime(i) and isprime(j) then a:=[op(a),j]; fi;
       od:
    od;
    a; # N. J. A. Sloane, Dec 16 2022
  • Mathematica
    Select[Table[10^IntegerLength[p]-p,{p,Prime[Range[200]]}],PrimeQ] (* Harvey P. Dale, Dec 16 2022 *)

Extensions

Corrected and edited by Harvey P. Dale and N. J. A. Sloane, Dec 16 2022

A358310 Index in A145985 where n-th odd prime p first appears, or -1 if p never appears.

Original entry on oeis.org

3, 2, 1, 13, -1, 12, -1, 59, 11, -1, -1, 10, -1, 9, 8, 7, -1, -1, 6, -1, -1, 5, 4, -1, 2528242167, -1
Offset: 1

Views

Author

Harvey P. Dale and N. J. A. Sloane, Dec 16 2022

Keywords

Comments

Let p = prime(n+1). Certainly if p == 1 (mod 6) then p cannot appear in A145985 (because 10^k-p will be a multiple of 3), so a(n) = -1. In all other cases it appears that a(n) > 0.
a(27) (corresponding to the prime 107) is presently unknown.

Examples

			The 8th odd prime 23 first occurs in A145985 at index 59, so a(8) = 59.
For n=25, the 25th odd prime is 101. The first time when 10^k - 101 is a prime is when k = 12, where 10^12 - 101 = 999999999899. Furthermore, when we look at the numbers t = 10^12 - q for q an increasing prime, t is a prime for q = 11, 41, 101, ..., that is, 101 is the third success.  It follows that 101 is three steps back from the end of the 12th block of descending terms in A145985. The lengths of the blocks are given by A359120. Therefore a(25) = Sum_{j=1..12} A359120(j) - (3-1) = 2528242169 - 2 = 2528242167. - _N. J. A. Sloane_, Dec 18 2022
		

Crossrefs

Cf. A145985.

Programs

  • Mathematica
    With[{prs=Prime[Range[20000000]]},Table[Position[Select[Table[10^IntegerLength[p]-p,{p,prs}],PrimeQ],n,1,1],{n,Prime[Range[24]]}]]/.({}->-1) (* Harvey P. Dale, Dec 17 2022 *)

Extensions

a(25) from N. J. A. Sloane, Dec 18 2022
Showing 1-2 of 2 results.