%I #55 Feb 22 2024 09:04:54
%S 1,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,
%T 1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,
%U 1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1
%N A Chebyshev transform of Jacobsthal numbers.
%C A Chebyshev transform of A001045(n+1): if A(x) is the g.f. of a sequence, map it to ((1-x^2)/(1+x^2))*A(x/(1+x^2)).
%C Also decimal expansion of 1111/9990. - _Elmo R. Oliveira_, Feb 18 2024
%H G. C. Greubel, <a href="/A100063/b100063.txt">Table of n, a(n) for n = 0..1000</a>
%H Andrei Asinowski, Cyril Banderier, and Valerie Roitner, <a href="https://lipn.univ-paris13.fr/~banderier/Papers/several_patterns.pdf">Generating functions for lattice paths with several forbidden patterns</a>, (2019).
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,1).
%F G.f.: (1+x)(1+x^2)/(1-x^3).
%F a(n) = n*Sum_{k=0..floor(n/2)} binomial(n-k, k)(-1)^k*A001045(n-2k+1)/(n-k).
%F Multiplicative with a(3^e) = 2, a(p^e) = 1 otherwise. - _David W. Wilson_, Jun 11 2005
%F Dirichlet g.f.: zeta(s)*(1+1/3^s). Dirichlet convolution of A154272 and A000012. - _R. J. Mathar_, Feb 07 2011
%F a(n) = 2 if n == 0 (mod 3) and n > 0, and a(n) = 1 otherwise. - _Amiram Eldar_, Nov 01 2022
%F a(n) = gcd(Fibonacci(n), Lucas(n)) = gcd(A000045(n), A000032(n)), for n >= 1. - _Amiram Eldar_, Jul 10 2023
%e G.f. = 1 + x + x^2 + 2*x^3 + x^4 + x^5 + 2*x^6 + x^7 + x^8 + 2*x^9 + ... - _Michael Somos_, Feb 20 2024
%t PadRight[{1},120,{2,1,1}] (* or *) LinearRecurrence[{0,0,1},{1,1,1,2},120] (* _Harvey P. Dale_, Jul 08 2015 *)
%t a[ n_] := If[n<1, Boole[n==0], {2, 1, 1}[[1+Mod[n, 3]]]]; (* _Michael Somos_, Feb 20 2024 *)
%o (PARI) my(x='x+O('x^50)); Vec((1+x)(1+x^2)/(1-x^3)) \\ _G. C. Greubel_, May 03 2017
%o (PARI) {a(n) = if(n<1, n==0, [2, 1, 1][n%3+1])}; /* _Michael Somos_, Feb 20 2024 */
%Y Cf. A000012, A001045, A100051, A061347, A057079, A154272.
%Y Cf. A000032, A000045.
%K easy,nonn,mult
%O 0,4
%A _Paul Barry_, Nov 02 2004