login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A089778 a(n) is the n-th prime that ends with prime(n), or 0 if there do not exist n primes ending with prime(n). 2

%I #14 Dec 10 2017 19:10:52

%S 2,13,0,47,911,1213,2417,1619,1723,2729,2131,3137,4241,4643,3947,4153,

%T 4759,5861,4967,6271,6173,6379,6883,7589,7297,98101,97103,104107,

%U 108109,129113,130127,122131,174137,136139,131149,150151,172157,147163

%N a(n) is the n-th prime that ends with prime(n), or 0 if there do not exist n primes ending with prime(n).

%H Robert Israel, <a href="/A089778/b089778.txt">Table of n, a(n) for n = 1..10000</a>

%e a(5) = 911 because prime(5) = 11 and the first 5 primes ending with 11 are 11, 211, 311, 811 and 911.

%e a(3) = 0 because prime(3) = 5 and only 1 prime ends with 5.

%p f:= proc(n) local p,d,k,count;

%p p:= ithprime(n);

%p d:= 10^(ilog10(p)+1);

%p count:= 1;

%p for k from 1 while count < n do

%p if isprime(k*d+p) then count:= count+1 fi

%p od;

%p (k-1)*d+p

%p end proc:

%p f(3):= 0:

%p map(f, [$1..100]); # _Robert Israel_, Dec 10 2017

%o (PARI) a(n) = if(n == 3, return(0)); my(p = prime(n), d = 10^(logint(p, 10)+1), i = 1); for(x=0, +oo, if(isprime(x*d+p), i++; if(i > n, return(x*d+p)))); \\ _Iain Fox_, Dec 10 2017

%K base,nonn,easy

%O 1,1

%A _Amarnath Murthy_, Nov 24 2003

%E Corrected and extended by _David Wasserman_, Oct 12 2005

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 11:29 EDT 2024. Contains 371779 sequences. (Running on oeis4.)