OFFSET
0,2
COMMENTS
a(n) are distinct primes for n = 1 to 8.
LINKS
Arkadiusz Wesolowski, Table of n, a(n) for n = 0..100
G. L. Honaker, Jr. and Chris Caldwell, Prime Curios! 8
Index entries for linear recurrences with constant coefficients, signature (111,-1110,1000).
FORMULA
a(n) = ceiling(((10^n - 1)^2/9 + 10^n)/18).
a(n) = (10^n - 1)*((10^n - 1)/9 + 1)/18 + 1.
G.f.: (1 - 109*x + 955*x^2)/((1 - x)*(1 - 10*x)*(1 - 100*x)).
EXAMPLE
a(2) = 67 because (99^2/9 + 100)/18 = 66.05555....
MAPLE
seq(((10^n-1)^2/9+10^n-1)/18+1, n=0..15);
MATHEMATICA
Table[a = (10^n - 1)/18; 2*a^2 + a + 1, {n, 0, 15}]
LinearRecurrence[{111, -1110, 1000}, {1, 2, 67}, 20] (* Harvey P. Dale, Jul 07 2017 *)
PROG
(Magma) [ ((10^n-1)^2/9+10^n-1)/18+1 : n in [0..15]]
(PARI) for(n=0, 15, print1(((10^n-1)^2/9+10^n-1)/18+1, ", "))
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Arkadiusz Wesolowski, Dec 21 2011
STATUS
approved