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.

A069687 Primes that yield another prime on placing a 1 on both sides (as leading and trailing digits).

This page as a plain text file.
%I A069687 #25 Aug 22 2015 19:43:37
%S A069687 3,5,17,23,29,47,53,83,107,113,131,149,173,197,239,251,317,359,383,
%T A069687 401,443,503,509,599,641,683,701,719,743,797,821,947,953,1031,1049,
%U A069687 1103,1109,1187,1229,1277,1283,1301,1373,1583,1613,1619,1637,1733,1847,1889
%N A069687 Primes that yield another prime on placing a 1 on both sides (as leading and trailing digits).
%H A069687 Harvey P. Dale, <a href="/A069687/b069687.txt">Table of n, a(n) for n = 1..1000</a>
%e A069687 239 belongs to this sequence as 12391 is also a prime.
%e A069687 947 and 19471 are both primes ==> 947 is in the sequence. [From _José María Grau Ribas_, Jan 22 2012]
%p A069687 a:= proc(n) option remember; local p;
%p A069687       p:= `if`(n=1, 1, a(n-1));
%p A069687       do p:= nextprime(p);
%p A069687          if isprime(parse(cat(1, p, 1))) then break fi
%p A069687       od; p
%p A069687     end:
%p A069687 seq(a(n), n=1..100);  # _Alois P. Heinz_, May 18 2012
%t A069687 Select[ Range[2000], PrimeQ[ # ] && PrimeQ[ FromDigits[ Insert[ IntegerDigits[ # ], 1, {{1}, {-1}}]]] &]
%t A069687 san[i_]:=1+Prime[i]*10+10^(Floor@Log[10,Prime[i]]+2); Prime@Select[Range[1000],PrimeQ@san[#]&]  (* From _José María Grau Ribas_, Jan 22 2012 *)
%t A069687 Select[Prime[Range[300]],PrimeQ[FromDigits[Join[{1},IntegerDigits[#],{1}]]]&]  (* _Harvey P. Dale_, May 18 2012 *)
%o A069687 (PARI) forprime( p=1,9999, isprime(10^#Str(p*10)+p*10+1) & print1(p",")) \\ _M. F. Hasler_, May 18 2012
%o A069687 (PARI) A069687_vec(Nmax=10^4)=my(p,d=1);vector(Nmax,i,until(isprime((d+p)*10+1), d<(p=nextprime(p+1))&d*=10);p)  \\ _M. F. Hasler_, May 19 2012
%Y A069687 Cf. A069688, A069689 & A069690.
%K A069687 nonn,base
%O A069687 1,1
%A A069687 _Amarnath Murthy_, Apr 06 2002
%E A069687 Edited and extended by _Robert G. Wilson v_, May 03 2002
%E A069687 Corrected and edited following suggestions by H. P. Dale and others by _M. F. Hasler_, May 18 2012