OFFSET
0,2
LINKS
Shalosh B. Ekhad and Doron Zeilberger, Automated Generation of Generating Functions Related to Generalized Stern's Diatomic Arrays in the footsteps of Richard Stanley, arXiv:2103.12855 [math.CO], 2021-2024.
Jinlong Tang and Guoce Xin, Meeting a Challenge raised by Ekhad and Zeilberger related to Stern's Triangle, arXiv:2506.13375 [math.CO], 2025.
MAPLE
b:= proc(n) option remember; expand(`if`(n<0, 1,
b(n-1)*(1+x^(2^n+1)+x^(2^(n+1)+1))))
end:
a:= n-> add(i^2, i=[coeffs(b(n-1))]):
seq(a(n), n=0..25); # Alois P. Heinz, Jun 17 2025
MATHEMATICA
a[n_]:=Total[CoefficientList[Product[ 1+x^(2^i+1)+x^(2^(i+1)+1), {i, 0, n-1}], x]^2]; Array[a, 20, 0] (* Stefano Spezia, Jun 17 2025 *)
PROG
(PARI) a(n) = norml2(Vec(prod(i=0, n-1, 1+x^(2^i+1)+x^(2^(i+1)+1))));
(Python)
from collections import Counter
from itertools import count, islice
def A385082_gen(): # generator of terms
c = Counter({0:1})
for n in count(0):
yield sum(i**2 for i in c.values())
c = sum((Counter({i:j, (m:=1<<n)+i+1:j, (m<<1)+i+1:j}) for i, j in c.items()), start=Counter())
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Marcus, Jun 16 2025
STATUS
approved
