OFFSET
1,2
COMMENTS
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.
n, num/denom
1, 3/2
2, 7/5
4, 41/29
28, 63018038201/44560482149
58, 19175002942688032928599/13558774610046711780701
REFERENCES
Prime Obsession, John Derbyshire, Joseph Henry Press, 2004, p. 16.
FORMULA
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)).
EXAMPLE
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.
PROG
(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+.) }
CROSSREFS
KEYWORD
more,nonn
AUTHOR
Cino Hilliard, Oct 02 2005, Jul 05 2007
STATUS
approved