OFFSET
0,2
COMMENTS
For n == 0 or n == 2 (mod 6), there is no obvious divisibility pattern.
According to M. Kamada, n = 116 is the only index of a prime up to n = 10^5.
LINKS
Makoto Kamada, Factorization of 77...77177...77.
Index entries for linear recurrences with constant coefficients, signature (111,-1110,1000).
FORMULA
a(n) = 7*A138148(n) + 10^n.
For n == 1 (mod 3), 3 | a(n) and a(n)/3 = 259*(10^(2n+1)-1)/999 - 2*10^n;
for n == 3 or 5 (mod 6), 13 | a(n) and a(n)/13 = (A(n)-1)*10^n + B(n), where A(n) (resp. B(n)) are the n leftmost (resp. rightmost) digits of 59829*(10^(ceiling(n/6)*6)-1)/(10^6-1).
From Colin Barker, Feb 07 2020: (Start)
G.f.: (1 + 606*x - 1300*x^2) / ((1 - x)*(1 - 10*x)*(1 - 100*x)).
a(n) = 111*a(n-1) - 1110*a(n-2) + 1000*a(n-3) for n>2.
(End)
E.g.f.: (1/9)*exp(x)*(70*exp(99*x) - 54*exp(9*x) - 7). - Stefano Spezia, Feb 08 2020
MATHEMATICA
Array[7 (10^(2 # + 1) - 1)/9 - 6*10^# &, 15, 0] (* or *)
CoefficientList[Series[(1 + 606 x - 1300 x^2)/((1 - x) (1 - 10 x) (1 - 100 x)), {x, 0, 15}], x] (* Michael De Vlieger, Feb 08 2020 *)
Table[FromDigits[Join[PadRight[{}, n, 7], {1}, PadRight[{}, n, 7]]], {n, 0, 20}] (* or *) LinearRecurrence[ {111, -1110, 1000}, {1, 717, 77177}, 20] (* Harvey P. Dale, Apr 04 2024 *)
PROG
(PARI) apply( {A332171(n)=10^(n*2+1)\9*7-6*10^n}, [0..15])
(PARI) Vec((1 + 606*x - 1300*x^2) / ((1 - x)*(1 - 10*x)*(1 - 100*x)) + O(x^15)) \\ Colin Barker, Feb 07 2020
(Python) def A332171(n): return 10**(n*2+1)//9*7-6*10^n
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
M. F. Hasler, Feb 06 2020
STATUS
approved