OFFSET
1,2
COMMENTS
Equals POLYMOTZKINTINV [1,2,3,...], such that POLYMOTZKINT a(n) = [1,2,3,...]. A comment accompanying the POLYMOTZKINT operation may be found in A005717.
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..5002
Index entries for linear recurrences with constant coefficients, signature (0,-2,0,-1).
FORMULA
(1, -2, 3, -4, 5,...) interleaved with (1, 2, -2, 2,...) such that the first subsequence starts after the first "2" in the second subsequence.
G.f.: x + x^2*(2+x+2*x^2)/(1+x^2)^2. - R. J. Mathar, Dec 13 2022
From G. C. Greubel, Dec 16 2025: (Start)
a(n) = i^(n-2)*(1 + (-1)^n) + (1/4)*i^(n-3)*(1 - (-1)^n)*(n-1) + [n=1] + 2*[n=0].
E.g.f.: (1/2)*( 4 + 2*x - (x+4)*cos(x) + sin(x) ). (End)
MATHEMATICA
Join[{1, 2}, LinearRecurrence[{0, -2, 0, -1}, {1, -2, -2, 2}, 65]] (* Georg Fischer, Nov 02 2021 *)
PROG
(Magma)
R<x>:=PowerSeriesRing(Rationals(), 70);
Coefficients(R!( x + x^2*(2+x+2*x^2)/(1+x^2)^2 )); // G. C. Greubel, Dec 16 2025
(SageMath)
def A147657(n): return 2*i^(n-2)*((n+1)%2) + i^(n-3)*(n%2)*(n-1)//2 + int(n==1) + 2*int(n==0)
print([A147657(n) for n in range(1, 71)]) # G. C. Greubel, Dec 16 2025
CROSSREFS
KEYWORD
easy,sign
AUTHOR
Gary W. Adamson, Nov 09 2008
EXTENSIONS
Definition and a(28) ff. corrected by Georg Fischer, Nov 02 2021
STATUS
approved
