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.

A087126 Primes of the form p^k - p^(k-1) + 1 for some prime p and integer k > 1.

Original entry on oeis.org

3, 5, 7, 17, 19, 43, 101, 157, 163, 257, 487, 1459, 2029, 4423, 6163, 14407, 19183, 22651, 23549, 26407, 37057, 39367, 62501, 65537, 77659, 113233, 121453, 143263, 208393, 292141, 342733, 375157, 412807, 527803, 564899, 590593, 697049, 843643
Offset: 1

Views

Author

T. D. Noe, Aug 15 2003

Keywords

Comments

It is usually the case that, for prime p and k > 1, the first time the totient function phi(n) has value p^k - p^(k-1) is for n = p^k. However, this is not true when p^k - p^(k-1) + 1 is prime.

Crossrefs

Cf. A002383 (primes of the form n^2 + n + 1, which is the same as n^2 - n + 1).
Cf. A019434 (Fermat primes), A003306 (2*3^n + 1 is prime), A056799 (8*9^n + 1 is prime), A056797 (9*10^n + 1 is prime), A087139 (least k such that p^k - p^(k-1) + 1 is prime for p = prime(n)).

Programs

  • Mathematica
    lst={}; maxNum=10^6; n=1; While[p=Prime[n]; p^2-p+1
    				

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

Original entry on oeis.org

3, 2, 2, 2, 2, 3, 2, 7, 56, 2, 2, 8, 8, 8, 2, 4, 4, 2, 2, 2, 9, 3, 21496, 26, 2, 2, 4, 38, 7, 286644, 2, 2, 26, 2, 2, 4, 4, 15, 4, 24, 16, 2, 264, 4, 2, 3, 24, 3, 516, 6
Offset: 1

Views

Author

T. D. Noe, Aug 31 2006

Keywords

Comments

Does a(n) always exist? Note that k cannot be 5, 11, 17,... (i.e., k=5 mod 6) because then p^2 - p + 1 divides p^k - p^(k-1) - 1.
From Richard N. Smith, Jul 15 2019: (Start)
The link has the primes 82*83^21495-1 = 83^21496-83^21495-1 and 112*113^286643-1 = 113^286644-113^286643-1, thus a(23)=21496 and a(30)=286644.
a(51) > 250000, since 232*233^k-1 is composite for all k<=250000, see link.
a(52) - a(61) = {4, 2, 80, 14, 76, 2, 90, 6, 80, 769}, a(62) > 200000. (End)

Crossrefs

Programs

  • Mathematica
    lst={}; Do[p=Prime[n]; k=2; While[m=p^k-p^(k-1)-1; !PrimeQ[m], k++ ]; AppendTo[lst,k], {n,22}]; lst
  • PARI
    a(n)=for(k=2, 10^6, if(ispseudoprime(prime(n)^k - prime(n)^(k-1) - 1), return(k))) \\ Richard N. Smith, Jul 15 2019

Extensions

a(23)-a(50) from Richard N. Smith, Jul 15 2019, using Steven Harvey's table.

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.