login
A005707
a(1) = a(2) = a(3) = a(4) = 1, a(n) = a(a(n-1))+a(n-a(n-1)) for n >= 5.
(Formerly M0251)
3
1, 1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 6, 6, 6, 6, 6, 7, 8, 8, 9, 9, 9, 9, 9, 9, 10, 11, 11, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 14, 15, 16, 16, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 20, 21, 22, 22, 23, 24, 24, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 27
OFFSET
1,5
COMMENTS
It is known that a(n)-a(n-1)=0 or 1 (see the 1991 Monthly reference). - Emeric Deutsch, Jun 06 2005
REFERENCES
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
D. Kleitman, Solution to Problem E3274, Amer. Math. Monthly, 98 (1991), 958-959.
R. K. Guy and N. J. A. Sloane, Correspondence, 1988.
D. Newman, Problem E3274, Amer. Math. Monthly, 95 (1988), 555.
MAPLE
a[1]:=1: a[2]:=1: a[3]:=1: a[4]:=1: for n from 5 to 100 do a[n]:=a[a[n-1]]+a[n-a[n-1]] od: seq(a[n], n=1..100); # Emeric Deutsch, Jun 06 2005
MATHEMATICA
a[1]=a[2]=a[3]=a[4]=1; a[n_]:=a[n]=a[a[n-1]]+a[n-a[n-1]]; Table[a[i], {i, 80}] (* Harvey P. Dale, Jan 22 2013 *)
PROG
(Haskell)
a005707 n = a005707_list !! (n-1)
a005707_list = 1 : 1 : 1 : 1 : h 5 1 where
h x y = z : h (x + 1) z where z = a005707 y + a005707 (x - y)
-- Reinhard Zumkeller, Jul 20 2012
CROSSREFS
Cf. A005185.
Sequence in context: A132073 A087817 A091497 * A087828 A330779 A366632
KEYWORD
nonn,easy,nice
EXTENSIONS
More terms from Emeric Deutsch, Jun 06 2005
STATUS
approved