cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-6 of 6 results.

A046964 Sin(n) decreases monotonically to -1.

Original entry on oeis.org

1, 3, 4, 5, 11, 344, 1054, 1764, 2474, 3184, 3894, 4604, 5314, 6024, 6734, 7444, 8154, 8864, 9574, 10284, 10994, 11704, 12414, 13124, 13834, 14544, 15254, 15964, 16674, 17384, 18094, 18804, 19514, 20224, 20934, 21644, 22354, 23064, 23774, 24484, 25194, 25904
Offset: 1

Views

Author

Keywords

Comments

Sin(10265498) =-0.9999999999999999313932793053103935998520142594607...

Crossrefs

Programs

  • Mathematica
    z={}; current=1; Timing[ Do[ If[ Sin[ n ] d, d = a; Print@n; AppendTo[lst, n]], {n, 111111111}]; lst (* Robert G. Wilson v, Aug 24 2007 *)
  • PARI
    d=oo; print1("1, 3, "); for(k=1,10^8, my(di=2*k/Pi,dir=round(di),dd);if(dir%4==3,dd=abs(di-dir); if(ddHugo Pfoertner, Feb 29 2020

A228784 Permutation of the positive integers related to the "Sine tree" (see Comments lines for construction details).

Original entry on oeis.org

1, 3, 2, 4, 8, 9, 5, 7, 10, 18, 16, 37, 21, 15, 43, 75, 33, 36, 20, 14, 11, 19, 17, 34, 38, 22, 29, 41, 73, 66, 150, 86, 31, 172, 300, 132, 147, 83, 59, 44, 76, 68, 35, 39, 6, 13, 79, 71, 136, 152, 88, 119, 167, 295, 264, 600, 344, 62, 173, 301, 133, 146, 82
Offset: 1

Views

Author

Paul Tek, Oct 04 2013

Keywords

Comments

The "Sine tree" is constructed according to this procedure:
take an infinite complete binary tree,
initially, the nodes have no value,
for each n=1,2,3,...:
move to the root node,
while the current node has a value:
if sin(n)
else move to the right child node.
assign the value n to the current node.
As the set {sin(1), sin(2), sin(3), ...} is dense in the open interval ]-1, +1[, each node will eventually have a value.
a(n) corresponds to the "index" of the node with value n:
- the index of the root node is 1,
- the index of the left child of the node with index k is 2*k,
- the index of the right child of the node with index k is 2*k+1.
a(A046959(n)) = 2^(n-1)-1, for any n>1.
a(A046964(n)) = 2^(n-1), for any n>0.

Examples

			For n=1: the root node has no value, so we assign it the value 1, and a(1)=1.
For n=2: the root node has value 1, and sin(2)>sin(1), so we move to the right child node. This node has no value, so we assign it the value 2, and a(2)=2*1+1.
For n=3: the root node has value 1, and sin(3)<sin(1), so we move to the left child node. This node has no value, so we assign it the value 3, and a(3)=2*1.
		

Crossrefs

Programs

  • Perl
    See Links section.

A229976 Inverse permutation to A228784.

Original entry on oeis.org

1, 3, 2, 4, 7, 45, 8, 5, 6, 9, 21, 310, 46, 20, 14, 11, 23, 10, 22, 19, 13, 26, 334, 378, 104038, 89, 309, 335, 27, 341, 33, 344, 17, 24, 43, 18, 12, 25, 44, 336
Offset: 1

Author

Paul Tek, Oct 05 2013

Keywords

Comments

a(A228784(n))=n, for any n>0.
a(2^n-1)=A046959(n+1), for any n>0.
a(2^n)=A046964(n+1), for any n>=0.

Crossrefs

A172451 a(1) = 1, and for each n >= 2, a(n) is the smallest number such that 1/sin(a(n)) < 1/sin(a(k)) for all k < n, so that 1/sin(a(1)) > 1/sin(a(2)) > ... > 1/sin(a(n)) > ...

Original entry on oeis.org

1, 2, 4, 6, 22, 333, 355, 103993, 104348, 1042060, 1146408, 4272943, 5419351, 80143857
Offset: 1

Author

Michel Lagneau, Feb 03 2010

Keywords

Examples

			1/sin(1) = 1.1883951; 1/sin(2) = 1.0997501; 1/sin(4) = - 1.3213487.
		

References

  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 83, p. 29, Ellipses, Paris 2008. Also Entry 137, p. 47.

Programs

  • Maple
    a:= evalf(1/sin(1)); for n from 2 to 10000000 do; if a > evalf(1/sin(n)) then a:= evalf(1/sin(n)); print(n); else fi ; od;
  • Mathematica
    vm = 2; s = {}; Do[v = 1/Sin[n]; If[v < vm, vm = v; AppendTo[s, n]], {n, 1, 110000}]; s (* Amiram Eldar, Aug 10 2019 *)
  • PARI
    lista(NN) = {my(x=2); for(k=1, NN, if(1/sin(k)Jinyuan Wang, Aug 12 2019

Extensions

a(13) corrected and a(14) added by Amiram Eldar, Aug 10 2019

A308879 a(n) is the n-digit integer m that maximizes sin(m).

Original entry on oeis.org

8, 33, 699, 9929, 51819, 573204, 4846147, 37362253, 288632526, 9251925681, 81129397337, 881156436695
Offset: 1

Author

Inigo Quilez, Feb 12 2020

Keywords

Comments

a(n) is also the n-digit integer that minimizes the mean square error of the approximation sin(x+m) for cos(x) over [0, 2*Pi].
Naturally, sin(a(n)) is the best approximation to 1 for an n-digit integer argument. a(n) is the closest integer to an n-digit number of the form (4k+1)*Pi/2. Often used to compute an approximated rotation matrix with just a few number of characters of code, as in M = sin(x+{0,699,-699,0}). It is not guaranteed that each term in the sequence produces a better approximation than the previous one, although numerical evidence suggests so. It is therefore also not guaranteed to be a subsequence of A046959.

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; }
      }

A385636 Numbers k where sin(sqrt(k)) reaches successive record high values.

Original entry on oeis.org

0, 1, 2, 60, 61, 62, 200, 417, 2687, 1536009, 57157270, 81436635, 143005063, 706132910, 2016118929
Offset: 1

Author

Artur Jasinski, Jul 05 2025

Keywords

Comments

Each record value is ever closer to 1, but never reaches 1 since Pi is not algebraic.

Examples

			         n sin(sqrt(n))
         0 0.00000000000000000000000000000000000000
         1 0.84147098480789650665250232163029899962
         2 0.98776594599273552706913407207894265590
        60 0.99417205583623141588832072787265937649
        61 0.99904391031188045397420593007730566087
        62 0.99979948155661636906716009313812999866
       200 0.99998765612212040379361805662023274661
       417 0.99999997455044116794629686048124083679
      2687 0.99999999999810547903298251324014875470
   1536009 0.99999999999999044600166587966774547198
  57157270 0.99999999999999422252795052032516595669
  81436635 0.99999999999999964054666338696864815400
 143005063 0.99999999999999999572901646060974247156
 706132910 0.99999999999999999879205185535546721950
2016118929 0.99999999999999999996673765988843841836
		

Crossrefs

Programs

  • Mathematica
    max = -2; aa = {}; Do[kk = N[Sin[Sqrt[n]], 50]; If[kk > max, max = kk; Print[{n, kk}]; AppendTo[aa, n]], {n, 0, 150000000}]; aa

Extensions

a(14)-a(15) from David Consiglio, Jr., Jul 14 2025
Showing 1-6 of 6 results.