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.

A087139 Least k>1 such that p^k - p^(k-1) + 1 is prime for p = prime(n).

Original entry on oeis.org

2, 2, 3, 2, 11, 2, 5, 30, 15, 3, 6, 10, 81, 3, 17, 961, 15, 7, 2, 5, 6, 2, 3, 3, 12, 3, 57, 5, 16, 5, 166, 15, 13, 2, 3, 2, 30, 2, 25, 3, 47, 3, 3, 2, 521, 9, 3, 15, 17, 42, 17, 51, 39
Offset: 1

Views

Author

T. D. Noe, Aug 18 2003

Keywords

Comments

The next term in this sequence, a(54) for the prime p=251, is greater than 73000.
Is there a prime p such that p^k - p^(k-1) + 1 is composite for all k > 1? For the related question of Sierpinski numbers (n such that n*2^k+1 is composite for all k ), the answer is yes.
If n=251^k-251^(k-1)+1 is prime then k mod 10 = 1,5,7 or 9 because n mod 3 = 0 iff k is even and n mod 11 = 0 iff k mod 5 = 3. More exponents can be cleared this way. - Bernardo Boncompagni, Oct 23 2005
Note that k cannot be 8, 14, 20, ... (i.e. k == 2 mod 6) because then p^2 - p + 1 divides p^k - p^(k-1) + 1. - T. D. Noe, Aug 31 2006

References

Crossrefs

Cf. A040076 (Sierpinski numbers), A087126 (primes of the form p^k - p^(k-1) + 1).
Cf. A122396.

Programs

  • Mathematica
    lst={}; Do[p=Prime[n]; i=2; While[m=p^i-p^(i-1)+1; !PrimeQ[m], i++ ]; AppendTo[lst, i], {n, 53}]; lst

A122395 Primes of the form p^k - p^(k-1) - 1, with p prime and k>1.

Original entry on oeis.org

3, 5, 7, 17, 19, 31, 41, 53, 109, 127, 271, 293, 499, 811, 929, 2027, 2161, 3659, 4373, 4421, 4969, 8191, 9311, 10099, 13121, 13309, 16001, 17029, 19181, 22051, 32579, 38611, 57839, 72091, 78607, 93941, 109229, 128521, 131071, 143261, 157211
Offset: 1

Views

Author

T. D. Noe, Aug 31 2006

Keywords

Comments

The paper by Stein and Williams gives a method for finding primes of this form when k>(p+1)/2.

Crossrefs

Cf. A122396.

Programs

  • Maple
    N:= 10^6: # for terms <= N
    p:= 1: R:= NULL:
    do
      p:= nextprime(p);
      if p^2 - p - 1 > N then break fi;
      for k from 2 do
        q:= p^k - p^(k-1)-1;
        if q > N then break fi;
        if isprime(q) then R:= R, q fi;
    od od:
    sort(convert({R},list)); # Robert Israel, Mar 12 2023
  • Mathematica
    nn=10^6; lst={}; n=1; While[p=Prime[n]; k=2; While[m=p^k-p^(k-1)-1; m2, n++ ]; lst=Union[lst]

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.