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.

A008057 Smallest sum of an addition chain for 2n+1.

This page as a plain text file.
%I A008057 #27 Apr 22 2025 17:20:24
%S A008057 0,5,10,16,20,27,31,35,40,47,51,56,60,65,74,78,80,86,92,96,102,106,
%T A008057 110,120,121,125,134,137,142,148,153,156,160,167,171,182,184,185,192,
%U A008057 201,200,206,210,219,227,231,233,237,241,245
%N A008057 Smallest sum of an addition chain for 2n+1.
%H A008057 H. Zantema, <a href="https://dspace.library.uu.nl/handle/1874/16604">Minimizing sums of addition chains</a>, RUU-CS-89-15 (1989).
%H A008057 H. Zantema, <a href="http://dx.doi.org/10.1016/0196-6774(91)90005-J">Minimizing sums of addition chains</a>, J. Algorithms 12 (1991) 281-307.
%H A008057 <a href="/index/Com#complexity">Index to sequences related to the complexity of n</a>
%F A008057 a(n) = A376449(2*n+1) + 2*n. - _Pontus von Brömssen_, Apr 22 2025
%e A008057 The smallest chain for 5 is 2, 3, 5 with sum a(2) = 2+3+5 = 10.
%e A008057 The smallest chain for 7 is 2, 3, 4, 7 with sum a(3) = 2+3+4+7 = 16.
%o A008057 (PARI) step(V)=my(U=List(),v); for(i=1,#V, v=V[i]; for(i=1,#v, for(j=i,#v, if(v[i]+v[j]>v[#v], listput(U, concat(v, v[i]+v[j])))))); vecsort(Vec(U),,8)
%o A008057 sm(v)=sum(i=2,#v,v[i])
%o A008057 a(n)=if(n<2,return(5*n)); n=2*n+1; my(V=[[1,2]],U,t); while(#(U=select(v->v[#v]==n,V))==0, V=select(v->v[#v]<=n,step(V))); t=vecmin(apply(sm,U)); while(#V, V=step(select(v->sm(v)<t-n,V)); for(i=1,#V, my(v=V[i]); if(v[#v]==n, t=min(sm(v),t)))); t \\ _Charles R Greathouse IV_, Jul 17 2013
%Y A008057 Cf. A003313, A079300, A003065, A005766, A376449.
%K A008057 nonn,nice,more
%O A008057 0,2
%A A008057 _N. J. A. Sloane_, Aug 07 2003
%E A008057 a(30)-a(46) from _Sean A. Irvine_, Mar 08 2018
%E A008057 a(47)-a(49) (using A376449 b-file) from _Pontus von Brömssen_, Apr 22 2025