%I #11 Oct 01 2013 17:58:19
%S 1,2,4,28,58
%N Starting a priori with the fraction 1/1, list n when the numerator and denominator are both prime for fractions built according to the rule: Add old top and old bottom to get the new bottom, add old top and twice the old bottom to get the new top.
%C k is the multiple 4 in the PARI code. The sequence of fractions found with the property that both numerator and denominator are prime is as follows.
%C n, num/denom
%C 1, 3/2
%C 2, 7/5
%C 4, 41/29
%C 28, 63018038201/44560482149
%C 58, 19175002942688032928599/13558774610046711780701
%D Prime Obsession, John Derbyshire, Joseph Henry Press, 2004, p. 16.
%F Given a(0)=1,b(0)=1 then for i=1,2,.. a(i)/b(i) = (a(i-1)+2*b(i-1))/(a(i-1)+b(i-1)).
%e For k=2, n = 1, we start with fraction 1/1. The new bottom is old top + old bottom = 1+1 = 2. Then we add 1 (old top) + 2*1 (old bottom) to get 3, the new top. So our first fraction is 3/2. Since these are both prime, n=1 is the first entry. Continuing with this fraction 3/2, we repeat the rule. The new bottom is 3+2 = 5. Then we add 3 + 2*2 to get 7, the new top. So our second fraction is 7/5. Since both numerator and denominator are prime, n=2 is the second entry.
%o (PARI) primenumdenom(n,k) = { local(a,b,x,tmp,v); a=1;b=1; for(x=1,n, tmp=b; b=a+b; a=k*tmp+a; if(tmp=1,v=a,v=b); if(ispseudoprime(a)&ispseudoprime(b),print1(x","); ) ); print(); print(a/b+.) }
%K more,nonn
%O 1,2
%A _Cino Hilliard_, Oct 02 2005, Jul 05 2007