A227170 Numbers n such that (16^n + 15^n)/31 is prime.
3, 5, 13, 1439, 1669, 37691
Offset: 1
Programs
-
PARI
is(n)=ispseudoprime((16^n+15^n)/31) \\ Charles R Greathouse IV, May 22 2017
This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
is(n)=ispseudoprime((16^n+15^n)/31) \\ Charles R Greathouse IV, May 22 2017
a(10) = 53 because (10^p + 11^p)/21 is composite for all p < 53 and prime for p = 53.
lmt = 4200; f[n_] := Block[{p = 2}, While[p < lmt && !PrimeQ[((n + 1)^p + n^p)/(2n + 1)], p = NextPrime@ p]; If[p > lmt, 0, p]]; Do[Print[{n, f[n] // Timing}], {n, 1000}] (* Robert G. Wilson v, Dec 01 2014 *)
a(n)=forprime(p=3, , if(ispseudoprime((n^p+(n+1)^p)/(2*n+1)), return(p)))
is(n)=ispseudoprime((18^n+17^n)/35) \\ Charles R Greathouse IV, Jun 13 2017
is(n)=ispseudoprime((48^n+47^n)/95) \\ Charles R Greathouse IV, Jun 13 2017
is(n)=ispseudoprime((138^n+137^n)/275) \\ Charles R Greathouse IV, Jun 13 2017
is(n)=ispseudoprime((140^n+139^n)/279) \\ Charles R Greathouse IV, Jun 13 2017
a(10) = 4 because (5^29 + 4^29)/9 = 2149818248341 is prime and (2^29 + 1^29)/3, (3^29 + 2^29)/5 and (4^29 + 3^29)/7 are all composite.
Table[p = Prime[n]; k = 1; While[q = ((b+1)^n+b^n)/(2*b+1); ! PrimeQ[q], k++]; k, {n, 200}] f[n_] := Block[{b = 1, p = Prime@ n}, While[! PrimeQ[((b +1)^p + b^p)/(2b +1)], b++]; b]; Array[f, 70, 2] (* Robert G. Wilson v, Jun 13 2018 *)
for(n=2, 200, b=0; until(isprime((((b+1)^prime(n)+b^prime(n))/(2*b+1))), b++); print1(b,", ")) \\ corrected by Eric Chen, Jun 06 2018
Comments