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!)
A284429 A quasilinear solution to Hofstadter's Q recurrence. 1
2, 1, 3, 5, 1, 3, 8, 1, 3, 11, 1, 3, 14, 1, 3, 17, 1, 3, 20, 1, 3, 23, 1, 3, 26, 1, 3, 29, 1, 3, 32, 1, 3, 35, 1, 3, 38, 1, 3, 41, 1, 3, 44, 1, 3, 47, 1, 3, 50, 1, 3, 53, 1, 3, 56, 1, 3, 59, 1, 3, 62, 1, 3, 65, 1, 3, 68, 1, 3, 71, 1, 3, 74, 1, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

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(1) = 2, a(2) = 1.

This sequence is a close relative of A283878.

LINKS

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

FORMULA

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

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

a(3*k)   = 3,

a(3*k+1) = 3*k+2,

a(3*k+2) = 1.

MAPLE

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

MATHEMATICA

CoefficientList[Series[(-3*x^5 - x^4 + x^3 + 3*x^2 + x + 2) / ((-1 + x)^2*(1 + x + x^2)^2), {x, 0, 100}], x] (* Indranil Ghosh, Mar 27 2017 *)

PROG

(PARI) Vec((-3*x^5 - x^4 + x^3 + 3*x^2 + x + 2) / ((-1 + x)^2*(1 + x + x^2)^2) + O(x^100)) \\ Indranil Ghosh, Mar 27 2017

CROSSREFS

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

Sequence in context: A239306 A129322 A089984 * A062105 A210563 A236311

Adjacent sequences:  A284426 A284427 A284428 * A284430 A284431 A284432

KEYWORD

nonn,easy

AUTHOR

Nathan Fox, Mar 26 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 August 17 08:02 EDT 2022. Contains 356184 sequences. (Running on oeis4.)