OFFSET
1,3
COMMENTS
A variant of the semi-Fibonacci numbers A030067.
Self-describing: the sequence of the absolute differences between odd-indexed terms is the sequence itself.
It appears that the record values form sequence A038754 and occur at indices of the form 2^k-1. - N. J. A. Sloane, May 02 2010
Does the sequence contain every positive integer (cf. A169741)?
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 1..10000
MAPLE
f:=proc(n) option remember; local t1;
if n = 1 then 1
elif n mod 2 = 0 then f(n/2)
else t1:= f(n-2)-f((n-1)/2);
if t1 > 0 then t1 else f(n-2)+f((n-1)/2) fi fi end;
MATHEMATICA
a[1] = 1; a[n_?EvenQ] := a[n/2]; a[n_] := a[n] = If[t1 = a[n-2] - a[(n-1)/2]; t1 > 0, t1, a[n-2] + a[(n-1)/2]]; Table[a[n], {n, 1, 104}] (* Jean-François Alcover, Nov 27 2012, after Maple *)
PROG
(Haskell)
import Data.List (transpose)
a109671 n = a109671_list !! (n-1)
a109671_list = concat (transpose [1 : f 1 a109671_list, a109671_list])
where f u (v:vs) = y : f y vs where
y = if u > v then u - v else u + v
-- Reinhard Zumkeller, Jul 07 2013
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
Eric Angelini, Apr 30 2010
EXTENSIONS
Edited by N. J. A. Sloane, May 02 2010
STATUS
approved