A086821 Duplicate of A007576.
1, 1, 1, 3, 7, 15, 35, 87, 217, 547, 1417, 3735, 9911, 26513, 71581, 194681, 532481
Offset: 0
This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
nmax = 40; p = 1; Flatten[{1, Table[Coefficient[p = Expand[p*(1/x^n + 1 + x^n)], x^n], {n, 1, nmax}]}] (* Vaclav Kotesovec, Jul 11 2018 *)
{a(n) = polcoeff( prod(k=1,n, 1/x^k + 1 + x^k) + x*O(x^n),n)} for(n=0,40, print1(a(n),", "))
from collections import Counter def A316706(n): c = {0:1} for k in range(1,n+1): b = Counter(c) for j in c: a = c[j] b[j+k] += a b[j-k] += a c = b return c[n] # Chai Wah Wu, Feb 05 2024
Some solutions for n=4 k=4 ..1..1..1..1...-1.-1..1..1...-1.-1.-1..1....1..1..1..1...-1..1..1..1 ..1..1..1..1...-1..1..1..1...-1.-1.-1..1...-1.-1.-1.-1...-1.-1..1..1 .-1.-1.-1.-1....1..1..1..1...-1..1..1..1....1..1..1..1...-1..1..1..1 .-1.-1..1..1...-1.-1.-1.-1...-1.-1..1..1...-1.-1.-1..1...-1.-1.-1..1
b:= proc(n) option remember; `if`(n=0, 1, expand((x^(n^2)+1+1/x^(n^2))*b(n-1))) end: a:= n-> coeff(b(n),x,0): seq(a(n), n=0..33); # Alois P. Heinz, Jan 28 2022
Table[Coefficient[Product[x^(k^2) + 1 + 1/x^(k^2), {k, 1, n}], x, 0], {n, 0, 30}] (* Vaclav Kotesovec, Feb 05 2022 *)
Table[Coefficient[Expand[Product[(1 + x^k + x^(2*k))^2, {k, 1, n}]],x, n*(n + 1)], {n, 0, 20}]
s:= proc(n) s(n):= `if`(n<1, 0, ithprime(n)+s(n-1)) end: b:= proc(n, i) option remember; `if`(n>s(i), 0, `if`(i=0, 1, b(n, i-1)+b(n+ithprime(i), i-1)+b(abs(n-ithprime(i)), i-1))) end: a:= n-> b(0, n): seq(a(n), n=0..40); # Alois P. Heinz, Dec 28 2023
s[n_] := s[n] = If[n < 1, 0, Prime[n] + s[n-1]]; b[n_, i_] := b[n, i] = If[n > s[i], 0, If[i == 0, 1, b[n, i-1] + b[n + Prime[i], i-1] + b[Abs[n - Prime[i]], i-1]]]; a[n_] := b[0, n]; Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Apr 27 2025, after Alois P. Heinz *)
a(n) = polcoef (prod(k=1, n, x^prime(k) + 1 + 1/x^prime(k)), 0); \\ Michel Marcus, Jan 21 2022
Table[Coefficient[Product[(x^k + 1 + 1/x^k), {k, 1, n}], x, 1], {n, 0, 31}]
from itertools import count, islice from collections import Counter def A369628_gen(): # generator of terms ccount = Counter({0:1}) yield 0 for i in count(1): bcount = Counter(ccount) for a in ccount: bcount[a+i] += ccount[a] bcount[a-i] += ccount[a] ccount = bcount yield(ccount[1]) A369628_list = list(islice(A369628_gen(),20)) # Chai Wah Wu, Jan 29 2024
f:= n -> coeff(mul(x^k+1+1/x^k,k=1..n)^n,x,0): map(f, [$0..12]); # Robert Israel, Jan 15 2023
a[n_] := Coefficient[Series[Product[(x^k + 1 + 1/x^k)^n, {k, 1, n}], {x, 0, 0}], x, 0]; Array[a, 11, 0] (* Amiram Eldar, Dec 24 2021 *)
a(n) = polcoef(prod(k=1, n, x^k+1+1/x^k)^n, 0);
a(n) = polcoef(prod(k=1, n, 1+x^k+x^(2*k))^n, n^2*(n+1)/2);
b:= proc(n, i) option remember; `if`(n>i*(i+1)*(i+2)/6, 0, `if`(i=0, 1, b(n, i-1)+b(n+i*(i+1)/2, i-1)+b(abs(n-i*(i+1)/2), i-1))) end: a:= n-> b(0, n): seq(a(n), n=0..33); # Alois P. Heinz, Jan 21 2024
Table[Coefficient[Product[x^(k (k + 1)/2) + 1 + 1/x^(k (k + 1)/2), {k, 1, n}], x, 0], {n, 0, 31}]
Comments