A308879 a(n) is the n-digit integer m that maximizes sin(m).
8, 33, 699, 9929, 51819, 573204, 4846147, 37362253, 288632526, 9251925681, 81129397337, 881156436695
Offset: 1
Examples
For n=3, a(3)=699 since no other 3-digit integer m makes sin(x+m) closer to cos(x) than m=699 does. For example, cos(4.5) = -0.210795799... and sin(4.5+699) = -0.215061112... and no other value of m will make the latter closer to the former.
Crossrefs
Cf. A046959.
Programs
-
C
double e = 1.0; int b = 0, d=1, c=10; int a[10]; // print A to see the results for( int i=0; d<10; i++ ) { double y = double(i*4+1)*PI/2.0; double z = round(y); double f = abs(z-y); int w = int(z); if( w>=c ) { a[d]=b; c*=10; e=1.0; b=0; d++; } if( f< e ) { e=f; b=w; } }
Comments