%I #14 Jun 26 2015 07:20:08
%S 101,110,112,113,114,115,116,117,118,119,121,131,141,151,161,171,181,
%T 191,211,311,411,511,611,711,811,911,1011,1101,1110,1112,1113,1114,
%U 1115,1116,1117,1118,1119,1121,1131,1141,1151,1161,1171,1181,1191,1211,1311,1411,1511,1611,1711,1811,1911,2111,3111,4111,5111,6111,7111,8111,9111
%N Near-repunits (ordered lexicographically).
%C The repunits are in A002275; therefore, to be a near-repunit, x must have only one other digit besides one, and the ones must outnumber the other digit.
%C Number of terms < 10^k: 0, 0, 26, 35, 44, 53, 62, 71, 80, 89, ...; this is 9k-1 for k>2.
%H Robert G. Wilson v, <a href="/A259300/b259300.txt">Table of n, a(n) for n = 1..10080</a>
%t f[n_] := Block[{lst = {}, r = (10^(n-1) -1)/9}, Do[ AppendTo[lst, Select[ FromDigits[ Permutations[ Append[ IntegerDigits@ r, d]]], # > r &]], {d, {0, 2, 3, 4, 5, 6, 7, 8, 9}}]; Union@ Flatten@ lst]; f[1] = f[2] = {}; Array[f, 4] // Flatten
%Y Cf. A002275.
%K base,nonn,easy
%O 1,1
%A _Robert G. Wilson v_, Jun 23 2015
|