OFFSET
1,3
COMMENTS
A002487 is THE Stern's sequence!
Limit_{n->oo} a(n)/2^n = 0.11756264240558743281779408719593950494049225979176... - Jon E. Schoenfield, Dec 17 2016
REFERENCES
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000 [extending prior submission by T. D. Noe]
Jaegug Bae and Sungjin Choi, A generalization of a subset-sum-distinct sequence, J. Korean Math. Soc. 40 (2003), no. 5, 757-768. MR1996839 (2004d:05198). See d_1(n).
G. Kreweras, Sur quelques problèmes relatifs au vote pondéré, [Some problems of weighted voting], Math. Sci. Humaines No. 84 (1983), 45-63.
M. A. Stern, Aufgaben, J. Reine Angew. Math., 18 (1838), 100.
FORMULA
2*a(n*(n+1)/2 + 1) = a(n*(n+1)/2 + 2) for n>=1; lim_{n->oo} a(n+1)/a(n) = 2. - Paul D. Hanna, Aug 28 2006
MAPLE
MATHEMATICA
Module[{lst={1, 1}, n=2}, While[n<40, AppendTo[lst, Total[ Take[lst, -Ceiling[ (Sqrt[8n+1]-1)/2]]]]; n++]; lst] (* Harvey P. Dale, Apr 02 2012 *)
PROG
(PARI) a(n)=if(n==1, 1, sum(k=1, ceil((sqrt(8*n-7)-1)/2), a(n-k))) \\ Paul D. Hanna, Aug 28 2006
(PARI) v=vector(10^3); v[1]=v[2]=1; v[3]=2; v[4]=3; u=vector(#v, i, if(i>4, 0, sum(j=1, i, v[j]))); for(i=5, #v, m=ceil((sqrt(8*i-7)-1)/2); v[i]=u[i-1]-u[i-m-1]; u[i]=u[i-1]+v[i]); u=0; v \\ Charles R Greathouse IV, Sep 19 2011
(Python)
from itertools import count, islice
from math import isqrt
def A005230_gen(): # generator of terms
blist = [1]
for n in count(1):
yield blist[-1]
blist.append(sum(blist[-i] for i in range(1, (isqrt(8*n)+3)//2)))
CROSSREFS
KEYWORD
core,easy,nonn,nice
AUTHOR
EXTENSIONS
Name corrected by Mario Szegedy, Sep 15 1996
Name revised by Ulrich Schimke (ulrschimke(AT)aol.com), Mar 16 2002
STATUS
approved