login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A005350 a(1) = a(2) = a(3) = 1, a(n) = a(a(n-1)) + a(n-a(n-1)) for n >= 4.
(Formerly M0253)
7
1, 1, 1, 2, 2, 3, 3, 3, 4, 5, 5, 5, 5, 6, 7, 7, 8, 8, 8, 8, 8, 9, 10, 11, 11, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 15, 16, 16, 17, 18, 18, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 22, 23, 24, 25, 25, 26, 27, 27, 28 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
COMMENTS
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
R. K. Guy, The Second Strong Law of Small Numbers, Math. Mag, 63 (1990), no. 1, 3-20.
R. K. Guy, The Second Strong Law of Small Numbers, Math. Mag, 63 (1990), no. 1, 3-20. [Annotated scanned copy]
R. K. Guy and N. J. A. Sloane, Correspondence, 1988.
D. Kleitman, Solution to Problem E3274, Amer. Math. Monthly, 98 (1991), 958-959.
MAPLE
A005350 := proc(n) option remember; if n<=3 then 1 else procname(procname(n-1)) + procname(n-procname(n-1)); end if; end proc:
seq(A005350(n), n=1..64) ;
MATHEMATICA
a[1] = a[2] = a[3] = 1; a[n_] := a[n] = a[a[n-1]] + a[n-a[n-1]]; Table[a[n], {n, 1, 64}] (* Jean-François Alcover, Feb 11 2014 *)
PROG
(Haskell)
a005350 n = a005350_list !! (n-1)
a005350_list = 1 : 1 : 1 : h 4 1 where
h x y = z : h (x + 1) z where z = a005350 y + a005350 (x - y)
-- Reinhard Zumkeller, Jul 20 2012
(SageMath)
@CachedFunction
def a(n): return 1 if (n<4) else a(a(n-1)) + a(n-a(n-1))
[a(n) for n in range(1, 100)] # G. C. Greubel, Nov 14 2022
CROSSREFS
Sequence in context: A344497 A316628 A153112 * A055037 A227386 A351833
KEYWORD
nonn,easy,nice
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 29 07:13 EDT 2024. Contains 372098 sequences. (Running on oeis4.)