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

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

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

A074386 Numbers k such that sigma(k) is the square of a prime.

Original entry on oeis.org

3, 81, 400
Offset: 1

Views

Author

Labos Elemer, Aug 22 2002

Keywords

Comments

The next term, if it exists, is > 10^11. - Donovan Johnson, Aug 24 2012
a(4), if it exists, satisfies sigma(a(4)) > 10^36. - Hiroaki Yamanouchi, Sep 10 2014
If n belongs to this sequence, it may have at most two distinct prime divisors. If n=p^k, then sigma(p^k) = (p^(k+1)-1)/(p-1) = r^2 for some prime r. For k=1, it trivially has the only solution n=3; while for k>1 it is a partial case of the Nagell-Ljunggren equation and has the only prime solution r=11 (see Bennett-Levin 2015) corresponding to n=3^4=81. If n=p^k*q^m, then sigma(n) = (p^(k+1)-1)/(p-1) * (q^(m+1)-1)/(q-1) = r^2 for some prime r, implying that (p^(k+1)-1)/(p-1) = (q^(m+1)-1)/(q-1) = r. Here k+1 and m+1 must be odd distinct primes. The Goormaghtigh conjecture would imply that its only solution is n=400 with (p,k,q,m)=(5,2,2,4). - Max Alekseyev, Apr 24 2015

Examples

			sigma[{3,81,400}]={4,121,961}.
		

Crossrefs

Programs

  • Mathematica
    Do[s=DivisorSigma[1, n]; If[PrimeQ[Sqrt[s]], Print[n]], {n, 1, 1000000}] (* Corrected by N. J. A. Sloane, May 26 2008 *)

Extensions

Definition corrected by Juan Lopez, May 26 2008
Edited by N. J. A. Sloane, May 26 2008

A285642 Smallest Brazilian prime in base n, or 0 if no such prime exists.

Original entry on oeis.org

7, 13, 0, 31, 43, 2801, 73, 0, 1111111111111111111, 50544702849929377, 157, 30941, 211, 241, 0, 307
Offset: 2

Views

Author

Bernard Schott, Apr 23 2017

Keywords

Comments

Also the smallest prime of the form (n^k - 1)/(n - 1) with k > 2. The corresponding values of k are in A128164.
For n = 18, a(n) = (18^25667 - 1)/17 as explained in the extension of A128164, but it is too large to write in the Data field.
Differs from A084738: in A084738, the primes of the form (n^2 - 1)/(n - 1) = n + 1 are included, for instance 7 = 6 + 1 = 11_6 but not included here, so a(6) = 43 = 111_6.
As mentioned by Dubner, see link, when n is a power of a prime ( >= 2 ), the number (n^k - 1)/(n - 1) with k > 2 is usually composite, so a(4) = a(9) = a(16) = a(25) = 0 for instance, exception a(8) = 73.
Values of a(19)-a(31): {109912203092239643840221, 421, 463, 245411, 292561, 601, 0, 321272407, 757, 637421, 732541, 837931, 917087137}. - Michael De Vlieger, Apr 24 2017

Examples

			a(7) = (7^5 - 1)/6 = 11111_7 =  1 + 7 + 7^2 + 7^3 + 7^4 = 2801.
a(10) is the repunit R_19 which is a string of nineteen 1's.
		

Crossrefs

Programs

  • Mathematica
    Table[Function[m, If[m > 0, k = 3; While[! PrimeQ[Set[x, (m^k - 1)/(m - 1)]], k++]; x, 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 *)

A126589 Numbers n>1 such that prime of the form (n^k-1)/(n-1) does not exist for k>2; or A128164(n) = 0.

Original entry on oeis.org

4, 9, 16, 25, 32, 36, 49, 64, 81, 100, 121, 125, 144, 169, 196, 216, 225, 243, 256, 289, 324, 343, 361, 400, 441, 484, 529, 576, 625, 676, 729, 784, 841, 900, 961, 1000, 1024, 1089, 1156, 1225, 1296, 1369, 1444, 1521, 1600, 1681, 1728, 1764, 1849, 1936, 2025
Offset: 1

Views

Author

Alexander Adamchuk, Mar 13 2007

Keywords

Comments

Appears to be the union of the perfect squares k^2 (for k>1) and the prime powers p^k (for k>1) with some exceptions, such as 2^3, 3^3, 2^7, etc.
The perfect powers except those of the form n^(p^m) where p and (n^(p^(m+1))-1)/(n^(p^m)-1) are primes, p>2 and m>=1. - Max Alekseyev, Mar 09 2009

Examples

			A128164 begins with offset 2: {3, 3, 0, 3, 3, 5, 3, 0, 19, 17, 3, 5, 3, 3, 0, 3, ...}. Thus a(1) = 4, a(2) = 9, a(3) = 16.
		

Crossrefs

Extensions

Extended by Max Alekseyev, Mar 09 2009

A096059 Numbers n such that for all k, (n^k-1)/(n-1) is not prime.

Original entry on oeis.org

9, 25, 32, 49, 64, 81, 121, 125, 144
Offset: 1

Views

Author

Amarnath Murthy, Jun 17 2004

Keywords

Comments

Indices of 0 in A084740.
Possibly a subset of A001597.
The first unknown value is n=152, checked up to k = prime(1100). - Derek Orr, Nov 29 2014
It is known 169, 216, 225, 243, 289, 324, 343 are also members of this sequence. - Derek Orr, Nov 29 2014

Crossrefs

Extensions

Edited by Don Reble, Mar 19 2007

A326609 Largest minimal prime in base n (written in base 10).

Original entry on oeis.org

3, 13, 5, 3121, 5209, 2801, 76695841, 811, 66600049, 29156193474041220857161146715104735751776055777, 388177921
Offset: 2

Views

Author

Richard N. Smith, Jul 13 2019

Keywords

Comments

a(13) is (probably) 13^32020*8+183, it has 35670 digits, a(14) = 14^85*4+65, it has 99 digits, a(15) = (15^106*66-619)/7, it has 126 digits, a(16) = 16^3544*9+145, it has 4269 digits.
a(17) is the smallest prime of the form (4105*17^k-9)/16 if it exists, otherwise (probably) (73*17^111333-9)/16 (136991 digits), a(18) = 18^31*304+1 (42 digits).
Other known terms: a(20) = (20^449*16-2809)/19 (585 digits), a(22) = 22^763*20+7041 (1026 digits), a(23) is (probably) (23^800873*106-7)/11 (1090573 digits), a(24) = (24^99*512-121)/23 (138 digits), a(30) = 30^1023*12+1 (1513 digits), a(42) = (42^487*27-1093)/41 (791 digits).
a(19) is the smallest prime of the form (15964*19^k-1)/3 if it exists, otherwise (probably) (904*19^110984-1)/3 (141924 digits), a(21) is the smallest prime of the form 16*21^k+335 if it exists, otherwise (probably) (51*21^479149-1243)/4 (633542 digits).

Crossrefs

Cf. A071062 (base 10 minimal primes), A110600 (base 12 minimal primes).
Cf. A293142 (largest non-repunit permutable prime), A317689 (largest non-repunit circular prime), A103443 (largest left-truncatable prime), A023107 (largest right-truncatable prime), A323137 (largest two-sided prime), A084738 (smallest repunit prime), A186995 (smallest weakly prime).

A347821 Smallest prime p such that n*p+1 is a perfect power, or 0 if no such p exists.

Original entry on oeis.org

3, 13, 5, 2, 3, 2801, 5, 3, 7, 50544702849929377, 13, 2, 2, 241, 13, 3, 19, 19, 17, 463, 3, 11, 89, 2, 23, 757, 29, 732541, 31, 917087137, 29, 7, 3
Offset: 1

Views

Author

Eric Chen, Sep 25 2021

Keywords

Comments

For every n, all sufficiently large primes p such that n*p+1 is a perfect power are of the form ((n+1)^q-1)/n with q prime.
a(34) = (35^313-1)/34 is too large to include; it has 482 decimal digits.
a(35) - a(37) = {37, 61, 1483}.
a(38) = (39^349-1)/38 is too large to include; it has 554 decimal digits.
a(39) - a(100) = {5, 2, 43, 3500201, 5, 71, 43, 3851, 178481, 11, 47, 3221, 5, 178250690949465223, 2971, 127, 53, 3, 7, 3541, 61, 2, 59, 2, 61, 17, 3, 751410597400064602523400427092397, 21700501, 4831, 7, 19, 73, 5, 7, 5701, 73, 6007, 79, 39449441, 6481, 19, 79, 48037081, 6218272796370530483675222621221, 2, 3, 438668366137, 89, 5, 23, 331, 89, 654022685443, 11, 1001523179, 97, 3, 792806586866086631668831, 9901, 97, 10303}.
If n*p+1 = m^k, then n*p = m^k-1 = (m-1)*(m^(k-1) + m^(k-2) + ... + m + 1). If p >= n, then m^k = n*p+1 >= n^2+1 > n^2, and we have these three cases: Case 1: m-1 > n, then p can't be prime. Case 2: m-1 = n, this is A084738. Case 3: m-1 < n. If gcd(n, m-1) != m-1, then because m^(k-1) + m^(k-2) + ... + m + 1 > n, p can't be prime. This implies m-1 | n. The three cases means that we only need to check p < n and numbers m such that m-1 | n.
The first numbers n such that a(n) = 0 are {124, 215, 224, 242, ...}. a(268) is unknown; it is the smallest prime of the form (269^q - 1)/268 with prime q if such a prime exists (in which case it must be greater than (269^63659-1)/268), otherwise 0.

Crossrefs

Programs

  • PARI
    a(n)=forprime(p=2,2^32,if(ispower(n*p+1),return(p)))
    
  • PARI
    b(n)=forprime(p=2,2^16,if(ispseudoprime(q=((n+1)^p-1)/n),return(q)))
    a(n)=forprime(p=2,2^30,if(ispower(n*p+1),return(p)));b(n) \\ this program might be incorrect beyond a(300)

Formula

a(n) <= A084738(n+1) if A084738(n+1) > 0.
Showing 1-8 of 8 results.