This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A151749 #13 Jan 05 2025 19:51:39 %S A151749 1,3,2,5,7,6,13,19,16,35,51,43,47,45,46,91,137,114,251,365,308,673, %T A151749 981,827,904,1731,2635,2183,2409,2296,4705,7001,5853,6427,6140,12567, %U A151749 18707,15637,17172,32809,49981,41395,45688,87083,132771,109927,121349,115638 %N A151749 a(0) = 1, a(1) = 3; a(n+2) = (a(n+1) + a(n))/2 if 2 divides (a(n+1) + a(n)), a(n+2) = a(n+1) + a(n) otherwise. %C A151749 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! %H A151749 Harvey P. Dale, <a href="/A151749/b151749.txt">Table of n, a(n) for n = 0..1000</a> %H A151749 A. M. Amleh et al., <a href="https://doi.org/10.1006/jmaa.1998.5971">On Some Difference Equations with Eventually Periodic Solutions</a>, J. Math. Anal. Appl., 223 (1998), 196-215. %H A151749 J. Greene, <a href="https://web.archive.org/web/2024*/https://www.fq.math.ca/Papers1/46_47-2/Greene_1-09.pdf">The Unboundedness of a Family of Difference Equations Over the Integers</a>, Fib. Q., 46/47 (2008/2009), 146-152. %p A151749 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 %t A151749 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 *) %Y A151749 Cf. A069202. %K A151749 nonn,easy %O A151749 0,2 %A A151749 _N. J. A. Sloane_, Jun 17 2009 %E A151749 More terms from _R. J. Mathar_, Jun 18 2009