login
Primes p such that |100-p|, |1000-p|, |10000-p| and |100000-p| are also primes.
1

%I #19 May 25 2023 13:19:09

%S 71,281,743,827,1151,1163,1193,1571,1877,3221,3671,7703,9719,9929,

%T 10433,10601,10613,10739,11789,11831,13163,15683,16661,19181,19433,

%U 22739,25439,26981,28211,33911,37997,46691,50123,50177,51131,53189,57527

%N Primes p such that |100-p|, |1000-p|, |10000-p| and |100000-p| are also primes.

%H Harvey P. Dale, <a href="/A126021/b126021.txt">Table of n, a(n) for n = 1..2000</a>

%e 71 is included because it is prime and (100-71) and (1000-71) and (10000-71) and (100000-71) are also primes.

%p select(p-> andmap(j-> isprime(abs(10^j-p)), [$2..5]),

%p [seq(ithprime(i), i=1..10000)])[]; # _Alois P. Heinz_, Aug 28 2019

%t Select[Prime[Range[10000]], And @@ PrimeQ /@{100-#,1000-#,10000-#,100000-#}&]

%t Select[Prime[Range[6000]],AllTrue[Abs[10^Range[2,5]-#],PrimeQ]&] (* _Harvey P. Dale_, May 25 2023 *)

%o (Magma) [p: p in PrimesUpTo(70000)| IsPrime(100-p)and IsPrime(1000-p) and IsPrime(10000-p) and IsPrime(100000-p)] // _Vincenzo Librandi_, Jan 29 2011

%Y Cf. A000040, A101408.

%K easy,less,nonn

%O 1,1

%A _Harvey P. Dale_, Feb 27 2007

%E Name clarified by _Peter Munn_, Aug 23 2019