A085922 Duplicate of A048973.
4, 7, 9, 12, 13, 15, 20, 23, 26, 27, 28, 31, 36, 38, 39, 42, 44, 48, 50, 52, 53, 55, 56, 61
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.
After 1,2,3,5,6 you can adjoin 8 = 3+5, 10 = 2+3+5, etc. 12 is not a term since it is not the sum of any set of consecutive previous terms.
import Data.Set (singleton, deleteFindMin, fromList, union, IntSet) a005243 n = a005243_list !! (n-1) a005243_list = 1 : h [1] (singleton 2) where h xs s = m : h (m:xs) (union s' $ fromList $ map (+ m) $ scanl1 (+) xs) where (m, s') = deleteFindMin s -- Reinhard Zumkeller, Dec 17 2015, Jun 22 2011
nmax = 200; For[ s = {1, 2}; n = 3, n <= nmax, n++, ls = Length[s]; tt = Total /@ Flatten[Table[s[[i ;; j]], {i, 1, ls-1}, {j, i+1, ls}], 1]; If[MemberQ[tt, n], AppendTo[s, n]]]; A005243 = s (* Jean-François Alcover, Oct 21 2016 *)
Comments