login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) = 10^(2n+1) - 10^n - 1.
15

%I #21 Jun 28 2023 09:07:47

%S 8,989,99899,9998999,999989999,99999899999,9999998999999,

%T 999999989999999,99999999899999999,9999999998999999999,

%U 999999999989999999999,99999999999899999999999,9999999999998999999999999,999999999999989999999999999,99999999999999899999999999999,9999999999999998999999999999999

%N a(n) = 10^(2n+1) - 10^n - 1.

%C n 9's followed by an 8 followed by n 9's.

%C See A183187 = {26, 378, 1246, 1798, 2917, ...} for the indices of primes.

%H Patrick De Geest, <a href="http://www.worldofnumbers.com/wing.htm#pwp989">Palindromic Wing Primes: (9)8(9)</a>, updated: June 25, 2017.

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

%H Markus Tervooren, <a href="http://factordb.com/index.php?query=10^%282*x%2B1%29-10^x-1">Factorizations of (9)w8(9)w</a>, FactorDB.com

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

%F From _M. F. Hasler_, Feb 08 2020: (Start)

%F a(n) = 9*A138148(n) + 8*10^n = A002283(2n+1) - A011557(10^n).

%F G.f.: (8 + 101*x - 1000*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. (End)

%p A181965 := n -> 10^(2*n+1)-1-10^n; # _M. F. Hasler_, Feb 08 2020

%t Array[10^(2 # + 1) - 1- 10^# &, 15, 0] (* _M. F. Hasler_, Feb 08 2020 *)

%t Table[With[{c=PadRight[{},n,9]},FromDigits[Join[c,{8},c]]],{n,0,20}] (* _Harvey P. Dale_, Jun 07 2021 *)

%o (PARI) apply( {A181965(n)=10^(n*2+1)-1-10^n}, [0..15]) \\ _M. F. Hasler_, Feb 08 2020

%o (Python) def A181965(n): return 10**(n*2+1)-1-10^n # _M. F. Hasler_, Feb 08 2020

%Y Cf. (A077794-1)/2 = A183187 (indices of primes).

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

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

%Y Cf. A332190 .. A332197 (variants with different middle digit 0, ..., 7).

%K easy,nonn,base

%O 0,1

%A _Ivan Panchenko_, Apr 04 2012

%E Edited and extended to a(0) = 8 by _M. F. Hasler_, Feb 10 2020