OFFSET
1,1
COMMENTS
This sequence is much faster to compute than y^z+x^z since the occurrence of a prime for y^z - x^z only takes place when z = 1 or y-x = 1. This is true because y-x or y+x divides y^z - x^z. comment out the print(x" "y" "z" "v" "ct); in the script to avoid listing the detail to the screen. Sum of the reciprocals of Seq(20,130) converges to 1.6359026039776143431548856889889230600448729878668090784647536941979 31129745142466816093140975967179... to 100 places.
FORMULA
Seq(n, m) = y^z - x^z = p. x=1..n, y=x..n, p=1..m. Include if p is prime.
EXAMPLE
919 = 18^3 - 17^3. 919 is prime.
PROG
(PARI) powerp(n, p) = { ct=0; sr=0; a=vector(n*n*p); for(x=1, n, for(y=x, n, for(z = 1, p, if(y-x == 1 || z == 1, v = y^z - x^z; if(isprime(v), ct+=1; a[ct] = v; print(x" "y" "z" "v" "ct); ); ); ); ); ); for(j=1, ct, for(k=j+1, ct, if(a[j] > a[k], tmp=a[k]; a[k]=a[j]; a[j]=tmp); ); ); for(j=1, ct, if(a[j]<>a[j+1], sr+=1.0/a[j]; print1(a[j]" ")); ); print(); print(sr); }
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Cino Hilliard, Dec 16 2002
STATUS
approved