cp's OEIS Frontend

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.

A244475 5th-largest term in the n-th row of Stern's diatomic triangle A002487.

This page as a plain text file.
%I A244475 #29 Mar 13 2023 06:27:22
%S A244475 1,3,9,16,27,46,76,123,207,335,545,882,1428,2311,3740,6051,9791,15842,
%T A244475 25633,41475,67108,108583,175691,284274,459965,744239,1204204,1948443,
%U A244475 3152647,5101090,8253737
%N A244475 5th-largest term in the n-th row of Stern's diatomic triangle A002487.
%H A244475 Jennifer Lansing, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL17/Lansing/lansing2.html">Largest Values for the Stern Sequence</a>, Journal of Integer Sequences, Vol. 17 (2014), Article 14.7.5.
%F A244475 Conjectured g.f.: -x^3*(x^14+ x^13+ x^12+ 2*x^11 +3*x^10 +5*x^9 +8*x^8 +x^7 +3*x^6 +3*x^5 +2*x^4 +4*x^3 +5*x^2 +2*x +1) / (x^2+x-1). - _Alois P. Heinz_, Jun 20 2022
%p A244475 A002487 := proc(n,k)
%p A244475     option remember;
%p A244475     if k =0 then
%p A244475         1;
%p A244475     elif k = 2^n-1 then
%p A244475         n+1 ;
%p A244475     elif type(k,'even') then
%p A244475         procname(n-1,k/2) ;
%p A244475     else
%p A244475         procname(n-1,(k-1)/2)+procname(n-1,(k+1)/2) ;
%p A244475     end if;
%p A244475 end proc:
%p A244475 A244475 := proc(n)
%p A244475     {seq(A002487(n,k),k=0..2^n-1)} ;
%p A244475     sort(%) ;
%p A244475     op(-5,%) ;
%p A244475 end proc:
%p A244475 for n from 3 do
%p A244475     print(A244475(n)) ;
%p A244475 od: # _R. J. Mathar_, Oct 25 2014
%t A244475 s[n_, k_] := s[n, k] = Which[k == 0, 1, k == 2^n-1, n+1, EvenQ[k], s[n-1, k/2], True, s[n-1, (k-1)/2] + s[n-1, (k+1)/2]];
%t A244475 row[n_] := Table[s[n, k], {k, 0, 2^n-1}];
%t A244475 a[n_] := If[n == 3, 1, Union[row[n]][[-5]]];
%t A244475 Table[Print[n, " ", a[n]]; a[n], {n, 3, 23}] (* _Jean-François Alcover_, Mar 13 2023, after _R. J. Mathar_ *)
%o A244475 (Python)
%o A244475 from itertools import product
%o A244475 from functools import reduce
%o A244475 def A244475(n): return sorted(set(sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if y else (x[0]+x[1],x[1]),k,(1,0))) for k in product((False,True),repeat=n)),reverse=True)[4] # _Chai Wah Wu_, Jun 19 2022
%Y A244475 Cf. A002487, A244472, A244473, A244474, A244476.
%K A244475 nonn,more
%O A244475 3,2
%A A244475 _N. J. A. Sloane_, Jul 01 2014
%E A244475 a(24)-a(25) from _Alois P. Heinz_, Jun 19 2022
%E A244475 a(26)-a(33) from _Chai Wah Wu_, Jun 20 2022