OFFSET
1,3
COMMENTS
a(n) is the rank of the walk matrix of the Dynkin graph Dn, a tree obtained from the path of order n-1 by adding a pendant edge at the second vertex. see Wang et al.
LINKS
Wei Wang, Chuanming Wang, and Songlin Guo, On the walk matrix of the Dynkin graph Dn, arXiv:2202.13279 [math.CO], 2022.
Index entries for linear recurrences with constant coefficients, signature (1,0,0,1,-1).
FORMULA
From Wesley Ivan Hurt, Mar 03 2022: (Start)
a(n) = n - 2 + sign(n mod 4).
a(n) = n - 1 - A121262(n). (End)
MATHEMATICA
a[n_] := If[Divisible[n, 4], n - 2, n - 1]; Array[a, 70] (* Amiram Eldar, Mar 03 2022 *)
PROG
(PARI) a(n) = if (n%4, n-1, n-2);
(Python)
def A351782(n): return n - 1 - int(n % 4 == 0) # Chai Wah Wu, Mar 04 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Michel Marcus, Mar 03 2022
STATUS
approved