OFFSET
1,1
COMMENTS
Old name was: Very generalized repunit prime numbers.
These numbers are prime numbers that can be written in the form of (11...1) base m, with 3 or more ones and |m| > 1.
This sequence is the prime numbers picked from A206943.
Generalized repunit prime numbers are defined in the Caldwell link, as the form of (111...1) base m with numbers of ones >= (1/5)m.
This sequence includes all (111...1) base m primes with m < 1 and number of ones > 2.
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
Chris Caldwell, The Top Twenty: Generalized Repunit
EXAMPLE
3 = (111) base -2, so a(1) = 3;
7 = (111) base 2, so a(2) = 7;
11 = (11111) base -2, so a(3) = 11.
31 = (2^5-1)/(2-1) = (5^3-1)/(5-1) = (6^3+1)/(6+1),
43 = (2^7+1)/(2+1) = (7^3+1)/(7+1) = (6^3-1)/(6-1),
8191 = (2^13-1)/(2-1) = (90^3-1)/(90-1) = (91^3+1)/(91+1).
MATHEMATICA
phiinv[n_, pl_] := Module[{i, p, e, pe, val}, If[pl == {}, Return[If[n == 1, {1}, {}]]]; val = {}; p = Last[pl]; For[e = 0; pe = 1, e == 0 || Mod[n, (p - 1) pe/p] == 0, e++; pe *= p, val = Join[val, pe*phiinv[If[e == 0, n, n*p/pe/(p - 1)], Drop[pl, -1]]]]; Sort[val]]; phiinv[n_] := phiinv[n, Select[1 + Divisors[n], PrimeQ]]; maxdata = 13500; max = Ceiling[(1 + Sqrt[1 + 4*(maxdata - 1)])/4]*2; eb = 2*Floor[(Log[2, maxdata])/2 + 0.5]; While[eg = phiinv[eb]; lu = Length[eg]; lu == 0, eb = eb + 2]; t = Select[Range[eg[[Length[eg]]]], ((EulerPhi[#] <= eb) && (a = FactorInteger[#]; b = Length[a]; (((b == 1) && (a[[1]][[1]] > 2)) || ((b == 2) && (a[[1]][[1]] == 2))))) &]; ap = SortBy[t, Cyclotomic[#, 2] &]; a = {}; Do[i = 0; While[i++; cc = Cyclotomic[ap[[i]], m]; cc <= maxdata, If[PrimeQ[cc], a = Append[a, cc]]], {m, 2, max}]; Union[a]
nn = 120; ps = Prime[Range[2, PrimePi[Log[2, 2*nn^2 + 1]]]]; t = {}; Do[n = 0; If[Abs[m] > 1, n = (m^p - 1)/(m - 1); If[n > nn^2, n = 0]]; If[PrimeQ[n], AppendTo[t, n]], {p, ps}, {m, -nn, nn}]; t = Union[t] (* T. D. Noe, May 03 2013 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Lei Zhou, Feb 28 2012
EXTENSIONS
Better name and new examples by Thomas Ordowski, Apr 28 2013
STATUS
approved