login
A022018
Define the sequence UD(a(0),a(1)) by a(n) is the least integer such that a(n)/a(n-1) > a(n-1)/a(n-2)+1 for even n >= 2 and such that a(n)/a(n-1) > a(n-1)/a(n-2) for odd n>=2. This is UD(2,16).
12
2, 16, 129, 1040, 8385, 67604, 545057, 4394520, 35430801, 285660700, 2303138321, 18569044064, 149712848033, 1207059275044, 9731910872129, 78463494859944, 632611632651505, 5100428912583468, 41122188953879473, 331547494013013232, 2673100425407651457
OFFSET
0,1
COMMENTS
The definition uses a recurrence of Shallit's S(a0,a1) sequences if n is even and Pisot T(a0,a1) sequences if n is odd. The UD notation reflects that we are rounding up or down depending on the position in the sequence. - David Boyd, Feb 12 2016
FORMULA
Empirical g.f: (2-x^2)/(1-8*x-x^2+4*x^3), holds at least up to n<=50000. - Robert Israel, Feb 10 2016
The empirical g.f. found by Robert Israel has been proved. One needs only the definition and the first 6 terms of the sequence. The denominator of the g.f. is the reciprocal of a Pisot polynomial with 2nd largest root real and negative. - David Boyd, Mar 06 2016
a(n) = 8*a(n-1)+a(n-2)-4*a(n-3) for n>2. - Colin Barker, Aug 09 2016
MAPLE
UD := proc(a0, a1, n)
option remember;
if n = 0 then
a0 ;
elif n = 1 then
a1;
elif type(n, 'even') then
floor( procname(a0, a1, n-1)^2/procname(a0, a1, n-2)+1) ;
else
floor( procname(a0, a1, n-1)^2/procname(a0, a1, n-2)) ;
end if;
end proc:
A022018 := proc(n)
UD(2, 16, n) ;
end proc: # R. J. Mathar, Feb 12 2016
MATHEMATICA
LinearRecurrence[{8, 1, -4}, {2, 16, 129}, 30] (* Jean-François Alcover, Dec 12 2016 *)
PROG
(PARI) a=[2, 16, 129]; c=Colrev([8, 1, -4]); for(n=2, 20, a=concat(a, a[-3..-1]*c)); a \\ Reproduces the data. - M. F. Hasler, Feb 10 2016
(Magma) Iv:=[2, 16]; [n le 2 select Iv[n] else Floor(Self(n-1)^2/Self(n-2))+(1-(-1)^n)/2: n in [1..20]]; // Bruno Berselli, Feb 11 2016
CROSSREFS
Sequence in context: A012463 A037517 A037720 * A067684 A360321 A074623
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
Definition clarified based on consultance with David Boyd by Robert Israel, Feb 12 2016
STATUS
approved