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-10 of 11 results. Next

A085398 Let Cn(x) be the n-th cyclotomic polynomial; a(n) is the least k>1 such that Cn(k) is prime.

Original entry on oeis.org

3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 5, 2, 2, 2, 2, 2, 2, 6, 2, 4, 3, 2, 10, 2, 22, 2, 2, 4, 6, 2, 2, 2, 2, 2, 14, 3, 61, 2, 10, 2, 14, 2, 15, 25, 11, 2, 5, 5, 2, 6, 30, 11, 24, 7, 7, 2, 5, 7, 19, 3, 2, 2, 3, 30, 2, 9, 46, 85, 2, 3, 3, 3, 11, 16, 59, 7, 2, 2, 22, 2, 21, 61, 41, 7, 2, 2, 8, 5, 2, 2
Offset: 1

Views

Author

Don Reble, Jun 28 2003

Keywords

Comments

Conjecture: a(n) is defined for all n. - Eric Chen, Nov 14 2014
Existence of a(n) is implied by Bunyakovsky's conjecture. - Robert Israel, Nov 13 2014

Examples

			a(11) = 5 because C11(k) is composite for k = 2, 3, 4 and prime for k = 5.
a(37) = 61 because C37(k) is composite for k = 2, 3, 4, ..., 60 and prime for k = 61.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local k;
    for k from 2 do if isprime(numtheory:-cyclotomic(n,k)) then return k fi od
    end proc:
    seq(f(n), n = 1 .. 100); # Robert Israel, Nov 13 2014
  • Mathematica
    Table[k = 2; While[!PrimeQ[Cyclotomic[n, k]], k++]; k, {n, 300}] (* Eric Chen, Nov 14 2014 *)
  • PARI
    a(n) = k=2; while(!isprime(polcyclo(n, k)), k++); k; \\ Michel Marcus, Nov 13 2014

Formula

a(A072226(n)) = 2. - Eric Chen, Nov 14 2014
a(n) = A117544(n) except when n is a prime power, since if n is a prime power, then A117544(n) = 1. - Eric Chen, Nov 14 2014
a(prime(n)) = A066180(n), a(2*prime(n)) = A103795(n), a(2^n) = A056993(n-1), a(3^n) = A153438(n-1), a(2*3^n) = A246120(n-1), a(3*2^n) = A246119(n-1), a(6^n) = A246121(n-1), a(5^n) = A206418(n-1), a(6*A003586(n)) = A205506(n), a(10*A003592(n)) = A181980(n).

A084742 Least k such that (n^k+1)/(n+1) is prime, or 0 if no such prime exists.

Original entry on oeis.org

3, 3, 3, 5, 3, 3, 0, 3, 5, 5, 5, 3, 7, 3, 3, 7, 3, 17, 5, 3, 3, 11, 7, 3, 11, 0, 3, 7, 139, 109, 0, 5, 3, 11, 31, 5, 5, 3, 53, 17, 3, 5, 7, 103, 7, 5, 5, 7, 1153, 3, 7, 21943, 7, 3, 37, 53, 3, 17, 3, 7, 11, 3, 0, 19, 7, 3, 757, 11, 3, 5, 3, 7, 13, 5, 3, 37, 3, 3, 5, 3, 293, 19, 7, 167, 7, 7, 709, 13, 3, 3, 37, 89, 71, 43, 37
Offset: 2

Views

Author

Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Jun 15 2003

Keywords

Comments

When (n^k+1)/(n+1) is prime, k must be prime. As mentioned by Dubner and Granlund, when n is a perfect power (the power is greater than 2), then (n^k+1)/(n+1) will usually be composite for all k, which is the case for n = 8, 27, 32 and 64. a(n) are only probable primes for n = {53, 124, 150, 182, 205, 222, 296}.
a(n) = 0 if n = {8, 27, 32, 64, 125, 243, ...}. - Eric Chen, Nov 18 2014
More terms: a(124) = 16427, a(150) = 6883, a(182) = 1487, a(205) = 5449, a(222) = 1657, a(296) = 1303. For n up to 300, a(n) is currently unknown only for n = {97, 103, 113, 175, 186, 187, 188, 220, 284}. All other terms up to a(300) are less than 1000. - Eric Chen, Nov 18 2014
a(97) > 31000. - Eric Chen, Nov 18 2014
a(311) = 2707, a(313) = 4451. - Eric Chen, Nov 20 2014
a(n)=3 if and only if n^2-n+1 is a prime; that is, n belongs to A055494. - Thomas Ordowski, Sep 19 2015
From Altug Alkan, Sep 29 2015: (Start)
a(n)=5 if and only if Phi(10, n) is prime and Phi(6, n) is composite. n belongs to A246392.
a(n)=7 if and only if Phi(14, n) is prime, and Phi(10, n) and Phi(6, n) are both composite. n belongs to A250174.
a(n)=11 if and only if Phi(22, n) is prime, and Phi(14, n), Phi(10, n) and Phi(6, n) are all composite. n belongs to A250178.
Where Phi(k, n) is the k-th cyclotomic polynomial. (End)
a(97) > 800000 (or a(97) = 0). - Wang Runsen, May 10 2023

Examples

			a(5) = 5 as (5^5 + 1)/(5 + 1) = 1 - 5 + 5^2 - 5^3 + 5^4 = 521 is a prime.
a(7) = 3 as (7^3 + 1)/(7 + 1) = 1 - 7 + 7^2 = 43 is a prime.
		

Crossrefs

Programs

  • PARI
    a(n) = {l=List([8, 27, 32, 64, 125, 243, 324, 343]); for(q=1, #l, if(n==l[q], return(0))); k=2; while(k, s=(n^prime(k)+1)/(n+1); if(ispseudoprime(s), return(prime(k))); k++)}
    n=2; while(n<361, print1(a(n), ", "); n++) \\ Eric Chen, Nov 25 2014

Extensions

More terms from T. D. Noe, Jan 22 2004

A084740 Least k such that (n^k-1)/(n-1) is prime, or 0 if no such prime exists.

Original entry on oeis.org

2, 3, 2, 3, 2, 5, 3, 0, 2, 17, 2, 5, 3, 3, 2, 3, 2, 19, 3, 3, 2, 5, 3, 0, 7, 3, 2, 5, 2, 7, 0, 3, 13, 313, 2, 13, 3, 349, 2, 3, 2, 5, 5, 19, 2, 127, 19, 0, 3, 4229, 2, 11, 3, 17, 7, 3, 2, 3, 2, 7, 3, 5, 0, 19, 2, 19, 5, 3, 2, 3, 2, 5, 5, 3, 41, 3, 2, 5, 3, 0, 2, 5, 17, 5, 11, 7, 2, 3, 3, 4421, 439, 7, 5, 7, 2, 17, 13, 3, 2, 3, 2, 19, 97, 3, 2, 17, 2, 17, 3, 3, 2, 23, 29, 7, 59
Offset: 2

Views

Author

Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Jun 15 2003

Keywords

Comments

When (n^k-1)/(n-1) is prime, k must be prime. As mentioned by Dubner, when n is a perfect power, then (n^k-1)/(n-1) will usually be composite for all k, which is the case for n = 9, 25, 32, 49, 64, 81, 121, 125, 144, 169, 216, 225, 243, 289, 324, 343, ... - T. D. Noe, Jan 30 2004
a(152) > prime(1100) or 0. - Derek Orr, Nov 29 2014
a(n)=2 if and only if n=p-1, where p is an odd prime; that is, n belongs to A006093, except 2. - Thomas Ordowski, Sep 19 2015
Probably a(152) = 270217 since (152^270217-1)/(152-1) has been shown to be probably prime. - Michael Stocker, Jan 24 2019

Examples

			a(7) = 5 as (7^5 - 1 )/(7 - 1) = 2801 = 1 + 7 + 7^2 + 7^3 + 7^4 is a prime but no smaller partial sum yields a prime.
		

Crossrefs

Programs

  • PARI
    a(n) = {l=List([9, 25, 32, 49, 64, 81, 121, 125, 144, 169, 216, 225, 243, 289, 324, 343]); for(q=1, #l, if(n==l[q], return(0))); k=1; while(k, s=(n^prime(k)-1)/(n-1); if(ispseudoprime(s), return(prime(k))); k++)}
    n=2; while(n<361, print1(a(n), ", "); n++) \\ Derek Orr, Jul 13 2014

Extensions

More terms from T. D. Noe, Jan 23 2004

A123627 Smallest prime q such that (q^p+1)/(q+1) is prime, where p = prime(n); or 0 if no such prime q exists.

Original entry on oeis.org

0, 2, 2, 2, 2, 2, 2, 2, 2, 7, 2, 19, 61, 2, 7, 839, 89, 2, 5, 409, 571, 2, 809, 227, 317, 2, 5, 79, 23, 4073, 2, 281, 89, 739, 1427, 727, 19, 19, 2, 281, 11, 2143, 2, 1013, 4259, 2, 661, 1879, 401, 5, 4099, 1579, 137, 43, 487, 307, 547, 1709, 43, 3, 463, 2161, 353, 443, 2
Offset: 1

Views

Author

Alexander Adamchuk, Oct 04 2006, Aug 05 2008

Keywords

Comments

a(1) = 0 because such a prime does not exist, Mod[n^2+1,n+1] = 2 for n>1.
Corresponding primes (q^p+1)/(q+1), where prime q = a(n) and p = Prime[n], are listed in A123628[n] = {1,3,11,43,683,2731,43691,174763,2796203,402488219476647465854701,715827883,...}.
a(n) coincides with A103795[n] when A103795[n] is prime.
a(n) = 2 for n = PrimePi[A000978[k]] = {2,3,4,5,6,7,8,9,11,14,18,22,26,31,39,43,46,65,69,126,267,380,495,762,1285,1304,1364,1479,1697,4469,8135,9193,11065,11902,12923,13103,23396,23642,31850,...}.
Corresponding primes of the form (2^p + 1)/3 are the Wagstaff primes that are listed in A000979[n] = {3,11,43,683,2731,43691,174763,2796203,715827883,...}.

Crossrefs

Programs

  • Maple
    f:= proc(n) local p,q;
      p:= ithprime(n);
      q:= 1;
      do
       q:= nextprime(q);
       if isprime((q^p+1)/(q+1)) then return q fi
      od
    end proc:
    f(1):= 0:
    map(f, [$1..70]); # Robert Israel, Jul 31 2019
  • Mathematica
    a(1) = 0, for n>1 Do[p=Prime[k]; n=1; q=Prime[n]; cp=(q^p+1)/(q+1); While[ !PrimeQ[cp], n=n+1; q=Prime[n]; cp=(q^p+1)/(q+1)]; Print[q], {k, 2, 61}]
    Do[p=Prime[k]; n=1; q=Prime[n]; cp=(q^p+1)/(q+1); While[ !PrimeQ[cp], n=n+1; q=Prime[n]; cp=(q^p+1)/(q+1)]; Print[{k,q}], {k, 1, 134}]
    spq[n_]:=Module[{p=Prime[n],q=2},While[!PrimeQ[(q^p+1)/(q+1)],q=NextPrime[ q]]; q]; Join[{0},Array[spq,70,2]] (* Harvey P. Dale, Mar 23 2019 *)

Formula

A123628(n) = (a(n)^prime(n) + 1) / (a(n) + 1).

A123628 Smallest prime of the form (q^p+1)/(q+1), where p = prime(n) and q is also prime (q = A123627(n)); or 1 if such a prime does not exist.

Original entry on oeis.org

1, 3, 11, 43, 683, 2731, 43691, 174763, 2796203, 402488219476647465854701, 715827883, 10300379826060720504760427912621791994517454717, 254760179343040585394724919772965278539769280548173566545431025735121201
Offset: 1

Views

Author

Alexander Adamchuk, Oct 03 2006

Keywords

Comments

a(1) = 1 because such a prime does not exist; (n^2+1) mod (n+1) = 2 for n > 1. a(n) = (A103795(n)^prime(n)+1)/(A103795(n)+1) when A103795(n) is prime. Corresponding smallest primes q such that (q^p+1)/(q+1) is prime, where p = prime(n), are listed in A123627(n) = {0, 2, 2, 2, 2, 2, 2, 2, 2, 7, 2, 19, 61, 2, 7, 839, 1459, 2, 5, 409, 571, 2, ...}. All Wagstaff primes or primes of form (2^p + 1)/3 belong to a(n). Wagstaff primes are listed in A000979(n) = {3, 11, 43, 683, 2731, 43691, 174763, 2796203, 715827883, ...}. Corresponding indices n such that a(n) = (2^prime(n) + 1)/3 are PrimePi(A000978(n)) = {2, 3, 4, 5, 6, 7, 8, 9, 11, 14, 18, 22, 26, 31, 39, 43, 46, 65, 69, 126, 267, 380, 495, 762, 1285, 1304, 1364, 1479, 1697, 4469, 8135, 9193, 11065, 11902, 12923, 13103, 23396, 23642, 31850, ...}. All primes with prime indices in the Jacobsthal sequence A001045(n) belong to a(n).

Crossrefs

Formula

a(n) = (A123627(n)^prime(n) + 1) / (A123627(n) + 1).

A103794 Smallest number b such that b^prime(n) - (b-1)^prime(n) is prime.

Original entry on oeis.org

2, 2, 2, 2, 6, 2, 2, 2, 6, 3, 2, 40, 7, 5, 13, 3, 3, 2, 7, 18, 47, 8, 6, 2, 26, 3, 42, 2, 13, 8, 2, 8, 328, 8, 9, 45, 27, 13, 76, 15, 52, 111, 5, 15, 50, 287, 16, 5, 40, 23, 110, 368, 23, 68, 28, 96, 81, 150, 3, 143, 4, 12, 403, 4, 45, 11, 83, 21, 96, 5, 109, 350, 128, 304, 38, 4, 163
Offset: 1

Views

Author

Lei Zhou, Feb 24 2005

Keywords

Comments

Conjecture: sequence is defined for all positive indices.
For p=prime(n), Eisenstein's irreducibility criterion can be used to show that the polynomial (x+1)^p-x^p is irreducible, which is a necessary (but not sufficient) condition for a(n) to exist. - T. D. Noe, Dec 05 2005

Examples

			2^prime(1)-1^prime(1)=3 is prime, so a(1)=2;
2^prime(5)-1^prime(5)=2047 has a factor of 23;
...
6^prime(5)-5^prime(5)=313968931 is prime, so a(5)=6;
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local p,b;
      p:= ithprime(n);
      for b from 2 do
        if isprime(b^p - (b-1)^p) then return b fi
      od
    end proc:
    map(f, [$1..80]); # Robert Israel, Jun 04 2024
  • Mathematica
    Do[p=Prime[k]; n=2; nm1=n-1; cp=n^p-nm1^p; While[ !PrimeQ[cp], n=n+1; nm1=n-1; cp=n^p-nm1^p]; Print[n], {k, 1, 200}]

Formula

a(n) = A222119(n) + 1. - Ray Chandler, Feb 26 2017

A237114 Smallest semiprime of the form k^prime(n)+1, or 0 if no such semiprime exists.

Original entry on oeis.org

10, 9, 33, 129, 2049, 8193, 131073, 524289, 8388609, 21214052113249267732127817825945098816023915043832462900000000000000000000000000001, 2147483649, 356811923176489970264571492362373784095686657, 1821119122882338858450163704901509732674059569636703920027007853793548503164173361298060584748698304513
Offset: 1

Views

Author

Jonathan Sondow, Feb 04 2014

Keywords

Comments

For n > 1, smallest number k^p+1 with both (k^p+1)/(k+1) and k+1 prime, where p = prime(n); the corresponding primes (k^p+1)/(k+1) for n > 1 are A237116(n) = 3, 11, 43, 683, 2731, 43691, 174763, 2796203, ... and the corresponding primes k+1 are A237115(n) = 3, 3, 3, 3, 3, 3, 3, 3, 691, 3, 17, ... .
a(n) == its smaller prime factor A237115(n) (mod prime(n)). Proof: 10 == 2 (mod 2), so true for n=1. For n>1, true by Fermat's little theorem: k^p+1 == k+1 (mod p).
a(n) is in A006881 (squarefree semiprimes), except for a(2) = 9 = 3^2. Proof: True for n=1. For n>1, if k^p+1 = (k+1)^2, then k^(p-1) = k+2, so k*(k^(p-2)-1) = 2. Now k>1 implies k=2 and p=3, so that n=2.
It appears that a(n) mod p > 0 for all n > 2 (see A237117), where p = prime(n). If true, then the larger prime factor A237116(n) of a(n) is == 1 (mod p), since a(n) == its smaller prime factor (mod p).

Examples

			Prime(1)=2 and the smallest semiprime of the form k^2+1 is a(1) = 3^2+1 = 10 = 2*5.
Prime(2)=3 and the smallest semiprime of the form k^3+1 is a(2) = 2^3+1 = 9 = 3*3.
		

Crossrefs

Programs

  • Mathematica
    L = {10}; Do[p = Prime[k]; n = 1; q = Prime[n] - 1; cp = (q^p + 1)/(q + 1); While[! PrimeQ[cp], n = n + 1; q = Prime[n] - 1; cp = (q^p + 1)/(q + 1)]; L = Append[L, q^p + 1], {k, 2, 12}]; L

Formula

a(n) = A237115(n)*A237116(n), for n > 0.
a(n) = (A237115(n)-1)^prime(n)+1, for n > 1.
a(n) == A237115(n) (mod prime(n)), for n > 0.
a(n) mod prime(n) = A237117(n), if a(n) > 0.

A237115 Lesser prime factor of the smallest semiprime of the form k^prime(n)+1, or 0 if no such semiprime exists.

Original entry on oeis.org

2, 3, 3, 3, 3, 3, 3, 3, 3, 691, 3, 17, 313, 3, 7, 11, 7, 3, 11, 47, 19, 3, 1499, 17, 71, 3, 97, 7, 13, 823, 3, 97, 1163, 31, 17, 199, 1907, 53, 3, 17, 1231, 1013, 3, 13, 53, 3, 67, 47, 23, 1013, 787, 127, 347, 17, 37, 97, 683, 631, 73, 4549, 173, 11, 17, 1039, 3, 17, 47, 6389, 3, 461, 23, 673, 37, 29, 331, 7451, 1433, 4561
Offset: 1

Views

Author

Jonathan Sondow, Feb 04 2014

Keywords

Comments

For n > 1, smallest prime p such that ((p-1)^prime(n)+1)/p is prime; the corresponding primes ((p-1)^prime(n)+1)/p are A237116(n) = 3, 11, 43, 683, 2731, 43691, 174763, 2796203, ... and the corresponding semiprimes (p-1)^prime(n)+1 are A237114(n) = 9, 33, 129, 2049, 8193, 131073, 524289, 8388609, ... .

Examples

			Prime(1)=2 and the smallest semiprime of the form k^2+1 is 3^2+1 = 10 = 2*5, so a(1) = 2.
Prime(2)=3 and the smallest semiprime of the form k^3+1 is 2^3+1 = 9 = 3*3, so a(2) = 3.
		

Crossrefs

Programs

  • Mathematica
    L = {2}; Do[p = Prime[k]; n = 1; q = Prime[n] - 1; cp = (q^p + 1)/(q + 1); While[! PrimeQ[cp], n = n + 1; q = Prime[n] - 1; cp = (q^p + 1)/(q + 1)]; L = Append[L, q + 1], {k, 2, 78}]; L

Formula

a(n) = A237114(n)/A237116(n), for n > 0.
(a(n)-1)^prime(n) = A237114(n)-1, for n > 1.
a(n) == A237114(n) (mod prime(n)) (for a proof, see A237114).
a(n) mod prime(n) = A237117(n), if a(n) > 0.

A237116 Larger prime factor of the smallest semiprime of the form k^prime(n)+1, or 0 if no such semiprime exists.

Original entry on oeis.org

5, 3, 11, 43, 683, 2731, 43691, 174763, 2796203, 30700509570548867919143006984001590182379037690061451374819102749638205499276411, 715827883, 20988936657440586486151264256610222593863921, 5818271958090539483866337715340286685859615238455923067178938830011337070812055467405944360219483401
Offset: 1

Views

Author

Jonathan Sondow, Feb 05 2014

Keywords

Comments

For n > 1, smallest prime of the form ((p-1)^prime(n)+1)/p, where p is prime; the corresponding primes p are A237115(n) = 3, 3, 3, 3, 3, 3, 3, 3, 691, 3, 17, ... and the corresponding semiprimes (p-1)^prime(n)+1 are A237114(n) = 9, 33, 129, 2049, 8193, 131073, 524289, 8388609, ... .
It appears that a(n) == 1 (mod prime(n)), for all n <> 2. See 4th comment in A237114.

Examples

			Prime(1)=2 and the smallest semiprime of the form k^2+1 is 3^2+1 = 10 = 2*5, so a(1) = 5.
Prime(2)=3 and the smallest semiprime of the form k^3+1 is 2^3+1 = 9 = 3*3, so a(2) = 3.
		

Crossrefs

Programs

  • Mathematica
    L = {5}; Do[p = Prime[k]; n = 1; q = Prime[n] - 1; cp = (q^p + 1)/(q + 1); While[! PrimeQ[cp], n = n + 1; q = Prime[n] - 1; cp = (q^p + 1)/(q + 1)]; L = Append[L, cp], {k, 2, 13}]; L

Formula

a(n) = A237114(n)/A237115(n), for n > 0.
a(n) = ((A237115(n)-1)^prime(n)+1)/A237115(n), for n > 1.

A237117 Remainder mod p of the smallest semiprime of the form k^p+1, where p = prime(n); or -1 if no such semiprime exists.

Original entry on oeis.org

0, 0, 3, 3, 3, 3, 3, 3, 3, 24, 3, 17, 26, 3, 7, 11, 7, 3, 11, 47, 19, 3, 5, 17, 71, 3, 97, 7, 13, 32, 3, 97, 67, 31, 17, 48, 23, 53, 3, 17, 157, 108, 3, 13, 53, 3, 67, 47, 23, 97, 88, 127, 106, 17, 37, 97, 145, 89, 73, 53, 173, 11, 17, 106, 3, 17, 47, 323, 3, 112, 23, 314, 37, 29, 331, 174, 266, 194, 226, 397, 29, 16, 176, 45, 44, 152, 373, 349, 101, 143, 53, 386, 133, 29, 345, 1
Offset: 1

Views

Author

Jonathan Sondow, Feb 06 2014

Keywords

Comments

It appears that a(n) > 0 for all n > 2. See the comments in A237114.

Examples

			Prime(2)=3 and the smallest semiprime of the form k^3+1 is 2^3+1 = 9 = 3*3, so a(2) = 9 mod 3 = 0.
Prime(3)=5 and the smallest semiprime of the form k^5+1 is 2^5+1 = 33 = 3*11, so a(3) = 33 mod 5 = 3.
		

Crossrefs

Programs

  • Mathematica
    L = {0}; Do[p = Prime[k]; n = 1; q = Prime[n] - 1; cp = (q^p + 1)/(q + 1); While[! PrimeQ[cp], n = n + 1; q = Prime[n] - 1; cp = (q^p + 1)/(q + 1)]; L = Append[L, Mod[q^p + 1, p]], {k, 2, 87}]; L

Formula

a(n) = A237114(n) mod prime(n) = A237115(n) mod prime(n), if A237114(n)>0.
Showing 1-10 of 11 results. Next