login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A283878 An eventually quasilinear solution to Hofstadter's Q recurrence. 3
0, 2, 3, 1, 3, 6, 1, 3, 9, 1, 3, 12, 1, 3, 15, 1, 3, 18, 1, 3, 21, 1, 3, 24, 1, 3, 27, 1, 3, 30, 1, 3, 33, 1, 3, 36, 1, 3, 39, 1, 3, 42, 1, 3, 45, 1, 3, 48, 1, 3, 51, 1, 3, 54, 1, 3, 57, 1, 3, 60, 1, 3, 63, 1, 3, 66, 1, 3, 69, 1, 3, 72, 1, 3, 75 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

a(n) is the solution to the recurrence relation a(n) = a(n-a(n-1)) + a(n-a(n-2)) [Hofstadter's Q recurrence], with the initial conditions: a(n) = 0 if n <= 0; a(1) = 0, a(2) = 2, a(3) = 3, a(4) = 1.

LINKS

Nathan Fox, Table of n, a(n) for n = 1..10000

FORMULA

G.f.: (-x*(x^6 + x^5 + x^3 - x^2 - 3*x - 2)) / ((-1 + x)^2*(1 + x + x^2)^2).

a(n) = 2*a(n-3) - a(n-6) for n > 8.

a(1) = 0, a(2) = 2; thereafter a(3*k) = 3*k, a(3*k+1) = 1, a(3*k+2) = 3.

MAPLE

A283878:=proc(n) option remember: if n <= 0 then 0: elif n = 1 then 0: elif n = 2 then 2: elif n = 3 then 3: elif n = 4 then 1: else A283878(n-A283878(n-1)) + A283878(n-A283878(n-2)): fi: end:

CROSSREFS

Cf. A005185, A188670, A244477, A264756, A283879.

Sequence in context: A180091 A047973 A020501 * A086404 A192852 A152976

Adjacent sequences:  A283875 A283876 A283877 * A283879 A283880 A283881

KEYWORD

nonn,easy

AUTHOR

Nathan Fox, Mar 19 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 | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified February 20 02:47 EST 2018. Contains 299357 sequences. (Running on oeis4.)