A245510 Records in A245509: smallest m > 1 such that the first odd number greater than m^k is prime for every 0 < k < n, but not for k = n.
7, 5, 2, 105, 3, 909, 4995825, 28212939, 4836335472639, 223671748721751
Offset: 1
Examples
a(4) = 105 because 105 is the smallest m such that the first odd numbers after m^k are prime for k = 1,2,3, but composite for k = 4. 909+2, 909^2+2, 909^3+2, 909^4+2 and 909^5+2 are five primes, but 909^6+2 is composite, and 909 is minimal with this property. Therefore, a(6)=909 (and A245509(909)=6). - _Jeppe Stig Nielsen_, Sep 09 2022
Links
- MathOverflow, Primes of the form a + b^k for k=(a mod 2), ..., n?
Programs
-
Mathematica
f[n_] := Block[{d = If[ OddQ@ n, 2, 1], m = 1, t}, While[t = n^m + d; EvenQ@ t || PrimeQ@ t, m++]; m]; t = Table[0, {25}]; k = 2; While[k < 29000000, a = f@ k; If[ t[[a]] == 0, t[[a]] = k; Print[{a, k}]]; k++]; t (* Robert G. Wilson v, Aug 04 2014 *)
-
PARI
a(n) = for(k=1, oo, c=0; for(i=1, n-1, if(isprime(k^i+(k%2)+1), c++)); if(c==n-1&&!isprime(k^n+(k%2)+1), return(k))) n=1; while(n<10, print1(a(n),", "); n++) \\ Derek Orr, Jul 27 2014
-
PARI
upto(n)=v=vector(n);forstep(m=3,+oo,2,k=1;while(ispseudoprime(m^k+2),k++);if(k<=n&&v[k]==0,v[k]=m-(k==3)*7;print(v);vecprod(v)!=0&&return(v))) \\ Jeppe Stig Nielsen, Sep 09 2022
Extensions
a(4) and example corrected by Derek Orr, Jul 27 2014
a(8) from Robert G. Wilson v, Aug 04 2014
a(9) from Kellen Shenton, Sep 14 2022
a(10) from Kellen Shenton, Sep 16 2022
Comments