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

A360738 a(n) = A084740(n) - 1.

Original entry on oeis.org

1, 1, 2, 1, 2, 1, 4, 2, -1, 1, 16, 1, 4, 2, 2, 1, 2, 1, 18, 2, 2, 1, 4, 2, -1, 6, 2, 1, 4, 1, 6, -1, 2, 12, 312, 1, 12, 2, 348, 1, 2, 1, 4, 4, 18, 1, 126, 18, -1, 2, 4228, 1, 10, 2, 16, 6, 2, 1, 2, 1, 6, 2, 4, -1, 18, 1, 18, 4, 2, 1, 2, 1, 4, 4, 2, 40, 2, 1, 4, 2, -1, 1, 4, 16, 4, 10, 6, 1, 2, 2, 4420
Offset: 1

Views

Author

Ya-Ping Lu, Feb 18 2023

Keywords

Comments

a(n) is the smallest k such that 1 + n + n^2 + ... + n^k is a prime. a(n) = -1 if no such k exists.
From Jon E. Schoenfield, Feb 22 2023: (Start)
Let s(n,k) = Sum_{j=0..k} n^j. Then if k+1 is not a prime, s(n,k) is divisible by s(n,j) for some positive j < k, so s(n,k) is not a prime.
Additionally, if n = 2^d (for d >= 1), then if k+1 is a prime, s(n,k) is usually divisible by 2^(k+1)-1. For d <= 16, it seems that the only exceptions are s(4,1) = 5, s(8,2) = 73, s(16,1) = 17, s(32,4) = 601*1801, s(64,1) = 5*13, s(64,2) = 3*19*73, s(128,6) = 4432676798593, s(256,1) = 257, s(512,2) = 262657, s(1024,1) = 5^2*41, s(1024,4) = 251*601*1801*4051, s(2048,10) = 727*p31, s(4096,1) = 17*241, s(4096,2) = 3*19*37*73*109, s(8192,12) = 4057*6740339310641*p31, s(16384,1) = 5*29*113, s(16384,6) = 4363953127297*4432676798593, s(32768,2) = 73*631*23311, s(32768,4) = 601*1801*100801*10567201, s(65536,1) = 65537, and s(131072,16) = 12761663*179058312604392742511009*p52.
So a(32) = -1 because the sum s(32,k) is not prime for any k:
for each k such that k+1 is not a prime, s(32,k) is divisible by s(32,j) for some positive j < k;
for each k such that k+1 is a prime except for k=4, s(32,k) is divisible by 2^(k+1)-1; and
s(32,4) = 601*1801 is a nonprime.
Similarly, a(64) = -1 because the sum s(64,k) is not prime for any k:
for each k such that k+1 is not a prime, s(64,k) is divisible by s(64,j) for some positive j < k;
for each k such that k+1 is a prime except for k=1 and k=2, s(64,k) is divisible by 2^(k+1)-1; and
s(64,1) = 5*13 and s(64,2) = 3*19*73 are nonprime. (End)

Crossrefs

Cf. A084740.

Programs

  • PARI
    a(n, lim=oo)=if((issquare(n)&&n%2==1&&n>1)||n==32||n==64, -1, my(s=1); for(k=1, lim, s+=n^k; if(ispseudoprime(s), return(k)) ); oo) \\ Andrew Howroyd, Feb 22 2023

Formula

a((2m+1)^2) = -1 for m >= 1.

Extensions

a(32)-a(79) from Jon E. Schoenfield, Feb 21 2023
a(80)-a(91) from Andrew Howroyd, Feb 22 2023

A000978 Wagstaff numbers: numbers k such that (2^k + 1)/3 is prime.

Original entry on oeis.org

3, 5, 7, 11, 13, 17, 19, 23, 31, 43, 61, 79, 101, 127, 167, 191, 199, 313, 347, 701, 1709, 2617, 3539, 5807, 10501, 10691, 11279, 12391, 14479, 42737, 83339, 95369, 117239, 127031, 138937, 141079, 267017, 269987, 374321, 986191, 4031399
Offset: 1

Views

Author

Keywords

Comments

It is easy to see that the definition implies that k must be an odd prime. - N. J. A. Sloane, Oct 06 2006
The terms from a(32) on only give probable primes as of 2018. Caldwell lists the largest certified primes. - Jens Kruse Andersen, Jan 10 2018
Prime numbers of the form 1+Sum_{i=1..m} 2^(2i-1). - Artur Jasinski, Feb 09 2007
There is a new conjecture stating that a Wagstaff number is prime under the following condition (based on DiGraph cycles under the LLT): Let p be a prime integer > 3, N(p) = 2^p+1 and W(p) = N(p)/3, S(0) = 3/2 (or 1/4) and S(i+1) = S(i)^2 - 2 (mod N(p)). Then W(p) is prime iff S(p-1) == S(0) (mod W(p)). - Tony Reix, Sep 03 2007
As a member of the DUR team (Diepeveen, Underwood, Reix), and thanks to the LLR tool built by Jean Penne, I've found a new and big Wagstaff PRP: (2^4031399+1)/3 is Vrba-Reix PRP! This Wagstaff number has 1,213,572 digits and today is the 3rd biggest PRP ever found. I've done a second verification on a Nehalem core with the PFGW tool. - Tony Reix, Feb 20 2010
13347311 and 13372531 were found to be terms of this sequence (maybe not the next ones) by Ryan Propper in September 2013. - Max Alekseyev, Oct 07 2013
The next term is larger than 10 million. - Gord Palameta, Mar 22 2019
Ryan Propper found another likely term, 15135397, though it only corresponds to a probable prime. - Charles R Greathouse IV, Jul 01 2021

References

  • J. Brillhart et al., Factorizations of b^n +- 1. Contemporary Mathematics, Vol. 22, Amer. Math. Soc., Providence, RI, 2nd edition, 1985; and later supplements.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • S. S. Wagstaff, Jr., personal communication.

Crossrefs

Cf. A107036 (indices of prime Jacobsthal numbers).

Programs

  • Haskell
    a000978 n = a000978_list !! (n-1)
    a000978_list = filter ((== 1) . a010051 . a001045) a065091_list
    -- Reinhard Zumkeller, Mar 24 2013
    
  • Mathematica
    Select[Range[5000], PrimeQ[(2^# + 1)/3] &] (* Michael De Vlieger, Jan 10 2018 *)
    Select[Prime[Range[2,500]],PrimeQ[(2^#+1)/3]&] (* Harvey P. Dale, Jun 13 2022 *)
  • PARI
    forprime(p=2,5000,if(ispseudoprime(2^p\/3),print1(p", "))) \\ Charles R Greathouse IV, Jul 15 2011
    
  • Python
    from gmpy2 import divexact
    from sympy import prime, isprime
    A000978 = [p for p in (prime(n) for n in range(2,10**2)) if isprime(divexact(2**p+1,3))] # Chai Wah Wu, Sep 04 2014

Formula

a(n) = A107036(n) for n>1. - Alexander Adamchuk, Feb 10 2007

Extensions

a(30) from Kamil Duszenko (kdusz(AT)wp.pl), Feb 03 2003; a(30) was proved prime by Francois Morain with FastECPP. - Tony Reix, Sep 03 2007
a(31)-a(39) from Robert G. Wilson v, Apr 11 2005
a(40) from Vincent Diepeveen (diep(AT)xs4all.nl) added by Alexander Adamchuk, Jun 19 2008
a(41) from Tony Reix, Feb 20 2010

A057171 Numbers n such that (5^n+1)/6 is a prime.

Original entry on oeis.org

5, 67, 101, 103, 229, 347, 4013, 23297, 30133, 177337, 193939, 266863, 277183, 335429, 1856147
Offset: 1

Views

Author

N. J. A. Sloane, Sep 15 2000

Keywords

Comments

With the discovery of a(15), the best fit line slope G=0.55167 (see link to Generalized Repunit Conjecture). This sequence is converging nicely to the conjectured slope G=0.56145948. - Paul Bourdelais, Feb 26 2019

Programs

  • Mathematica
    a={};Do[x=(5^n+1)/6;If[PrimeQ[x],AppendTo[a,n]],{n,0,12^2}];a (* Vladimir Joseph Stephan Orlovsky, Apr 29 2008 *)
    Select[Range[40000],PrimeQ[(5^#+1)/6]&] (* The program generates the first 9 terms of the sequence. *) (* Harvey P. Dale, Dec 28 2024 *)
  • PARI
    isok(n) = (denominator(p=(5^n+1)/6) == 1) && isprime(p); \\ Michel Marcus, Oct 28 2017

Extensions

More terms from Kamil Duszenko (kdusz(AT)wp.pl), Jun 23 2003
30133 from Herman Jamke (hermanjamke(AT)fastmail.fm), Jan 05 2008
a(10) discovered 10/29/08 is a probable prime based on trial factoring to 3.5e13 and Fermat testing base 2. - Paul Bourdelais, Nov 04 2008
a(11)=193939 from Paul Bourdelais discovered 12/24/08 is a probable prime based on trial factoring to 4e13 and Fermat primality testing base 2. - Paul Bourdelais, Dec 24 2008
a(12)=266863 is a probable prime discovered by Paul Bourdelais, Jul 09 2010
a(13)=277183 is a probable prime discovered by Paul Bourdelais, Jul 16 2010
a(14)=335429 is a probable prime discovered by Paul Bourdelais, Aug 23 2010
a(15)=1856147 corresponds to a probable prime discovered by Paul Bourdelais, Feb 26 2019

A007658 Numbers k such that (3^k + 1)/4 is prime.

Original entry on oeis.org

3, 5, 7, 13, 23, 43, 281, 359, 487, 577, 1579, 1663, 1741, 3191, 9209, 11257, 12743, 13093, 17027, 26633, 104243, 134227, 152287, 700897, 1205459, 1896463, 2533963, 2674381, 7034611
Offset: 1

Views

Author

Keywords

Comments

Prime repunits in base -3.

References

  • J. Brillhart et al., Factorizations of b^n +- 1. Contemporary Mathematics, Vol. 22, Amer. Math. Soc., Providence, RI, 2nd edition, 1985; and later supplements.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Programs

Extensions

a(20) from Robert G. Wilson v, Apr 11 2005
a(22) from Paul Bourdelais, Nov 08 2007
a(23) from Paul Bourdelais, Apr 07 2008
a(24) from Paul Bourdelais, Apr 05 2010
a(25) from Paul Bourdelais, Aug 28 2015
a(26) from Paul Bourdelais, Jan 30 2020
a(27) from Paul Bourdelais, Mar 06 2020
a(28) from Paul Bourdelais, Mar 22 2024
a(29) from Paul Bourdelais, Dec 04 2024

A001562 Numbers n such that (10^n + 1)/11 is a prime.

Original entry on oeis.org

5, 7, 19, 31, 53, 67, 293, 641, 2137, 3011, 268207, 1600787
Offset: 1

Views

Author

Keywords

Comments

The a(10) to a(11) gap represents the largest relative gap seen so far in searching repunits with bases between -12 and 12. On average, there should have been 4 more primes added to this sequence by a(11), instead of just 1. - Paul Bourdelais, Feb 11 2010

References

  • J. Brillhart et al., Factorizations of b^n +- 1. Contemporary Mathematics, Vol. 22, Amer. Math. Soc., Providence, RI, 2nd edition, 1985; and later supplements.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Equals 2*A054416 + 1.
Odd terms of A309358.

Programs

  • Mathematica
    Select[Range[3000], PrimeQ[(10^# + 1) / 11] &] (* Vincenzo Librandi, Oct 29 2017 *)
  • PARI
    isok(n) = (denominator(p=(10^n+1)/11)==1) && isprime(p); \\ Michel Marcus, Oct 29 2017

Extensions

a(11) corresponds to a probable prime discovered by Paul Bourdelais, Feb 11 2010
a(12) corresponds to a probable prime discovered by Paul Bourdelais, May 04 2020

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

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

Original entry on oeis.org

3, 7, 13, 521, 31, 43, 0, 73, 9091, 13421, 19141, 157, 7027567, 211, 241, 22796593, 307, 274019342889240109297, 152381, 421, 463, 39700406579747, 183458857, 601, 135938684703251, 0, 757, 574995877
Offset: 2

Views

Author

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

Keywords

Comments

When n is a power (greater than 2) of a prime, then (n^k+1)/(n+1) will usually be composite for all k, which is the case for n = 8, 27, 32, 64, 125. The next term, a(30), is a 204-digit number. - T. D. Noe, Jan 22 2004

Examples

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

Crossrefs

Cf. A084742 (least k such that (n^k+1)/(n+1) is prime).

Extensions

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

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

A084738 Smallest prime of the form (n^k-1)/(n-1), or 0 if no such prime exists.

Original entry on oeis.org

3, 13, 5, 31, 7, 2801, 73, 0, 11, 50544702849929377, 13, 30941, 211, 241, 17, 307, 19, 109912203092239643840221, 421, 463, 23, 292561, 601, 0, 321272407, 757, 29, 732541, 31, 917087137, 0, 1123, 2458736461986831391
Offset: 2

Views

Author

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

Keywords

Comments

As mentioned by Dubner, when n is a power (greater than 1) of a prime, then (n^k-1)/(n-1) will usually be composite for all k, which is the case for n = 9, 25, 32 and 49. - T. D. Noe, Jan 23 2004
Here, a(n) is the smallest prime of the form (n^k-1)/(n-1) with k >= 2 while in A285642 it is the smallest prime with k > 2. Differences occur when (n^2-1)/(n-1) = n+1 is prime, and therefore, when n = prime(m) - 1 is in A006093 (see formula). - Bernard Schott, Mar 16 2023

Examples

			a(8) = 73 = (8^3-1)/(8-1).
		

Crossrefs

Cf. A076481.
Cf. A084740 (least k such that (n^k-1)/(n-1) is prime).

Programs

  • Mathematica
    Table[SelectFirst[(n^# - 1)/(n - 1) & /@ Range[10^3], PrimeQ] /. k_ /; MissingQ@ k -> 0, {n, 2, 34}] (* Michael De Vlieger, Apr 24 2017, Version 10.2 *)

Formula

a(A006093(n)) = prime(n) for n >=2. - Bernard Schott, Mar 16 2023

Extensions

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

A065854 Smallest prime q such that (p^q-1)/(p-1) is a prime, where p = prime(n).

Original entry on oeis.org

2, 3, 3, 5, 17, 5, 3, 19, 5, 5, 7, 13, 3, 5, 127, 11, 3, 7, 19, 3, 5, 5, 5, 3, 17, 3, 19, 17, 17, 23, 5, 3, 11, 163, 7, 13, 17, 7, 3, 3, 19, 17, 17, 5, 31, 577, 41, 239, 5, 11, 113, 5, 17, 7, 23, 5
Offset: 1

Views

Author

Vladeta Jovovic, Nov 26 2001

Keywords

Comments

a(n) = 2*A065813(n) + 1, n > 1.

Crossrefs

Cf. A084740 (least k such that (n^k-1)/(n-1) is prime).

Programs

  • Mathematica
    Do[p = Prime[n]; k = 1; While[ !PrimeQ[ (p^Prime[k] - 1)/(p - 1)], k++ ]; Print[ Prime[k]], {n, 1, 56} ]
    Table[Module[{q=2},While[!PrimeQ[(p^q-1)/(p-1)],q=NextPrime[q]];q],{p,Prime[Range[60]]}] (* Harvey P. Dale, Aug 05 2025 *)
  • PARI
    { allocatemem(932245000); for (n=1, 100, p=prime(n); q=2; while (!isprime((p^q - 1)/(p - 1)), q=nextprime(q + 1)); write("b065854.txt", n, " ", q) ) } \\ Harry J. Smith, Nov 01 2009
Showing 1-10 of 15 results. Next