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 12 results. Next

A084731 Duplicate of A066180.

Original entry on oeis.org

2, 2, 2, 2, 5, 2, 2, 2, 10, 6, 2, 61, 14, 15, 5, 24, 19, 2, 46, 3, 11, 22, 41, 2, 12, 22, 3, 2
Offset: 1

Views

Author

Keywords

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).

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

A103795 Minimal base b such that (b^prime(n)+1)/(b+1) is prime.

Original entry on oeis.org

2, 2, 2, 2, 2, 2, 2, 2, 7, 2, 16, 61, 2, 6, 10, 6, 2, 5, 46, 18, 2, 49, 16, 70, 2, 5, 6, 12, 92, 2, 48, 89, 30, 16, 147, 19, 19, 2, 16, 11, 289, 2, 12, 52, 2, 66, 9, 22, 5, 489, 69, 137, 16, 36, 96, 76, 117, 26, 3, 159, 10, 16, 209, 2, 16, 23, 273, 2, 460, 22, 3, 36, 28, 329, 43, 69, 86
Offset: 2

Views

Author

Lei Zhou, Feb 23 2005

Keywords

Comments

Conjecture: sequence is defined for any n>=2.

Examples

			(2^prime(2)+1)/(2+1) = 3 is prime, so a(2)=2;
(2^prime(10)+1)/(2+1) = 178956971 has a factor of 59;
(3^prime(10)+1)/(3+1) = 17157594341221 has a factor of 523;
...
(7^prime(10)+1)/(7+1) = 402488219476647465854701 is prime, so a(10)=7.
		

Crossrefs

Programs

  • Mathematica
    Do[p=Prime[k]; n=2; cp=(n^p+1)/(n+1); While[ !PrimeQ[cp], n=n+1; cp=(n^p+1)/(n+1)]; Print[n], {k, 2, 200}]

Formula

a(n) = A085398(2*prime(n)) for n >= 2. - Jinyuan Wang, Dec 17 2022

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

Original entry on oeis.org

3, 3, 0, 3, 3, 5, 3, 0, 19, 17, 3, 5, 3, 3, 0, 3, 25667, 19, 3, 3, 5, 5, 3, 0, 7, 3, 5, 5, 5, 7, 0, 3, 13, 313, 0, 13, 3, 349, 5, 3, 1319, 5, 5, 19, 7, 127, 19, 0, 3, 4229, 103, 11, 3, 17, 7, 3, 41, 3, 7, 7, 3, 5, 0, 19, 3, 19, 5, 3, 29, 3, 7, 5, 5, 3, 41, 3, 3, 5, 3, 0, 23, 5, 17, 5, 11, 7, 61, 3, 3
Offset: 2

Views

Author

Alexander Adamchuk, Feb 20 2007

Keywords

Comments

a(n) = A084740(n) for all n except n = p-1, where p is an odd prime, for which A084740(n) = 2.
All nonzero terms are odd primes.
a(n) = 0 for n = {4,9,16,25,32,36,49,64,81,100,121,125,144,...}, which are the perfect powers with exceptions of the form n^(p^m) where p>2 and (n^(p^(m+1))-1)/(n^(p^m)-1) are prime and m>=1 (in which case a(n^(p^m))=p). - Max Alekseyev, Jan 24 2009
a(n) = 3 for n in A002384, i.e., for n such that n^2 + n + 1 is prime.
a(152) > 20000. - Eric Chen, Jun 01 2015
a(n) is the least number k such that (n^k - 1)/(n-1) is a Brazilian prime, or 0 if no such Brazilian prime exists. - Bernard Schott, Apr 23 2017
These corresponding Brazilian primes are in A285642. - Bernard Schott, Aug 10 2017
a(152) = 270217, see the top PRP link. - Eric Chen, Jun 04 2018
a(184) = 16703, a(200) = 17807, a(210) = 19819, a(306) = 26407, a(311) = 36497, a(326) = 26713, a(331) = 25033; a(185) > 66337, a(269) > 63659, a(281) > 63421, and there are 48 unknown a(n) for n <= 1024. - Eric Chen, Jun 04 2018
Six more terms found: a(522)=20183, a(570)=12907, a(684)=22573, a(731)=15427, a(820)=12043, a(996)=14629. - Michael Stocker, Apr 09 2020

Examples

			a(7) = 5 because (7^5 - 1)/6 = 2801 = 11111_7 is prime and (7^k - 1)/6 = 1, 8, 57, 400 for k = 1, 2, 3, 4. - _Bernard Schott_, Apr 23 2017
		

Crossrefs

Cf. A002384, A049409, A100330, A162862, A217070-A217089. (numbers b such that (b^p-1)/(b-1) is prime for prime p = 3 to 97)
A126589 gives locations of zeros.

Programs

  • Mathematica
    Table[Function[m, If[m > 0, k = 3; While[! PrimeQ[(m^k - 1)/(m - 1)], k++]; k, 0]]@ If[Set[e, GCD @@ #[[All, -1]]] > 1, {#, IntegerExponent[n, #]} &@ Power[n, 1/e] /. {{k_, m_} /; Or[Not[PrimePowerQ@ m], Prime@ m, FactorInteger[m][[1, 1]] == 2] :> 0, {k_, m_} /; m > 1 :> n}, n] &@ FactorInteger@ n, {n, 2, 17}] (* Michael De Vlieger, Apr 24 2017 *)
  • PARI
    a052409(n) = my(k=ispower(n)); if(k, k, n>1)
    a052410(n) = if (ispower(n, , &r), r, n)
    is(n) = issquare(n) || (ispower(n) && !ispseudoprime((n^a052410(a052409(n))-1)/(n-1)))
    a(n) = if(is(n), 0, forprime(p=3, 2^16, if(ispseudoprime((n^p-1)/(n-1)), return(p)))) \\ Eric Chen, Jun 01 2015, corrected by Eric Chen, Jun 04 2018, after Charles R Greathouse IV in A052409 and Michel Marcus in A052410

Extensions

a(18) = 25667 found by Henri Lifchitz, Sep 26 2007

A123487 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

2, 2, 2, 2, 5, 2, 2, 2, 113, 151, 2, 61, 53, 89, 5, 307, 19, 2, 491, 3, 11, 271, 41, 2, 271, 359, 3, 2, 79, 233, 2, 7, 13, 11, 5, 29, 71, 139, 127, 139, 2003, 5, 743, 673, 593, 383, 653, 661, 251, 6389, 2833, 223, 163, 37, 709, 131, 41, 2203, 941, 2707, 13, 1283, 383
Offset: 1

Views

Author

Alexander Adamchuk, Sep 30 2006, Oct 02 2006

Keywords

Comments

Corresponding primes (q^p-1)/(q-1) are listed in A123488.
a(n) coincides with A066180(n) when A066180(n) is prime or 0.
From Robert G. Wilson v, Dec 28 2016: (Start)
Conjecture: Never is a(n) equal to 0.
Records: 2, 5, 113, 151, 307, 491, 2003, 6389, 7883, 11813, 18587, 31721, 40763, ... ;
First occurrence of the k_th prime: 1, 20, 5, 32, 21, 33, 81, 17, ... ;
Positions where two occurs: 1, 2, 3, 4, 6, 7, 8, 11, 18, 24, 28, 31, 98, 111, ... ;
Positions where three occurs: 20, 27, 100, 182, ... ;
Positions where five occurs: 5, 15, 35, 42, 114, 158, ... ; etc. (End)
Jones & Zvonkin conjecture (as did Robert G. Wilson v above) that a(n) > 0 for all n. - Charles R Greathouse IV, Jul 23 2021

Crossrefs

Programs

  • Mathematica
    f[n_] := NestWhile[NextPrime, 2, ! PrimeQ[Cyclotomic[Prime[n], #]] &]; Array[f, 63](* Davin Park, Dec 28 2016 and Robert G. Wilson v, Dec 28 2016 *)
  • PARI
    a(n) = {my(x = 2); while (!isprime(polcyclo(prime(n), x)), x= nextprime(x+1)); x;} \\ Michel Marcus, Dec 10 2016

A084732 Let p be the n-th prime; Cp(x) be the p-th cyclotomic polynomial (x^p-1)/(x-1); a(n) is the first prime Cp(x) after Cp(1).

Original entry on oeis.org

3, 7, 31, 127, 12207031, 8191, 131071, 524287, 11111111111111111111111, 7369130657357778596659, 2147483647, 19013087418896543607659206142267856546797091624826498592389251997, 7538867501749984216983927242653776257689563451, 26656068987980386414408582952871386493955339704241
Offset: 1

Views

Author

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

Keywords

Examples

			a(5)=12207031 because 11 is the 5th prime; C11(x) is composite for x=2,3,4 and C11(5)=12207031 is prime.
		

Crossrefs

Formula

a(n) = A085399(prime(n)).

Extensions

Edited by Don Reble, Jun 28 2003

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

A123488 Smallest prime of the form (q^p-1)/(q-1), where p = prime(n) and q is also prime (q = A123487(n)).

Original entry on oeis.org

3, 7, 31, 127, 12207031, 8191, 131071, 524287, 1484520425576434196455942238665054573307722183, 10333327940128053377465393536117755205850522803739374960650929
Offset: 1

Views

Author

Alexander Adamchuk, Sep 30 2006

Keywords

Comments

Corresponding smallest primes q are listed in A123487.
a(n) coincides with A084732(n) when A066180(n) is prime or 0.

Crossrefs

Formula

a(n) = (A123487(n)^prime(n) - 1) / (A123487(n) - 1).

A206946 Primes of the form (m^p-1)/(m-1), where abs(m) > 1 and p is an odd prime.

Original entry on oeis.org

3, 7, 11, 13, 31, 43, 61, 73, 127, 157, 211, 241, 307, 421, 463, 521, 547, 601, 683, 757, 1093, 1123, 1483, 1723, 2551, 2731, 2801, 2971, 3307, 3541, 3907, 4423, 4831, 5113, 5701, 6007, 6163, 6481, 8011, 8191, 9091, 9901, 10303, 11131, 12211, 12433, 13421
Offset: 1

Views

Author

Lei Zhou, Feb 28 2012

Keywords

Comments

Old name was: Very generalized repunit prime numbers.
These numbers are prime numbers that can be written in the form of (11...1) base m, with 3 or more ones and |m| > 1.
This sequence is the prime numbers picked from A206943.
Generalized repunit prime numbers are defined in the Caldwell link, as the form of (111...1) base m with numbers of ones >= (1/5)m.
This sequence includes all (111...1) base m primes with m < 1 and number of ones > 2.

Examples

			3 = (111) base -2, so a(1) = 3;
7 = (111) base 2, so a(2) = 7;
11 = (11111) base -2, so a(3) = 11.
31 = (2^5-1)/(2-1) = (5^3-1)/(5-1) = (6^3+1)/(6+1),
43 = (2^7+1)/(2+1) = (7^3+1)/(7+1) = (6^3-1)/(6-1),
8191 = (2^13-1)/(2-1) = (90^3-1)/(90-1) = (91^3+1)/(91+1).
		

Crossrefs

Programs

  • Mathematica
    phiinv[n_, pl_] := Module[{i, p, e, pe, val}, If[pl == {}, Return[If[n == 1, {1}, {}]]]; val = {}; p = Last[pl]; For[e = 0; pe = 1, e == 0 || Mod[n, (p - 1) pe/p] == 0, e++; pe *= p, val = Join[val, pe*phiinv[If[e == 0, n, n*p/pe/(p - 1)], Drop[pl, -1]]]]; Sort[val]]; phiinv[n_] := phiinv[n, Select[1 + Divisors[n], PrimeQ]]; maxdata = 13500; max = Ceiling[(1 + Sqrt[1 + 4*(maxdata - 1)])/4]*2; eb = 2*Floor[(Log[2, maxdata])/2 + 0.5]; While[eg = phiinv[eb]; lu = Length[eg]; lu == 0, eb = eb + 2]; t = Select[Range[eg[[Length[eg]]]], ((EulerPhi[#] <= eb) && (a = FactorInteger[#]; b = Length[a]; (((b == 1) && (a[[1]][[1]] > 2)) || ((b == 2) && (a[[1]][[1]] == 2))))) &]; ap = SortBy[t, Cyclotomic[#, 2] &]; a = {}; Do[i = 0; While[i++; cc = Cyclotomic[ap[[i]], m]; cc <= maxdata, If[PrimeQ[cc], a = Append[a, cc]]], {m, 2, max}]; Union[a]
    nn = 120; ps = Prime[Range[2, PrimePi[Log[2, 2*nn^2 + 1]]]]; t = {}; Do[n = 0; If[Abs[m] > 1, n = (m^p - 1)/(m - 1); If[n > nn^2, n = 0]]; If[PrimeQ[n], AppendTo[t, n]], {p, ps}, {m, -nn, nn}]; t = Union[t] (* T. D. Noe, May 03 2013 *)

Extensions

Better name and new examples by Thomas Ordowski, Apr 28 2013
Showing 1-10 of 12 results. Next