%I #38 Oct 08 2024 06:26:34
%S 1,31,8191
%N Numbers that are repunits in four or more bases.
%C Except for first term, numbers which can be represented as a string of three or more 1's in a base >=2 in more than one way; subset of A053696.
%C No more terms less than 2^44 = 17592186044416. - _Ray Chandler_, Jun 08 2006
%C Let the 4-tuple (a,b,m,n) be a solution to the exponential Diophantine equation (a^m-1)/(a-1)=(b^n-1)/(b-1) with a>1, b>a, m>2 and n>2. Then (a^m-1)/(a-1) is in this sequence. The terms 31 and 8191 correspond to the solutions (2,5,5,3) and (2,90,13,3), respectively. No other solutions with n=3 and b<10^5. The Mathematica code finds repunits in increasing order and prints solutions. - _T. D. Noe_, Jun 07 2006
%C Following the Goormaghtigh conjecture (Links), 31 and 8191 which are both Mersenne numbers, are the only primes which are Brazilian in two different bases. - _Bernard Schott_, Jun 25 2013
%H Y. Bugeaud and T. N. Shorey, <a href="http://msp.org/pjm/2002/207-1/p04.xhtml">On the diophantine equation (x^m - 1)/(x-1) = (y^n - 1)/(y-1)</a>, Pacific Journal of Mathematics 207:1 (2002), pp. 61-75.
%H Jon Grantham, <a href="https://arxiv.org/abs/2410.03677">No new Goormaghtigh primes up to 10^700</a>, arXiv:2410.03677 [math.NT], 2024.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Repunit.html">Repunit</a>
%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Goormaghtigh_conjecture">Goormaghtigh conjecture</a>
%e a(1)=1 is a repunit in every base. a(2)=31 is a repunit in bases 1, 2, 5 and 30. a(3)=8191 is a repunit in bases 1, 2, 90 and 8190.
%e 31 and 8191 are Brazilian numbers in two different bases:
%e 31 = 11111_2 = 111_5,
%e 8191 = 1111111111111_2 = 111_90.
%t fQ[n_] := Block[{d = Rest@Divisors[n - 1]}, Length@d > 2 && Length@Select[IntegerDigits[n, d], Union@# == {1} &] > 2]; Do[ If[ fQ@n, Print@n], {n, 10^8/3}] (* _Robert G. Wilson v_ *)
%t nn=1000; pow=Table[3, {nn}]; t=Table[If[n==1, Infinity, (n^3-1)/(n-1)], {n,nn}]; While[pos=Flatten[Position[t,Min[t]]]; !MemberQ[pos,nn], If[Length[pos]>1, Print[{pos,pow[[pos]],t[[pos[[1]]]]}]]; Do[n=pos[[i]]; pow[[n]]++; t[[n]]=(n^pow[[n]]-1)/(n-1), {i,Length[pos]}]] (* _T. D. Noe_, Jun 07 2006 *)
%o (Python)
%o def isrep(n, b):
%o while n >= b:
%o n, r = divmod(n, b)
%o if r != 1: return False
%o return n == 1
%o def agen():
%o yield 1
%o n = 2
%o while True:
%o reps = 2 # n is a repunit in bases 1 and n-1
%o for b in range(2, n-1):
%o if isrep(n, b): reps += 1
%o if reps == 4: yield n; break
%o n += 1
%o for m in agen(): print(m) # _Michael S. Branicky_, Jan 31 2021
%Y Cf. A002275, A053696, A055129, A088323.
%Y Cf. A053696 (numbers of the form (b^k-1)/(b-1)).
%Y Cf. A145461: bases 5 and 90 are 2 exceptions (Goormaghtigh's conjecture).
%Y Cf. A085104 (Brazilian primes).
%K base,hard,more,nonn,bref
%O 1,2
%A _Sergio Pimentel_, Jun 01 2006
%E Edited by _Ray Chandler_, Jun 08 2006