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.
%I A039824 #19 May 04 2017 11:28:20 %S A039824 1,2,4,11,20,31,46,61,78,97,118,141,166,193,222,253,286,321,358,397, %T A039824 438,481,526,573,622,673,726,781,838,897,958,1021,1086,1153,1222,1293, %U A039824 1366,1441,1518,1597,1678,1761,1846,1933,2022,2113,2206,2301,2398,2497 %N A039824 Number of different coefficient values in expansion of Product (1+q^1+q^3...+q^(2i-1)), i=1 to n. %H A039824 J. Conrad, <a href="/A039824/b039824.txt">Table of n, a(n) for n = 1..180</a> %F A039824 Conjecture: for n>6, a(n) = n^2 - 3. - _Ralf Stephan_, Mar 07 2004 %F A039824 Conjectures from _Colin Barker_, May 02 2017: (Start) %F A039824 G.f.: x*(1 - x + x^2 + 4*x^3 - 3*x^4 + 2*x^6 - 4*x^7 + 2*x^8) / (1 - x)^3. %F A039824 a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n>9. %F A039824 (End) %t A039824 p[1] = 1 + q; p[n_] := p[n] = p[n - 1] (1 + Sum[q^k, {k, 1, 2 n - 1, 2}]) // Expand; a[1] = 1; a[n_] := p[n] // CoefficientList[#, q]& // Union // Length; Array[a, 180] (* _Jean-François Alcover_, May 04 2017 *) %o A039824 (Python) %o A039824 def get(d, x): return d[x] if len(d) > x >= 0 else 0 %o A039824 def convolve(a, b): %o A039824 r = [] %o A039824 for x in range(len(a) + len(b) - 1): %o A039824 n = 0 %o A039824 for k in range(x + 1): n += get(a, k) * get(b, x - k) %o A039824 r.append(n) %o A039824 return r %o A039824 def unique_in(d): %o A039824 out = list([]) %o A039824 for elem in d: %o A039824 if elem not in out: out.append(elem) %o A039824 return len(out) %o A039824 def A039824(x): %o A039824 seed = [0**k + k % 2 for k in range(2*(x+1))] %o A039824 product = seed[0:2] %o A039824 out = list([1]) %o A039824 for k in range(2, x + 1): %o A039824 product = convolve(product, seed[0:2*k]) %o A039824 out.append(unique_in(product)) %o A039824 return out %o A039824 # _J. Conrad_, May 02 2017 %Y A039824 Cf. A028872. %K A039824 nonn %O A039824 1,2 %A A039824 _Olivier Gérard_