OFFSET
1,2
COMMENTS
The formula 1 + 3*mod(n-1, 3) + floor(2/7 + (n-1)/n) * 10^floor((n-1)/3) produces a sequence with the same first 6 terms.
Numbers with last digit 1, 4, or 7. - Wesley Ivan Hurt, Jun 14 2016
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
a(n) = 1 + 3*mod(n-1, 3) + 10*floor((n-1)/3).
From Arkadiusz Wesolowski, Sep 21 2012: (Start)
a(n) = a(n-3) + 10 for n>4.
a(n) = a(n-1) + a(n-3) - a(n-4) for n>4.
a(n) = 3*n + floor((n-1)/3) - 2.
G.f.: (-x - 3*(x^2 + x^3 + x^4))/(-1 + x + x^3 - x^4). (End)
From Wesley Ivan Hurt, Jun 14 2016: (Start)
a(n) = (30*n-24-3*cos(2*n*Pi/3)+sqrt(3)*sin(2*n*Pi/3))/9.
a(3k) = 10k-3, a(3k-1) = 10k-6, a(3k-2) = 10k-9. (End)
MAPLE
A078309:=n->(30*n-24-3*cos(2*n*Pi/3)+sqrt(3)*sin(2*n*Pi/3))/9: seq(A078309(n), n=1..100); # Wesley Ivan Hurt, Jun 14 2016
MATHEMATICA
Table[1 + 3*Mod[n - 1, 3] + 10*Floor[(n - 1)/3], {n, 55}]
Select[Range[200], MemberQ[{1, 4, 7}, Mod[#, 10]]&] (* or *) LinearRecurrence[ {1, 0, 1, -1}, {1, 4, 7, 11}, 60] (* Harvey P. Dale, Apr 21 2014 *)
CoefficientList[Series[(-1 - 3 x (1 + x + x^2))/(-1 + x + x^3 - x^4), {x, 0, 100}], x] (* Vincenzo Librandi, Apr 23 2014 *)
PROG
(PARI) a(n)=1+n--%3*3+n\3*10 \\ Charles R Greathouse IV, Sep 25 2012
(Magma) [3*n + Floor((n-1)/3) - 2: n in [1..60]]; // Vincenzo Librandi, Apr 23 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jochen Ziegenbalg, Dec 23 2002
EXTENSIONS
Edited by Robert G. Wilson v, Dec 24 2002
STATUS
approved