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

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

A325659 Smallest Brazilian composite in base n >= 2 which can be represented as a string of three or more 1's in this base.

Original entry on oeis.org

15, 40, 21, 156, 259, 57, 585, 91, 111, 133, 1885, 183, 2955, 3616, 273, 5220, 343, 381, 8421, 9724, 507, 553, 14425, 651, 703, 20440, 813, 871, 931, 993, 1057, 37060, 1191, 1261, 1333, 1407, 56355, 1561, 1641, 70644, 1807, 1893, 1981, 2071, 2163, 2257, 2353, 2451, 127551
Offset: 2

Views

Author

Bernard Schott, May 12 2019

Keywords

Comments

Also the smallest Brazilian composite of the form (n^k - 1)/(n - 1) with k > 2.
For Mersenne numbers = (11...11)_2 = 2^k-1 in A000225, there is a smaller integer which is Brazilian prime: 7, so 7 is the first term of A285642 and another one is the smaller composite 15, so 15 is the first term of this sequence.
For numbers (11...11)_3 = (3^k-1)/2 in A003462, there is also a smaller integer which is Brazilian prime:13, so 13 is the second term of A285642 and another one is the smaller Brazilian composite: 40, so 40 is the second term of this sequence.
For numbers like (11...11)_4 = (4^k-1)/3, the terms are respectively 0 in A285642 because there is no Brazilian prime of this type and 21 for composite numbers of this sequence, and so on.

Examples

			15 = (1111)_2, 40 = (1111)_3, 21 = (111)_4, 156 = (1111)_5.
		

Crossrefs

Subsequence of A053696, A220571, A325658.
Cf. A285642 (same with Brazilian primes).

Programs

  • PARI
    a(n) = {my(k=4, x); while (isprime(x=(n^(k-1)-1)/(n-1)), k++); x;} \\ Michel Marcus, May 17 2019

Extensions

More terms from Michel Marcus, May 17 2019
Showing 1-3 of 3 results.