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!)
A226222 a(1) = a(2) = a(3) = 1, a(n) = a(n-2-a(n-2)) + a(n-1-a(n-3)) for n>3. 7
1, 1, 1, 2, 2, 3, 3, 3, 4, 5, 5, 5, 6, 6, 7, 7, 8, 9, 9, 9, 10, 10, 11, 11, 11, 12, 13, 13, 13, 14, 15, 16, 16, 16, 17, 18, 18, 18, 18, 19, 20, 21, 21, 21, 21, 22, 22, 23, 23, 24, 25, 25, 25, 26, 26, 27, 27, 28, 29, 30, 30, 30, 31, 32, 32, 32, 32, 33, 35, 35 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
COMMENTS
First numbers not occurring: 62, 66, 75, 79, 114, 123, ... .
LINKS
Eric Weisstein's World of Mathematics, Hofstadter's Q-Sequence
FORMULA
a(n) = a(n-2 - a(n-2)) + a(n-1 - a(n-3)), with a(1) = a(2) = a(3) = 1.
MATHEMATICA
a[n_]:= a[n]= If[n<4, 1, a[n-2 -a[n-2]] + a[n-1 -a[n-3]]];
Table[a[n], {n, 80}] (* G. C. Greubel, Mar 28 2022 *)
PROG
(Haskell)
a226222 n = a226222_list !! (n-1)
a226222_list = 1 : 1 : 1 : zipWith (+)
(map a226222 $ zipWith (-) [3..] a226222_list)
(map a226222 $ zipWith (-) [2..] $ tail a226222_list)
-- Reinhard Zumkeller, May 31 2013
(Sage)
@CachedFunction
def a(n): # A226222
if (n<4): return 1
else: return a(n-2-a(n-2)) + a(n-1-a(n-3))
[a(n) for n in (1..80)] # G. C. Greubel, Mar 28 2022
CROSSREFS
Sequence in context: A351833 A354967 A125186 * A140473 A115384 A131411
KEYWORD
nonn,look
AUTHOR
Reinhard Zumkeller, May 31 2013
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 April 27 09:38 EDT 2024. Contains 372017 sequences. (Running on oeis4.)