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

%I #47 Jun 06 2024 14:08:55

%S 7,5,3,89,83,71,59,53,47,41,29,17,11,3,887,863,827,821,809,773,761,

%T 743,719,683,653,647,641,617,599,569,557,521,509,491,479,443,431,401,

%U 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

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

%C Comments from _N. J. A. Sloane_, Dec 18 2022 (Start)

%C A more precise definition is the following.

%C 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.

%C 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)

%C Primes may appear more than once.

%H N. J. A. Sloane, <a href="/A145985/b145985.txt">Table of n, a(n) for n = 1..20000</a> [First 1000 terms from _Harvey P. Dale_]

%H N. J. A. Sloane, <a href="/A145985/a145985.txt">Table of n, a(n) for n = 1..80338</a>

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

%p a:=[];

%p for k from 1 to 6 do

%p N := 10^k;

%p for i from 10^(k-1)+1 to N-1 do

%p j:=N-i;

%p if isprime(i) and isprime(j) then a:=[op(a),j]; fi;

%p od:

%p od;

%p a; # _N. J. A. Sloane_, Dec 16 2022

%t Select[Table[10^IntegerLength[p]-p,{p,Prime[Range[200]]}],PrimeQ] (* _Harvey P. Dale_, Dec 16 2022 *)

%Y Cf. A068811, A358310, A359121, A359122, A359123.

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

%K easy,nonn

%O 1,1

%A _Enoch Haga_, Oct 27 2008

%E Corrected and edited by _Harvey P. Dale_ and _N. J. A. Sloane_, Dec 16 2022