login
a(n) = 7*(10^(2n+1)-1)/9 - 4*10^n.
1

%I #10 Feb 11 2020 08:26:35

%S 3,737,77377,7773777,777737777,77777377777,7777773777777,

%T 777777737777777,77777777377777777,7777777773777777777,

%U 777777777737777777777,77777777777377777777777,7777777777773777777777777,777777777777737777777777777,77777777777777377777777777777,7777777777777773777777777777777

%N a(n) = 7*(10^(2n+1)-1)/9 - 4*10^n.

%C According to M. Kamada, n = 0 and n = 2 are the only indices of a prime up to n = 2*10^4.

%H Makoto Kamada, <a href="https://stdkmd.net/nrr/7/77377.htm">Factorization of 77...77377...77</a>, updated Dec 11 2018.

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (111,-1110,1000).

%F a(n) = 7*A138148(n) + 3*10^n.

%F G.f.: (1 + 404*x - 1100*x^2)/((1 - x)*(1 - 10*x)*(1 - 100*x)).

%F a(n) = 111*a(n-1) - 1110*a(n-2) + 1000*a(n-3) for n>2.

%p A332173 := n -> 7*(10^(n*2+1)-1)/9 - 4*10^n;

%t Array[7 (10^(2 # + 1) - 1)/9 - 4*10^# &, 15, 0]

%o (PARI) apply( {A332173(n)=10^(n*2+1)\9*7-4*10^n}, [0..15])

%o (Python) def A332173(n): return 10**(n*2+1)//9*7-4*10^n

%Y Cf. A138148 (cyclops numbers with binary digits only).

%Y Cf. A002275 (repunits R_n = (10^n-1)/9), A002281 (7*R_n), A011557 (10^n).

%Y Cf. A332171 .. A332179 (variants with different middle digit 1, ..., 9).

%K nonn,base,easy

%O 0,1

%A _M. F. Hasler_, Feb 06 2020