OFFSET
1,1
COMMENTS
a(n) is also the terms of (x+x^2+x^3) + (x^2+x^4+x^6) + ... + (x^n+x^2n+x^3n) in GF(2)[x].
LINKS
P. Y. Huang, W. F. Ke, and G. F. Pilz, The cardinality of some symmetric differences, Proc. Amer. Math. Soc., 138 (2010), 787-797.
Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,0,1,-1).
FORMULA
G.f.: x*(x^5+3*x^4+x^3-x^2+x+3)/(x^7-x^6-x+1). - Alois P. Heinz, May 17 2023
6*a(n) = 1 -(-1)^n +8*n +8*A103368(n-1). - R. J. Mathar, Jan 11 2024
MATHEMATICA
delta[l_, m_] := Complement[Join[l, m], Intersection[l, m]];
Nabl[s_, n_] := (d = {}; Do[d = delta[d, s*j], {j, Range[n]}]; d);
Table[Length[Nabl[Range[1, 3], n]], {n, 100}]
PROG
(PARI) a(n) = {my(m=0); for(k = 0, n-1, m = bitxor(m, 2^k+2^(2*k+1)+2^(3*k+2))); hammingweight(m)} \\ Thomas Scheuerle, May 17 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Guenter Pilz, May 17 2023
STATUS
approved