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-2 of 2 results.

A270927 Smallest k such that k*n^m + 1 is prime, case m=4.

Original entry on oeis.org

1, 1, 2, 1, 18, 1, 6, 3, 6, 7, 46, 5, 10, 3, 8, 1, 16, 2, 28, 1, 2, 7, 16, 1, 24, 12, 10, 1, 10, 2, 6, 7, 26, 1, 12, 3, 6, 3, 8, 16, 10, 3, 22, 16, 2, 1, 6, 1, 36, 3, 6, 3, 16, 1, 18, 1, 8, 12, 16, 10, 12, 31, 2, 10, 22, 2, 36, 21, 40, 6, 12, 18, 6, 1, 6, 7, 10, 2, 18, 1, 2, 1, 22, 2, 12, 18, 6, 1, 18, 1, 58, 3, 12, 7, 24, 2, 16, 3, 16, 6, 6, 7, 46, 25, 2, 1, 12, 7, 18, 12, 46, 3, 12, 5, 10, 3, 48, 1, 16, 2
Offset: 1

Views

Author

Zak Seidov, Mar 26 2016

Keywords

Crossrefs

Cf. A034693 (m=1), A035092 (m=2), A238847 (m=3).

Programs

  • Mathematica
    With[{m = 4, nn = 120}, Table[SelectFirst[Range@ nn, PrimeQ[# n^m + 1] &], {n, nn}]] (* Michael De Vlieger, Mar 26 2016, Version 10 *)
    sk[n_]:=Module[{k=1,c=n^4},While[!PrimeQ[k*c+1],k++];k]; Array[sk,120] (* Harvey P. Dale, Jun 05 2021 *)
  • PARI
    {m=4;for(n=1,10000,k=1;while(!isprime(k*n^m+1),k++);
    write("b270927.txt",n" "k))} \\ for b-file - Zak Seidov, Mar 26 2016

A239021 Smallest number k such that k*n +/- 1, k*n^2 +/- 1, and k*n^3 +/- 1 are three sets of twin primes. a(n) = 0 if no such number exists.

Original entry on oeis.org

4, 105525, 10990, 15855, 344190, 2, 74580, 11580, 165592, 3759, 204918, 12670, 99090, 78, 3978, 11655, 8979180, 10605, 55188, 1221, 2, 23340, 4431420, 39158, 58464, 87318, 45420, 15780, 210, 91, 289422, 19740, 186410, 1293, 137664, 747, 443730, 94920, 278278
Offset: 1

Views

Author

Derek Orr, Mar 09 2014

Keywords

Examples

			1*6 +/- 1 (5 and 7), 1*6^2 +/- 1 (35 and 37), and 1*6^3 +/- 1 (215 and 217) are not three sets of twin primes. However, 2*6 +/- 1 (11 and 13), 2*6^2 +/- 1 (71 and 73), and 2*6^3 +/- 1 (431 and 433) are three sets of twin primes. Thus, a(6) = 2.
		

Crossrefs

Programs

  • Python
    from sympy import isprime
    def b(n):
      for k in range(10**8):
        if isprime(k*n+1) and isprime(k*n-1) and isprime(k*(n**2)+1) and isprime(k*(n**2)-1) and isprime(k*(n**3)+1) and isprime(k*(n**3)-1):
          return k
    n = 1
    while n < 100:
      print(b(n))
      n += 1
Showing 1-2 of 2 results.