%I #14 Aug 11 2015 15:24:14
%S 1,2,4,5,7,9,11,12,14,16,18,20,21,23,25,27,29,31,33,34,36,38,40,42,44,
%T 46,48,50,51,53,55,57,59,61,63,65,67,69,71,72,74,76,78,80,82,84,86,88,
%U 90,92,94,95,97,99,101,103,105,107,109,111,113,115,117,119,121,122,124
%N (a(n)) is the earliest monotonic sequence starting with a(1)=1 and satisfying a(n)=length of n-th run of consecutive integers with same parity.
%C There are a(1) odd terms, a(2) even terms, a(3) odd terms, a(4) even terms ... - _Benoit Cloitre_, May 26 2004
%C A variation on Golomb's sequence A001462.
%H T. D. Noe, <a href="/A093848/b093848.txt">Table of n, a(n) for n=1..1000</a>
%F it seems that a(n) = 2n - a*n^b + o(n^b) where a and b are 2 suitable constants. b=0.4.... Does b=2-phi where phi is the golden ratio?
%e Sequence begins: (1),(2,4),(5,7,9,11),(12,14,16,18,20),(21,.... since the number of elements in each run of odd or even integers is 1, 2, 4, 5, ... the sequence itself.
%p A093848 := proc(nmax) local n,par,a,alast,j ; n := 3 ; par := 1 ; a := [1,2,4] ; while nops(a) < nmax do alast := op(-1,a); if type(alast,'even') = type(par,'even') then ; else alast := alast -1 ; end if; for j from 1 to op(n,a) do a := [op(a), alast+2*j] ; end do: par := 1-par ; n := n+1 ; end do: a ; end proc: A093848(120) ; # _R. J. Mathar_, Jun 22 2010
%t t={1,2,4}; Do[t=Join[t,Table[t[[-1]]+2*i-1, {i,t[[n]]}]], {n,3,40}]
%Y Cf. A001462, A049039, A169863.
%K nonn
%O 1,2
%A _Benoit Cloitre_, May 21 2004
%E Terms starting at a(52) corrected by _R. J. Mathar_, Jun 22 2010
|