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!)
A078668 Primes that are the difference between two powers: y^z - x^z = prime. 0

%I #6 Oct 01 2013 17:57:32

%S 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,127,211,271,331,

%T 397,547,631,919,1657,1801,1951,2269,2437,4651,8191,14197,61051,

%U 131071,371281,524287,543607,723901,1273609,1803001,2685817,2861461,5217031

%N Primes that are the difference between two powers: y^z - x^z = prime.

%C 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.

%F Seq(n, m) = y^z - x^z = p. x=1..n, y=x..n, p=1..m. Include if p is prime.

%e 919 = 18^3 - 17^3. 919 is prime.

%o (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); }

%K easy,nonn

%O 1,1

%A _Cino Hilliard_, Dec 16 2002

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 25 10:43 EDT 2024. Contains 371967 sequences. (Running on oeis4.)