%I #26 Sep 08 2022 08:45:08
%S 1,4,7,11,14,17,21,24,27,31,34,37,41,44,47,51,54,57,61,64,67,71,74,77,
%T 81,84,87,91,94,97,101,104,107,111,114,117,121,124,127,131,134,137,
%U 141,144,147,151,154,157,161,164,167,171,174,177,181,184,187,191,194,197
%N Numbers that are congruent to {1, 4, 7} mod 10.
%C 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.
%C Numbers with last digit 1, 4, or 7. - _Wesley Ivan Hurt_, Jun 14 2016
%H Vincenzo Librandi, <a href="/A078309/b078309.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,1,-1).
%F a(n) = 1 + 3*mod(n-1, 3) + 10*floor((n-1)/3).
%F From _Arkadiusz Wesolowski_, Sep 21 2012: (Start)
%F a(n) = a(n-3) + 10 for n>4.
%F a(n) = a(n-1) + a(n-3) - a(n-4) for n>4.
%F a(n) = 3*n + floor((n-1)/3) - 2.
%F G.f.: (-x - 3*(x^2 + x^3 + x^4))/(-1 + x + x^3 - x^4). (End)
%F From _Wesley Ivan Hurt_, Jun 14 2016: (Start)
%F a(n) = (30*n-24-3*cos(2*n*Pi/3)+sqrt(3)*sin(2*n*Pi/3))/9.
%F a(3k) = 10k-3, a(3k-1) = 10k-6, a(3k-2) = 10k-9. (End)
%p 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
%t Table[1 + 3*Mod[n - 1, 3] + 10*Floor[(n - 1)/3], {n, 55}]
%t 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 *)
%t CoefficientList[Series[(-1 - 3 x (1 + x + x^2))/(-1 + x + x^3 - x^4), {x, 0, 100}], x] (* _Vincenzo Librandi_, Apr 23 2014 *)
%o (PARI) a(n)=1+n--%3*3+n\3*10 \\ _Charles R Greathouse IV_, Sep 25 2012
%o (Magma) [3*n + Floor((n-1)/3) - 2: n in [1..60]]; // _Vincenzo Librandi_, Apr 23 2014
%Y The sequence begins with the same first 6 terms as the 'Straight' sequence (A028373).
%K nonn,easy
%O 1,2
%A _Jochen Ziegenbalg_, Dec 23 2002
%E Edited by _Robert G. Wilson v_, Dec 24 2002
|