login
A214839
Ratios of consecutive terms approach Pi alternating from below and above.
1
1, 3, 10, 31, 98, 307, 965, 3031, 9523, 29917, 93988, 295272, 927625, 2914219, 9155290, 28762191, 90359088, 283871447, 891808453, 2801698884, 8801796632, 27651659637, 86870250776, 272910941653, 857375009382, 2693523030845, 8461952165978, 26584006759664
OFFSET
1,2
COMMENTS
The alternation of ratios above and below is chosen to match the behavior of ratios of the Fibonacci numbers with respect to the golden ratio.
LINKS
EXAMPLE
a(2) = 3 since 3/1 < Pi, while 4/1 > Pi. a(3) = 10 since 10/3 > Pi, while 9/3 < Pi.
MATHEMATICA
PiApprox = Table[1, {i, 1, 40}]; For[i = 2, i < 41, i++, If[Mod[i, 2] == 0, PiApprox[[i]] = Floor[PiApprox[[i - 1]]*Pi], PiApprox[[i]] = Ceiling[PiApprox[[i - 1]]*Pi]]]
PROG
(Sage)
def A214839(numterms) :
res = [1]
for i in range(1, numterms) :
res.append(floor(pi*res[i-1]) if is_odd(i) else ceil(pi*res[i-1]))
return res
# Eric M. Schmidt, Mar 26 2013
CROSSREFS
Sequence in context: A068094 A100058 A002160 * A114487 A017934 A005510
KEYWORD
easy,nonn
AUTHOR
William J. Keith, Mar 08 2013
STATUS
approved