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.

Previous Showing 41-50 of 52 results. Next

A034848 a(n) = 1 + 3*A034782(n).

Original entry on oeis.org

73, 97, 103, 193, 229, 241, 277, 283, 313, 331, 367, 373, 397, 433, 457, 463, 547, 607, 619, 643, 661, 709, 727, 733, 739, 757, 823, 859, 883, 907, 967, 997, 1021, 1033, 1069, 1087, 1093, 1123, 1129, 1171, 1237, 1249, 1303, 1423, 1447, 1453, 1483, 1489, 1543, 1579, 1597
Offset: 1

Views

Author

Keywords

Comments

a(n) = P(n,3) = 1 + 3*K(n,3) = 1 + 3*A034782(n). P(n,3) are special primes of the form 3k+1. The relevant values of k are given by A034782.
Note that, e.g., 13, 19, 31, 5, 13 are not in this sequence.

Crossrefs

Programs

  • PARI
    a034693(n) = my(s=1); while(!isprime(s*n+1), s++); s;
    isok(n) = a034693(n) == 3;
    lista(nn) = {for (n=1, nn, if (isok(n), print1(3*n+1, ", ")););} \\ Michel Marcus, May 13 2018

Extensions

Corrected (wrong term 769 removed) and extended by Michel Marcus, May 13 2018

A072341 a(n) = the least natural number k such that k*sigma(n) + 1 is prime.

Original entry on oeis.org

1, 2, 1, 4, 1, 1, 2, 2, 4, 1, 1, 1, 2, 3, 3, 10, 1, 2, 2, 1, 3, 1, 3, 1, 10, 1, 1, 2, 1, 1, 3, 2, 2, 2, 2, 6, 5, 1, 2, 2, 1, 1, 2, 4, 1, 1, 2, 3, 4, 4, 1, 2, 2, 2, 1, 2, 3, 2, 1, 2, 5, 1, 3, 4, 4, 3, 2, 1, 1, 3, 1, 6, 2, 2, 3, 2, 1, 2, 3, 2, 6, 1, 4, 2, 1, 3, 2, 1, 2, 4, 1, 2, 2, 3, 2, 3, 2, 12, 1, 6, 1, 2, 3
Offset: 1

Views

Author

Joseph L. Pe, Jul 16 2002

Keywords

Comments

Conjecture: a(n) is less than or equal to n for all n.

Examples

			sigma(4) = 7 and the least natural number k such that 7 k + 1 is prime is k = 4; so a(4) = 4.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Module[{i}, i = 0; While[ ! PrimeQ[i*DivisorSigma[1, n] + 1], i++ ]; i]; Table[f[i], {i, 1, 150}]
  • PARI
    A072341(n) = { my(k=1,s=sigma(n)); while(!isprime(1+(k*s)),k++); k; }; \\ Antti Karttunen, Nov 07 2017

Formula

a(n) = A034693(A000203(n)). - Antti Karttunen, Nov 07 2017

A087554 a(n) = smallest number k >= n such that nk + 1 is a prime.

Original entry on oeis.org

1, 2, 4, 4, 6, 6, 10, 9, 12, 10, 18, 13, 24, 14, 16, 16, 18, 21, 22, 20, 22, 28, 26, 24, 28, 26, 28, 34, 32, 33, 36, 36, 34, 37, 42, 36, 40, 39, 48, 40, 42, 46, 46, 47, 48, 51, 50, 54, 52, 51, 56, 55, 56, 54, 58, 56, 58, 61, 60, 67, 66, 63, 66, 67, 68, 66, 70, 75, 70, 79, 72, 79
Offset: 1

Views

Author

Amarnath Murthy, Sep 13 2003

Keywords

Comments

Conjectures: (1) k < 2n. (2) For every r, there exists a number S, nr < S < n(r+1) such that nS + 1 is prime.

Crossrefs

Cf. A034693.

Programs

  • Maple
    for n from 1 to 120 do k := n: while(not isprime(n*k+1)) do k := k+1:od:a[n] := k:od:seq(a[l],l=1..120); # Sascha Kurz

Extensions

Edited by Ray Chandler and Don Reble, Sep 16 2003

A187808 a(n) = |{0<=k

Original entry on oeis.org

0, 1, 1, 2, 1, 3, 1, 2, 1, 3, 2, 3, 1, 4, 1, 4, 1, 3, 2, 5, 4, 4, 2, 4, 1, 4, 2, 5, 1, 4, 2, 4, 2, 6, 2, 5, 4, 4, 2, 5, 1, 7, 1, 7, 5, 3, 2, 4, 2, 4, 3, 6, 3, 6, 4, 7, 4, 8, 2, 9, 2, 8, 3, 2, 3, 7, 4, 7, 1, 7, 4, 7, 1, 7, 4, 9, 7, 8, 2, 9, 3, 6, 2, 6, 3, 7, 2, 8, 3, 7, 4, 6, 8, 9, 4, 6, 3, 9, 5, 8
Offset: 1

Views

Author

Zhi-Wei Sun, Jan 07 2013

Keywords

Comments

Conjecture: a(n)>0 for all n>1. Moreover, if n>5 is different from 9, 191, 329, 641, 711, 979, then 2k-3, 2k+3, n(n-k)-1, n(n+k)-1 are all prime for some 0
Zhi-Wei Sun also made the following conjectures:
(1) For any integer n>101 there is an integer 0
(2) For each n=128,129,... there is an integer 0

Examples

			a(25) = 1 since 2*17+3 = 37, 25(25-17)-1 = 199, and 25(25+17)-1 = 1049 are all prime.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=a[n]=Sum[If[PrimeQ[2k+3]==True&&PrimeQ[n(n-k)-1]==True&&PrimeQ[n(n+k)-1]==True,1,0],{k,0,n-1}]
    Do[Print[n," ",a[n]],{n,1,100}]

A196660 Smallest k>0 such that k*n+(n-1) is prime.

Original entry on oeis.org

2, 1, 1, 1, 3, 1, 1, 2, 1, 1, 3, 1, 7, 2, 1, 1, 3, 2, 1, 2, 1, 1, 5, 1, 5, 3, 1, 2, 5, 1, 1, 3, 3, 1, 3, 1, 1, 2, 5, 1, 3, 1, 5, 2, 1, 2, 5, 3, 1, 2, 1, 1, 3, 1, 1, 2, 1, 2, 5, 2, 7, 6, 3, 1, 5, 1, 5, 3, 1, 1, 3, 4, 13, 5, 1, 1, 3, 2, 1, 2, 7, 1, 3, 1, 5, 2, 1, 2, 15
Offset: 1

Author

Frank M Jackson, Oct 05 2011

Keywords

Comments

Conjecture: for every n there exists k < n (apart from a(1)) such that k*n+(n-1) is prime. See A034693.

Examples

			If n=13, the smallest prime in the sequence 25,38,51,64,77,90,103,... is 103, so a(13)=7.
		

Crossrefs

Programs

  • Mathematica
    q[n_]:=(k=0; While[!PrimeQ[++k*n+n-1]]; k); Table[q[n],{n,1,100}]
  • PARI
    a(n) = my(k=1); while (!isprime(k*n+(n-1)), k++); k; \\ Michel Marcus, Mar 18 2025

A230243 Number of primes p < n with 3*p + 8 and (p-1)*n + 1 both prime.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 1, 3, 1, 4, 2, 1, 4, 2, 2, 4, 2, 3, 2, 4, 3, 4, 4, 2, 2, 2, 1, 5, 3, 4, 3, 3, 2, 3, 4, 2, 2, 4, 2, 4, 4, 1, 5, 3, 2, 6, 4, 1, 5, 6, 3, 3, 5, 1, 5, 5, 2, 7, 5, 3, 4, 4, 3, 4, 6, 3, 4, 6, 4, 5, 6, 3, 7, 4, 2, 6, 1, 3, 5, 9, 3, 3, 7, 4, 3, 7, 1, 6, 5, 5, 5, 6, 3, 6, 7
Offset: 1

Author

Zhi-Wei Sun, Oct 13 2013

Keywords

Comments

Conjecture: a(n) > 0 for all n > 4.
This implies A. Murthy's conjecture (cf. A034693) that for any integer n > 1, there is a positive integer k < n such that k*n + 1 is prime.
Conjecture verified for n up to 10^9. - Mauro Fiorentini, Sep 21 2023

Examples

			a(8) = 1 since 8 = 3 + 5 with 3, 3*3+8 = 17, (3-1)*8+1 = 17 all prime.
a(17) = 1 since 17 = 7 + 10, and 7, 3*7+8 = 29, (7-1)*17+1 = 103 are all prime.
		

Programs

  • Mathematica
    a[n_]:=Sum[If[PrimeQ[3Prime[i]+8]&&PrimeQ[(Prime[i]-1)n+1],1,0],{i,1,PrimePi[n-1]}]
    Table[a[n],{n,1,100}]

A261625 Number of primes p <= n such that (p-1)*n+1 is prime.

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 2, 1, 2, 3, 2, 2, 4, 1, 4, 3, 1, 5, 2, 2, 5, 4, 3, 3, 4, 3, 5, 6, 3, 5, 3, 2, 6, 5, 5, 5, 3, 2, 5, 6, 3, 4, 6, 2, 7, 9, 2, 5, 5, 3, 9, 7, 1, 5, 7, 5, 5, 8, 2, 8, 7, 3, 8, 7, 5, 7, 6, 3, 6, 9, 5, 9, 7, 4, 6, 8, 3, 8, 9, 3
Offset: 1

Author

Zhi-Wei Sun, Aug 27 2015

Keywords

Comments

Conjecture: a(n) > 0 for all n > 1.

Examples

			a(53) = 1 since 3 and (3-1)*53+1 = 107 are both prime.
		

Crossrefs

Programs

  • Mathematica
    Do[r=0;Do[If[PrimeQ[(Prime[k]-1)n+1],r=r+1],{k,1,PrimePi[n]}];Print[n," ",r];Continue,{n,1,80}]
  • PARI
    a(n) = my(nb=0); forprime(p=2, n, if (isprime((p-1)*n+1), nb++)); nb; \\ Michel Marcus, Aug 27 2015

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

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

A379654 Least positive integer k <= n such that |tau(k)|*n + 1 is prime, or 0 if such k does not exist, where the tau function is given by A000594.

Original entry on oeis.org

1, 1, 2, 1, 5, 1, 5, 2, 3, 1, 4, 1, 2, 2, 11, 1, 2, 1, 2, 5, 13, 1, 4, 2, 2, 3, 5, 1, 3, 1, 5, 2, 3, 6, 3, 1, 21, 15, 2, 1, 3, 1, 2, 11, 5, 1, 2, 2, 6, 2, 3, 1, 4, 2, 2, 11, 7, 1, 3, 1, 3, 2, 3, 5, 3, 1, 2, 3, 2, 1, 4, 1, 2, 2, 2, 6, 10, 1, 15, 3, 4, 1, 2, 2, 5, 3, 2, 1, 2, 2, 6, 12, 4, 3, 2, 1, 7, 3, 2, 1
Offset: 1

Author

Zhi-Wei Sun, Dec 28 2024

Keywords

Comments

Conjecture 1: a(n) > 0 for all n > 0. In other words, for each positive integer n, there is a number k among 1,...,n such that |tau(k)|*n + 1 is prime.
Conjecture 2: For each integer n > 1 not equal to 22, there is a number k among 1,...,n such that |tau(k)|*n - 1 is prime.
We have verified both conjectures for n up to 10^8.

Examples

			a(1) = 1 since 1*|tau(1)| + 1 = 2 is a prime.
a(5) = 5 since 5*|tau(5)| + 1 = 5*4830 + 1 = 24151 is prime, and 5*|tau(k)| + 1 is composite for every k = 1, 2, 3, 4.
		

Crossrefs

Programs

  • Mathematica
    t[n_]:=t[n]=Abs[RamanujanTau[n]];
    L={};Do[Do[If[PrimeQ[t[k]n+1],L=Append[L,k];Goto[aa]],{k,1,n}];L=Append[L,0];Label[aa],{n,1,100}];Print[L]

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

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
    
Previous Showing 41-50 of 52 results. Next