A119598 Numbers that are repunits in four or more bases.
1, 31, 8191
Offset: 1
Examples
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. 31 and 8191 are Brazilian numbers in two different bases: 31 = 11111_2 = 111_5, 8191 = 1111111111111_2 = 111_90.
Links
- Y. Bugeaud and T. N. Shorey, On the diophantine equation (x^m - 1)/(x-1) = (y^n - 1)/(y-1), Pacific Journal of Mathematics 207:1 (2002), pp. 61-75.
- Jon Grantham, No new Goormaghtigh primes up to 10^700, arXiv:2410.03677 [math.NT], 2024.
- Eric Weisstein's World of Mathematics, Repunit
- Wikipedia, Goormaghtigh conjecture
Crossrefs
Programs
-
Mathematica
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 *) 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 *)
-
Python
def isrep(n, b): while n >= b: n, r = divmod(n, b) if r != 1: return False return n == 1 def agen(): yield 1 n = 2 while True: reps = 2 # n is a repunit in bases 1 and n-1 for b in range(2, n-1): if isrep(n, b): reps += 1 if reps == 4: yield n; break n += 1 for m in agen(): print(m) # Michael S. Branicky, Jan 31 2021
Extensions
Edited by Ray Chandler, Jun 08 2006
Comments