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!)
A287292 a(1) = 1, a(2) = 2; a(n) = a(n-a(n-1)+1) + a(n-a(n-2)-1) for n > 2. 3
1, 2, 3, 3, 4, 5, 5, 5, 7, 6, 8, 8, 8, 9, 10, 10, 10, 12, 10, 13, 13, 11, 15, 14, 15, 16, 16, 16, 17, 17, 18, 19, 19, 19, 20, 20, 22, 20, 23, 22, 23, 23, 23, 24, 24, 28, 24, 25, 29, 25, 29, 30, 29, 31, 30, 30, 32, 32, 32, 33, 33, 33, 35, 34, 36, 36, 36, 37, 38, 38, 38, 39 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
Altug Alkan, Plot of a(n)-n/2
MATHEMATICA
a[n_] := a[n] = If[n <= 2, n, a[n - a[n - 1] + 1] + a[n - a[n - 2] - 1]]; Array[a, 72] (* Michael De Vlieger, May 22 2017 *)
PROG
(PARI) q=vector(10000); q[1]=1; q[2]=2; for(n=3, #q, q[n]=q[n-q[n-1]+1]+q[n-q[n-2]-1]); vector(10000, n, q[n])
(Scheme)
;; An implementation of memoization-macro definec can be found for example in: http://oeis.org/wiki/Memoization
(definec (A287292 n) (if (<= n 2) n (+ (A287292 (+ 1 (- n (A287292 (- n 1))))) (A287292 (+ -1 (- n (A287292 (- n 2)))))))) ;; Antti Karttunen, May 30 2017
CROSSREFS
Cf. A005185.
Sequence in context: A073092 A088023 A324477 * A260717 A282719 A061451
KEYWORD
nonn
AUTHOR
Altug Alkan, May 22 2017
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 May 11 15:49 EDT 2024. Contains 372409 sequences. (Running on oeis4.)