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.

A068811 Numbers k such that k and its 10's complement (10^d-k, where d is the number of digits in k) are both primes.

This page as a plain text file.
%I A068811 #51 Jul 22 2025 05:53:26
%S A068811 3,5,7,11,17,29,41,47,53,59,71,83,89,97,113,137,173,179,191,227,239,
%T A068811 257,281,317,347,353,359,383,401,431,443,479,491,509,521,557,569,599,
%U A068811 617,641,647,653,683,719,743,761,773,809,821,827,863,887,911,929,941
%N A068811 Numbers k such that k and its 10's complement (10^d-k, where d is the number of digits in k) are both primes.
%C A068811 In other words, primes p such that the difference between the smallest power of 10 exceeding p and p is prime. - _Zak Seidov_, Feb 27 2004
%C A068811 a(n) = 10^d - A145985(n), where d is the number of digits in A145985(n). - _N. J. A. Sloane_, Dec 18 2022
%C A068811 The only twin prime pairs in the sequence are (3,5) and (5,7). This is easily seen by mod 6 congruences using 10^k = 4 (mod 6). - _Giuseppe Coppoletta_, Jul 24 2016
%H A068811 N. J. A. Sloane, <a href="/A068811/b068811.txt">Table of n, a(n) for n = 1..20000</a> [First 1000 terms from Vincenzo Librandi]
%e A068811 47 is a prime; the smallest power of 10 exceeding 47 is 100 and 100 - 47 = 53 is prime. Therefore 47 is in the sequence.
%e A068811 641 is a term as 641 and 1000-641 = 359 are primes.
%p A068811 a:=[];
%p A068811 for i from 1 to 1000 do
%p A068811 p:=ithprime(i); d:=length(p); q:=10^d-p;
%p A068811 if isprime(q) then a:=[op(a),p]; fi; od:
%p A068811 a; # _N. J. A. Sloane_, Dec 18 2022
%t A068811 Select[Prime[Range[160]], PrimeQ[10^(Floor[Log[10, # ]] + 1) - # ] &] (* _Stefan Steinerberger_, Jun 15 2007 *)
%o A068811 (PARI) is_A068811(p)= isprime(10^#Str(p)-p) & isprime(p) \\ _M. F. Hasler_, May 01 2012
%o A068811 (PARI) for(d=1, 4, forprime(p=10^(d-1), 10^d, if(isprime(10^d-p), print1(p", ")))) \\ _Charles R Greathouse IV_, May 01 2012
%o A068811 (Sage) [p for p in prime_range(100) if is_prime(10^p.ndigits()-p)] # _Giuseppe Coppoletta_, Jul 24 2016
%Y A068811 Cf. A145985.
%K A068811 easy,nonn,base
%O A068811 1,1
%A A068811 _Amarnath Murthy_, Mar 07 2002
%E A068811 Corrected by _Jason Earls_, May 25 2002
%E A068811 Edited by _N. J. A. Sloane_, Sep 18 2008 at the suggestion of _R. J. Mathar_