login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A287422 a(1) = a(2) = 1; a(n) = n - a(a(n-1)) - a(n-a(n-1)) for n > 2. 6
1, 1, 1, 2, 3, 4, 4, 4, 4, 4, 5, 5, 6, 6, 7, 8, 9, 10, 11, 11, 12, 13, 13, 13, 14, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 19, 19, 19, 19, 20, 21, 21, 22, 22, 22, 23, 24, 25, 25, 26, 26, 27, 28, 29, 29, 30, 31, 32, 33, 34, 35, 36, 36, 37, 38, 39, 40, 40, 41, 42, 42, 42, 43, 44, 45, 46, 46 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,4

LINKS

Michael De Vlieger, Table of n, a(n) for n = 1..10000

Altug Alkan, Plot of a(n)-n/2 for n<=2^20

Altug Alkan, Plot of (a(n-a(n-1))/n, a(a(n-1))/n) for n <= 250000

Rémy Sigrist, Colored scatterplot of (a(n-a(n-1))/n, a(a(n-1))/n) for n <= 100000000 (where the hue is function of n)

MATHEMATICA

Nest[Function[{a, n}, Append[a, n - a[[a[[-1]] ]] - a[[-a[[-1]] ]] ] ] @@ {#, Length@ # + 1} &, {1, 1}, 80] (* Michael De Vlieger, Aug 07 2018 *)

PROG

(PARI) q=vector(10000); q[1]=q[2]=1; for(n=3, #q, q[n]=n-q[q[n-1]]-q[n-q[n-1]]); q

(MAGMA) I:=[1, 1, 1, 2]; [n le 4 select I[n] else n - Self(Self(n-1)) - Self(n-Self(n-1)): n in [1..100]]; // Vincenzo Librandi, Aug 08 2018

CROSSREFS

Cf. A003160, A004001, A005206, A088462, A189663.

Sequence in context: A029127 A195851 A131754 * A120510 A029117 A308547

Adjacent sequences:  A287419 A287420 A287421 * A287423 A287424 A287425

KEYWORD

nonn

AUTHOR

Altug Alkan, Jun 24 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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 30 14:46 EDT 2020. Contains 337439 sequences. (Running on oeis4.)