Displaying 1-5 of 5 results found.
page
1
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.
+10
7
7, 5, 2, 105, 3, 909, 4995825, 28212939, 4836335472639, 223671748721751
COMMENTS
For more comments and a program, see A245509. a(9), if it exists, certainly exceeds 1050000000. It is not clear whether this sequence is infinite, nor whether a(n) is defined for every n.
For n > 3, a(n) is always odd, because A245509(i) can exceed 3 only when i is odd. Therefore to find more terms, it suffices to find odd bases m such that m+2, m^2+2, m^3+2, m^4+2, ..., m^N+2 is a long list of primes. - Jeppe Stig Nielsen, Sep 09 2022
For any term m beyond a(8) that exists, each of the following holds:
m = p - 2, where p is a prime (so m is odd);
m == 0 (mod 3);
m == {-1, 0, 1} (mod 5);
m == {-1, 0, 1} (mod 11);
consequently, m mod 330 is one of 9 values: {21, 45, 99, 111, 165, 219, 231, 285, 309}.
(End)
EXAMPLE
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
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 *)
PROG
(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
Smallest m such that the first odd number after n^m is composite.
+10
6
3, 5, 3, 2, 3, 1, 1, 3, 3, 2, 2, 1, 1, 3, 3, 2, 2, 1, 1, 3, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 3, 1, 1, 3, 3, 2, 2, 1, 1, 5, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 3, 2, 2, 2, 1, 1, 1, 1, 2, 3, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 3, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2
COMMENTS
The locution "first odd number after n^m" means n^m+1 for even n and n^m+2 for odd n.
The first few records in this sequence are a(2)=3, a(3)=5, a(909)=6, a(4995825)=7. No higher value was found up to 5500000 (see also A245510). It is not clear whether a(n) is bounded.
When n is odd, consider the numbers n+2, n^2+2, n^3+2, n^4+2, ... Then find the first term which is composite, and a(n) is the exponent of that term.
When n is even, consider the numbers n+1, n^2+1, n^3+1. Then a(n) is the exponent from the first term which is composite. For n even, we have a(n) <= 3, because n^3+1 = (n+1)(n^2-n+1) is always composite. (End)
EXAMPLE
a(2)=3 because, for k=1,2,3,..., the first odd numbers after 2^k are 3, 5, 9,... and the first one which is not prime corresponds to k=3.
a(3)=5 because the first odd numbers following 3^k are 5, 11, 29, 83, 245, ... and the first one which is not prime corresponds to k=5.
a(7)=1 because the odd number following 7^1 is 9, which is not prime.
MATHEMATICA
a245509[n_Integer] := Catch[
Do[
If[CompositeQ[n^m + 1 + If[OddQ[n], 1, 0]]
== True, Throw[m]],
{m, 100}]
]; Map[a245509,
f[n_] := Block[{d = If[ OddQ@ n, 2, 1], m = 1, t}, While[t = n^m + d; EvenQ@ t || PrimeQ@ t, m++]; m]; Array[f, 105, 2] (* Robert G. Wilson v, Aug 04 2014 *)
PROG
(PARI) avector(nmax)={my(n, k, d=2, v=vector(nmax)); for(n=2, #v+1, d=3-d; k=1; while(1, if(!isprime(n^k+d), v[n-1]=k; break, k++)); ); return(v); }
a=avector(10000) \\ For nmax=6000000 runs out of 1GB memory
Smallest m such that the largest odd number < n^m is not prime.
+10
6
1, 1, 2, 3, 2, 3, 2, 4, 1, 1, 2, 3, 2, 4, 1, 1, 2, 4, 2, 3, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 3, 1, 1, 1, 1, 2, 2, 1, 1, 2, 3, 2, 2, 1, 1, 2, 3, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 2, 3, 2, 3, 1, 1, 1, 1, 2, 3, 1, 1, 2, 2, 2, 3, 1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1
COMMENTS
The locution "largest odd number < n^m" means n^m-1 for even n and n^m-2 for odd n.
The record values in this sequence are a(2)=1, a(4)=2, a(5)=3, a(9)=4, a(279)=5, a(15331)=6, a(1685775)=7. No higher value was found up to 5500000 (see also A245512). It is not clear whether a(n) is bounded.
EXAMPLE
a(2)=1 because 2^1-1 is 1, which is not a prime.
a(5)=3 because the numbers 5^k-2, for k=1,2,3,.., are 3,23,123,... and the first nonprime among them corresponds to k=3.
MATHEMATICA
f[n_] := Block[{m = 1, d = If[ OddQ@ n, 2, 1]}, While[t = n^m - d; EvenQ@ t || PrimeQ@ t, m++]; m]; Array[f, 105, 2] (* Robert G. Wilson v, Aug 04 2014 *)
PROG
(PARI) avector(nmax)={my(n, k, d=2, v=vector(nmax)); for(n=2, #v+1, d=3-d; k=1; while(1, if(!isprime(n^k-d), v[n-1]=k; break, k++)); ); return(v); }
a=avector(10000) \\ For nmax=6000000 runs out of 1GB memory
Records in A245511: smallest m > 1 such that the largest odd number less than m^k is prime for every 0 < k < n, but not for k = n.
+10
6
2, 4, 5, 9, 279, 15331, 1685775, 205670529, 129734299239, 148778622108171
COMMENTS
For more comments and a program, see A245511. a(9), if it exists, certainly exceeds 500000000. It is not clear whether this sequence is infinite, nor whether a(n) is defined for every n.
For n > 2, a(n) is always odd, because A245511(i) can exceed 2 only when i is odd. Therefore to find more terms, it suffices to find odd bases m such that m-2, m^2-2, m^3-2, m^4-2, ..., m^N-2 is a long list of primes. - Jeppe Stig Nielsen, Sep 14 2022
EXAMPLE
a(3) = 5 because the odd numbers preceding 5^k, for k = 1,2,3, are 3, 23 and 123, and the first one which is not a prime corresponds to k = 3. Moreover, 5 is the smallest natural having this property.
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 < 210000000, a = f@ k; If[ t[[a]] == 0, t[[a]] = k; Print[{a, k}]]; k++]; t (* Robert G. Wilson v, Aug 04 2014 *)
PROG
(PARI)
a(n) = for(k=1, 10^6, 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
Smallest m such that at least one of the two odd numbers which bracket n^m is not a prime.
+10
6
1, 1, 2, 2, 2, 1, 1, 3, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
COMMENTS
The locution "the two odd numbers which bracket n^m" indicates the pair (n^m-1,n^m+1) for even n and (n^m-2,n^m+2) for odd n.
The initial records in this sequence are a(2)=1, a(4)=2, a(9)=3, a(102795)=4. No higher value was found up to 5500000. It is not clear whether a(n) is bounded.
EXAMPLE
a(2)=1 because one of the two odd numbers (1,3) which bracket 2^1 is not a prime. a(5)=2 because 5^1 is bracketed by the odd numbers (3,7) which are both prime, while 5^2 is bracketed by the odd numbers (23,27), one of which is not a prime.
The number c=102795 is the smallest one whose powers c^1, c^2, c^3 are all odd-bracketed by primes, while c^4 is not.
PROG
(PARI) avector(nmax)={my(n, k, d=2, v=vector(nmax)); for(n=2, #v+1, d=3-d; k=1; while(1, if((!isprime(n^k-d))||(!isprime(n^k+d)), v[n-1]=k; break, k++)); ); return(v); }
a=avector(10000) \\ For nmax=6000000 runs out of 1GB memory
Search completed in 0.007 seconds
|