login
A231603
Floor of the arithmetic-geometric mean of n+n and n*n.
1
0, 1, 4, 7, 11, 16, 22, 28, 35, 43, 52, 61, 70, 81, 92, 103, 115, 128, 141, 155, 170, 185, 200, 216, 233, 250, 268, 286, 305, 325, 344, 365, 386, 408, 430, 452, 475, 499, 523, 548, 573, 598, 625, 651, 678, 706, 734, 763, 792, 822, 852, 883, 914, 945, 978, 1010, 1043, 1077, 1111, 1145, 1180, 1216, 1252, 1288, 1325
OFFSET
0,3
COMMENTS
Arithmetic-geometric mean of n+n and n*n.
AGM of the sum and product of n and n.
a(n) = agm(A005843(n), A000290(n)).
FORMULA
a(n) = floor(agm(n+n,n*n)).
EXAMPLE
a(2) = floor(agm(2+2, 2*2)) = floor(agm(4, 4)) = 4.
a(5) = floor(agm(10.0, 25.0)) = floor(agm(17.5, 15.811388)) = floor(agm(16.655695, 16.634281)) = floor(agm(16.644987, 16.644983)) = floor(16.644987) = 16.
MATHEMATICA
Table[Floor[ArithmeticGeometricMean[2n, n^2]], {n, 0, 70}] (* Harvey P. Dale, Aug 03 2014 *)
PROG
(Java) public class Agmnxn {
private static final double TOLERANCE = Math.pow(10, -4);
private static final long LENGTH = 250;
public static void main(String[] args) {
String series="";
long n=0;
while (series.length()<LENGTH) {
long x=(long) Math.floor(agm(n+n, n*n));
series+=x+", ";
n++;
}
System.out.println(series);
}
private static double agm(double a, double g) {
return Math.abs(a-g)<TOLERANCE?a:agm((a+g)/2, Math.sqrt(a*g));
}
}
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
John R Phelan, Nov 11 2013
STATUS
approved