A037610 Decimal expansion of a(n) is given by the first n terms of the periodic sequence with initial period 1,2,3.
1, 12, 123, 1231, 12312, 123123, 1231231, 12312312, 123123123, 1231231231, 12312312312, 123123123123, 1231231231231, 12312312312312, 123123123123123, 1231231231231231, 12312312312312312, 123123123123123123, 1231231231231231231, 12312312312312312312
Offset: 1
Links
- Hieronymus Fischer, Table of n, a(n) for n = 1..200
- Index entries for linear recurrences with constant coefficients, signature (10,0,1,-10).
Programs
-
Magma
[(41*10^n-27*n-50+90*Floor(n/3)-9*Floor((n-1)/3))/333: n in [1..30]]; // Bruno Berselli, Sep 13 2018
-
Maple
A037610:=n->floor((41/333)*10^n); seq(A037610(n), n=1..20); # Wesley Ivan Hurt, Apr 19 2014
-
Mathematica
a[n_] := Floor[41/333*10^n]; Array[a, 19] (* Robert G. Wilson v, Apr 18 2014 *) Table[FromDigits[PadRight[{},n,{1,2,3}]],{n,20}] (* or *) LinearRecurrence[ {10,0,1,-10},{1,12,123,1231},20] (* Harvey P. Dale, May 09 2014 *)
-
PARI
A037610(n)=10^n*41\333 \\ M. F. Hasler, Jan 13 2013
-
PARI
Vec(x*(3*x^2+2*x+1)/((x-1)*(10*x-1)*(x^2+x+1)) + O(x^100)) \\ Colin Barker, Apr 30 2014
Formula
a(n) = floor((41/333)*10^n). - Hieronymus Fischer, Jan 03 2013
From Colin Barker, Apr 30 2014: (Start)
a(n) = 10*a(n-1) + a(n-3) - 10*a(n-4).
G.f.: x*(3*x^2 + 2*x + 1) / ((x - 1)*(10*x - 1)*(x^2 + x + 1)). (End)
a(n) = (41*10^n - 27*n - 50 + 90*floor(n/3) - 9*floor((n - 1)/3))/333. - Bruno Berselli, Sep 13 2018
Comments