cp's OEIS Frontend

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.

Showing 1-3 of 3 results.

A113517 Least k such that k^n-k+1 is prime, or 0 if there is no such k.

Original entry on oeis.org

2, 2, 3, 2, 3, 2, 0, 3, 4, 4, 4, 2, 0, 5, 18, 2, 12, 2, 0, 7, 3, 11, 13, 7, 0, 167, 15, 6, 63, 2, 0, 7, 6, 21, 49, 3, 0, 27, 30, 3, 22, 106, 0, 10, 30, 4, 294, 7, 0, 32, 19, 6, 7, 41, 0, 21, 4, 14, 34, 2, 0, 12, 13, 6, 147, 37, 0, 14, 139, 22, 46, 179, 0, 4, 75, 69, 15, 11, 0, 5, 211, 130
Offset: 2

Views

Author

T. D. Noe, Jan 12 2006

Keywords

Comments

a(n) is 0 for n=8,14,20,... (n=2 mod 6) because, for those n, the polynomial x^n-x+1 has the factor x^2-x+1. Using a result of Selmer, it can be shown that x^n-x+1 is irreducible for all other n. Does a(n) exist for all n>1?

Crossrefs

Cf. A113516 (smallest k such that n^k-n+1 is prime).

Programs

  • Mathematica
    Table[f=FactorList[x^n-x+1]; If[Length[f]>2, k=0, k=1; While[ !PrimeQ[k^n-k+1], k++ ]]; k, {n, 2, 100}]

A343589 Smallest prime of the form n^k-(n-1) or 0 if no such prime exists.

Original entry on oeis.org

3, 7, 13, 3121, 31, 43, 549755813881, 73, 991, 1321, 248821, 157, 2731, 211, 241, 34271896307617, 307, 6841, 13107199999999999999981, 421, 463, 141050039560662968926081, 331753, 601, 17551, 7625597484961, 757, 1816075630094014572464024421543167816955354437761
Offset: 2

Views

Author

Blake Branstool, Apr 20 2021

Keywords

Comments

All values up to n=70 have been found and proved to be primes. n=71 has k=3019 and gives a probable prime.
See A113516, which gives the k values and is the main entry for these primes, for more extensively researched information. - Peter Munn, Nov 20 2021

Examples

			For n=2 and k=2, 2^2-(2-1)=3 thus a(2)=3. k is 2 as well for n=3,4.
For n=5 the first k to result in a prime is 5, 5^5-(5-1)=3121 thus a(5)=3121.
		

Crossrefs

A113516 gives the k values.

Programs

  • PARI
    a(n) = my(k=1, p); while (!isprime(p=n^k-(n-1)), k++); p; \\ Michel Marcus, Nov 17 2021

Extensions

Name revised by Peter Munn, Nov 16 2021

A305531 Smallest k >= 1 such that (n-1)*n^k + 1 is prime.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 2, 1, 3, 10, 3, 1, 2, 1, 1, 4, 1, 29, 14, 1, 1, 14, 2, 1, 2, 4, 1, 2, 4, 5, 12, 2, 1, 2, 2, 9, 16, 1, 2, 80, 1, 2, 4, 2, 3, 16, 2, 2, 2, 1, 15, 960, 15, 1, 4, 3, 1, 14, 1, 6, 20, 1, 3, 946, 6, 1, 18, 10, 1, 4, 1, 5, 42, 4, 1, 828, 1, 1, 2, 1, 12, 2, 6, 4, 30, 3, 3022, 2, 1, 1
Offset: 2

Views

Author

Eric Chen, Jun 04 2018

Keywords

Comments

a(prime(j)) + 1 = A087139(j).
a(123) > 10^5, a(342) > 10^5, see the Barnes link for the Sierpinski base-123 and base-342 problems.
a(251) > 73000, see A087139.

Crossrefs

For the numbers k such that these forms are prime:
a1(b): numbers k such that (b-1)*b^k-1 is prime
a2(b): numbers k such that (b-1)*b^k+1 is prime
a3(b): numbers k such that (b+1)*b^k-1 is prime
a4(b): numbers k such that (b+1)*b^k+1 is prime (no such k exists when b == 1 (mod 3))
a5(b): numbers k such that b^k-(b-1) is prime
a6(b): numbers k such that b^k+(b-1) is prime
a7(b): numbers k such that b^k-(b+1) is prime
a8(b): numbers k such that b^k+(b+1) is prime (no such k exists when b == 1 (mod 3)).
Using "-------" if there is currently no OEIS sequence and "xxxxxxx" if no such k exists (this occurs only for a4(b) and a8(b) for b == 1 (mod 3)):
.
b a1(b) a2(b) a3(b) a4(b) a5(b) a6(b) a7(b) a8(b)
--------------------------------------------------------------------
4 A272057 ------- ------- xxxxxxx A059266 A089437 A217348 xxxxxxx
7 A046866 A245241 ------- xxxxxxx A191469 A217130 A217131 xxxxxxx
11 A046867 A057462 ------- ------- ------- ------- ------- -------
12 A079907 A251259 ------- ------- ------- A137654 ------- -------
13 A297348 ------- ------- xxxxxxx ------- ------- ------- xxxxxxx
14 A273523 ------- ------- ------- ------- ------- ------- -------
15 ------- ------- ------- ------- ------- ------- ------- -------
16 ------- ------- ------- xxxxxxx ------- ------- ------- xxxxxxx
Cf. (smallest k such that these forms are prime) A122396 (a1(b)+1 for prime b), A087139 (a2(b)+1 for prime b), A113516 (a5(b)), A076845 (a6(b)), A178250 (a7(b)).

Programs

  • PARI
    a(n)=for(k=1,2^16,if(ispseudoprime((n-1)*n^k+1),return(k)))
Showing 1-3 of 3 results.