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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A244477 a(1)=3, a(2)=2, a(3)=1; thereafter a(n) = a(n-a(n-1)) + a(n-a(n-2)). 38
3, 2, 1, 3, 5, 4, 3, 8, 7, 3, 11, 10, 3, 14, 13, 3, 17, 16, 3, 20, 19, 3, 23, 22, 3, 26, 25, 3, 29, 28, 3, 32, 31, 3, 35, 34, 3, 38, 37, 3, 41, 40, 3, 44, 43, 3, 47, 46, 3, 50, 49, 3, 53, 52, 3, 56, 55, 3, 59, 58, 3, 62, 61, 3, 65, 64, 3, 68, 67, 3, 71, 70, 3, 74, 73, 3, 77, 76, 3, 80 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

Similar to Hofstadter's Q-sequence A005185 but with different starting values.

Golomb describes this as "quasi-periodic sequence with a quasi-period of 3".

REFERENCES

Higham, J.; Tanny, S. More well-behaved meta-Fibonacci sequences. Proceedings of the Twenty-fourth Southeastern International Conference on Combinatorics, Graph Theory, and Computing (Boca Raton, FL, 1993). Congr. Numer. 98(1993), 3-17.

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 1..10000

Altug Alkan, Nathan Fox, and Orhan Ozgur Aybar, On Hofstadter Heart Sequences, Complexity, Volume 2017, Article ID 2614163, 8 pages.

Nathan Fox, Linear-Recurrent Solutions to Meta-Fibonacci Recurrences, Part 1 (video), Rutgers Experimental Math Seminar, Oct 01 2015. Part 2 is vimeo.com/141111991.

S. W. Golomb, Discrete chaos: sequences satisfying "strange" recursions, unpublished manuscript, circa 1990 [cached copy, with permission (annotated)]

Index entries for Hofstadter-type sequences

FORMULA

From Colin Barker, Nov 23 2015: (Start)

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

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

a(3*k) = 3*k-2, a(3*k+1) = 3, a(3*k+2) = 3*k+2. - Nathan Fox, Apr 02 2017

a(n) = 3*(m-1)^2*floor(n/3) - (3*m^2-8*m+2), where m = n mod 3. - Luce ETIENNE, Oct 17 2018

MAPLE

f := proc(n) option remember;

    if n<=3 then

        4-n

    elif n > procname(n-1) and n > procname(n-2) then

        RETURN(procname(n-procname(n-1))+procname(n-procname(n-2)));

    else

        ERROR(" died at n= ", n);

    fi;

end proc;

[seq(f(n), n=0..200)];

MATHEMATICA

a[1] = 3; a[2] = 2; a[3] = 1; a[n_] := a[n] = a[n - a[n - 1]] + a[n - a[n - 2]]; Array[a, 75] (* or *)

Flatten@ Table[{Mod[3n, 3] +3, 3n -1, 3n -2}, {n, 25}] (* Robert G. Wilson v, Nov 23 2015 *)

PROG

(Haskell)

a244477 n = a244477_list !! (n-1)

a244477_list = 3 : 2 : 1 : zipWith (+)

   (map a244477 $ zipWith (-) [4..] $ tail a244477_list)

   (map a244477 $ zipWith (-) [4..] $ drop 2 a244477_list)

-- Reinhard Zumkeller, Jul 05 2014

(MAGMA) [n le 3 select 4-n else Self(n-Self(n-1)) + Self(n-Self(n-2)): n in [1..80]]; // Vincenzo Librandi, Nov 24 2015

CROSSREFS

Cf. A005185.

Cf. A010872.

Sequence in context: A129690 A156665 A215415 * A035572 A325531 A115215

Adjacent sequences:  A244474 A244475 A244476 * A244478 A244479 A244480

KEYWORD

nonn,easy

AUTHOR

N. J. A. Sloane, Jul 02 2014

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 November 19 19:18 EST 2019. Contains 329323 sequences. (Running on oeis4.)