A110908 Start 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 6 times the old bottom to get the new top.
1, 4, 52, 106
Offset: 1
Examples
The first four fractions according to the rule are n, 1,7/2 2,19/9 3,73/28 4,241/101 n=2,3 did not make the list because 9 and 28 are not prime.
References
- Prime Obsession, John Derbyshire, Joseph Henry Press, April 2004, p. 16.
Programs
-
Maple
A:= gfun:-rectoproc({a(n+2)-2*a(n+1)-5*a(n), a(0)=1, a(1)=7},a(n), remember): B:= gfun:-rectoproc({a(n+2)-2*a(n+1)-5*a(n), a(0)=1, a(1)=2},a(n),remember): select(n -> isprime(A(n)) and isprime(B(n)), [1,seq(seq(6*k+j,j=[0,4]),k=0..1000)]); # Robert Israel, Aug 12 2016
-
Mathematica
Position[Rest@ NestList[{Numerator@ #, Denominator@ #} &[(#1 + 6 #2)/(#1 + #2)] & @@ # &, {1, 1}, 2000], k_ /; Times @@ Boole@ Map[PrimeQ, k] == 1] // Flatten (* Michael De Vlieger, May 13 2017 *)
-
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+.) }
Formula
Given A(0)=1,B(0)=1 then for i=1,2,.. A(i)/B(i) = (A(i-1)+6*B(i-1))/(A(i-1)+B(i-1)).
Comments