OFFSET
0,2
COMMENTS
Greene discusses the whole family of sequences defined by a rule of the form a(n) = (Sum_{i=1..k} c_i a(i))/ (Sum_{i=1..k} c_i) if (Sum_{i=1..k} c_i) divides (Sum_{i=1..k} c_i a(i)), a(n) = (Sum_{i=1..k} c_i a(i)) if not, where k and the c_i are nonnegative integers and a(0), ..., a(k-1) are specified initial terms. Many further examples of such sequences could be added to the OEIS!
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
A. M. Amleh et al., On Some Difference Equations with Eventually Periodic Solutions, J. Math. Anal. Appl., 223 (1998), 196-215.
J. Greene, The Unboundedness of a Family of Difference Equations Over the Integers, Fib. Q., 46/47 (2008/2009), 146-152.
MAPLE
A151749 := proc(n) option remember; if n <= 1 then 1+2*n; else prev := procname(n-1)+procname(n-2) ; if prev mod 2 = 0 then prev/2 ; else prev; fi; fi; end: seq(A151749(n), n=0..80) ; # R. J. Mathar, Jun 18 2009
MATHEMATICA
f[{a_, b_}]:=Module[{c=a+b}, If[EvenQ[c], c/2, c]]; Transpose[NestList[ {Last[#], f[#]}&, {1, 3}, 50]][[1]] (* Harvey P. Dale, Oct 12 2011 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Jun 17 2009
EXTENSIONS
More terms from R. J. Mathar, Jun 18 2009
STATUS
approved