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

A231820 Least positive k such that n*k! - 1 is a prime, or 0 if no such k exists.

Original entry on oeis.org

3, 2, 1, 1, 3, 1, 2, 1, 2, 2, 4, 1, 4, 1, 2, 2, 3, 1, 2, 1, 2, 2, 3, 1, 3, 5, 2, 3, 3, 1, 2, 1, 3, 2, 4, 2, 2, 1, 3, 2, 4, 1, 3, 1, 2, 4, 3, 1, 2, 6, 2, 2, 3, 1, 2, 5, 2, 3, 3, 1, 10, 1, 4, 2, 3, 2, 3, 1, 2, 2, 7, 1, 8, 1, 2, 2, 3, 3, 2, 1, 5, 2, 8, 1, 3, 4, 2, 4, 15, 1
Offset: 1

Views

Author

Alex Ratushnyak, Nov 13 2013

Keywords

Crossrefs

Cf. A035092 (least k such that k*(n^2)+1 is a prime).
Cf. A175763 (least k such that k*(n^n)+1 is a prime).
Cf. A035093 (least k such that k*n!+1 is a prime).
Cf. A193807 (least k such that n*(k^2)+1 is a prime).
Cf. A231119 (least k such that n*(k^k)+1 is a prime).
Cf. A057217 (least k such that n*k!+1 is a prime).
Cf. A034693 (least k such that n*k +1 is a prime).
Cf. A231819 (least k such that k*(n^2)-1 is a prime).
Cf. A231818 (least k such that k*(n^n)-1 is a prime).
Cf. A083663 (least k such that k*n!-1 is a prime).
Cf. A231734 (least k such that n*(k^2)-1 is a prime).
Cf. A231735 (least k such that n*(k^k)-1 is a prime).
Cf. A053989 (least k such that n*k -1 is a prime).

Programs

  • Maple
    f:= proc(n) local k;
    for k from 1 do if isprime(n*k!-1) then return k fi od
    end proc:
    map(f, [$1..100]); # Robert Israel, Oct 29 2019
  • Mathematica
    Table[k = 1; While[! PrimeQ[k!*n - 1], k++]; k, {n, 100}] (* T. D. Noe, Nov 18 2013 *)
  • PARI
    a(n) = my(k=1); while (!isprime(n*k! - 1), k++); k; \\ Michel Marcus, Oct 29 2019

A110559 Least j such that j*n^2 -1 and j*n^2 +1 are twin primes.

Original entry on oeis.org

4, 1, 2, 12, 6, 2, 18, 3, 10, 6, 12, 3, 12, 18, 18, 57, 12, 5, 120, 12, 2, 3, 132, 2, 42, 3, 58, 45, 12, 7, 72, 15, 10, 3, 6, 2, 60, 30, 12, 3, 168, 2, 192, 18, 2, 33, 48, 10, 138, 39, 8, 63, 42, 22, 60, 42, 32, 3, 120, 6, 90, 18, 40, 165, 204, 7, 90, 18, 70, 6, 72, 27, 30, 15, 6, 18
Offset: 1

Views

Author

Pierre CAMI, Sep 12 2005

Keywords

Comments

Define Sj=sum of j(n) for n=1 to N. Define Sn=sum of (2*log(n))^2 for n=1 to N. As N increases Sj/Sn tends to 0.6. - Pierre CAMI, Dec 13 2011

Examples

			12*4*4-1=191, 191 and 193 are twin primes so a(4)=12.
		

Crossrefs

Cf. A231819.

Programs

  • PARI
    a(n) = my(j=1); while (!(isprime(p=j*n^2-1) && isprime(p+2)), j++); j; \\ Michel Marcus, Sep 17 2019

Extensions

Extended by Ray Chandler, Sep 15 2005

A231818 Least positive k such that k*n^n - 1 is a prime, or 0 if no such k exists.

Original entry on oeis.org

3, 1, 2, 5, 6, 3, 6, 39, 18, 6, 12, 19, 8, 23, 10, 3, 76, 13, 90, 26, 52, 45, 124, 12, 60, 27, 10, 99, 126, 11, 50, 27, 28, 59, 6, 80, 122, 71, 110, 21, 72, 111, 590, 147, 178, 84, 238, 12, 138, 236, 10, 53, 6, 60, 98, 72, 620, 30, 166, 5, 98, 18, 22, 384, 126
Offset: 1

Views

Author

Alex Ratushnyak, Nov 13 2013

Keywords

Crossrefs

Cf. A035092 (least k such that k*(n^2)+1 is a prime).
Cf. A175763 (least k such that k*(n^n)+1 is a prime).
Cf. A035093 (least k such that k*n!+1 is a prime).
Cf. A193807 (least k such that n*(k^2)+1 is a prime).
Cf. A231119 (least k such that n*(k^k)+1 is a prime).
Cf. A057217 (least k such that n*k!+1 is a prime).
Cf. A034693 (least k such that n*k +1 is a prime).
Cf. A231819 (least k such that k*(n^2)-1 is a prime).
Cf. A083663 (least k such that k*n!-1 is a prime).
Cf. A231734 (least k such that n*(k^2)-1 is a prime).
Cf. A231735 (least k such that n*(k^k)-1 is a prime).
Cf. A231820 (least k such that n*k!-1 is a prime).
Cf. A053989 (least k such that n*k -1 is a prime).

Programs

  • Mathematica
    Table[k = 1; While[! PrimeQ[k*n^n - 1], k++]; k, {n, 65}] (* T. D. Noe, Nov 15 2013 *)

A238848 Smallest k such that k*n^3 - 1 is prime.

Original entry on oeis.org

3, 1, 2, 2, 4, 2, 14, 7, 6, 2, 4, 4, 14, 3, 4, 2, 16, 4, 12, 9, 2, 5, 16, 2, 2, 3, 16, 6, 10, 4, 2, 4, 22, 2, 6, 3, 6, 10, 6, 3, 22, 5, 2, 3, 4, 2, 18, 4, 26, 10, 4, 5, 6, 2, 2, 7, 6, 2, 10, 5, 2, 9, 4, 2, 16, 3, 6, 9, 2, 3, 30, 5, 14, 6, 24, 5, 16, 5
Offset: 1

Views

Author

Derek Orr, Mar 06 2014

Keywords

Examples

			a(1) = 3 because for k = 1, 1*(1^3) - 1 = 0 is not prime, for k = 2, 2*(1^3) - 1 = 1 is not prime, but for k = 3, 3*(1^3) - 1 = 2 is prime.
		

Crossrefs

Programs

  • Mathematica
    sk[n_]:=Module[{k=1,n3=n^3},While[!PrimeQ[k*n3-1],k++];k]; Array[sk,80] (* Harvey P. Dale, Jan 04 2023 *)
  • Python
    import sympy
    from sympy import isprime
    def f(n):
      for k in range(1,10**3):
        if isprime(k*(n**3)-1):
          return k
    n = 1
    while n < 10**3:
      print(f(n))
      n += 1

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

Original entry on oeis.org

4, 3, 2, 15, 6, 2, 150, 75, 20, 6, 78, 85, 2490, 30, 18, 195, 5160, 490, 330, 12, 2, 870, 330, 13, 42, 105, 2280, 375, 12, 41, 1632, 720, 90, 3, 216, 2, 1380, 615, 98, 84, 438, 65, 600, 210, 148, 735, 3870, 115, 138, 39, 182, 2715, 16590, 48, 60, 63, 210, 120
Offset: 1

Views

Author

Derek Orr, Mar 09 2014

Keywords

Comments

If n>3 is odd and not a multiple of 3, then a(n) is a multiple of 6; e.g., a(5) = 6, a(7) = 150, a(11) = 78. If n>3 is even and not a multiple of 3, then a(n) is a multiple of 3. In short, for n>1, k*n should be a multiple of 6. - Zak Seidov, Mar 13 2014

Examples

			1*2 +/- 1 (1 and 3) and 1*2^2 +/- 1 (3 and 5) are not two sets of twin primes. 2*2 +/- 1 (3 and 5) and 2*2^2 +/- 1 (7 and 9) are not two sets of twin primes. However, 3*2 +/- 1 (5 and 7) and 3*2^2 +/- 1 (11 and 13) are two sets of twin primes. Thus, a(2) = 3.
		

Crossrefs

Programs

  • PARI
    a(n) = {k = 1; while (! (isprime(k*n+1) && isprime(k*n-1) && isprime(k*n^2+1) && isprime(k*n^2-1)), k++); k;} \\ Michel Marcus, Mar 15 2014
  • Python
    from sympy import isprime
    def b(n):
      for k in range(10**5):
        if isprime(k*n+1) and isprime(k*n-1) and isprime(k*(n**2)+1) and isprime(k*(n**2)-1):
          return k
    n = 1
    while n < 100:
      print(b(n))
      n += 1
    

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