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-8 of 8 results.

A057048 a(n) = A017911(n+1) = round(sqrt(2)^(n+1)).

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 11, 16, 23, 32, 45, 64, 91, 128, 181, 256, 362, 512, 724, 1024, 1448, 2048, 2896, 4096, 5793, 8192, 11585, 16384, 23170, 32768, 46341, 65536, 92682, 131072, 185364, 262144, 370728, 524288, 741455, 1048576
Offset: 0

Views

Author

M. F. Hasler, Feb 20 2012

Keywords

Comments

If the natural numbers A000027 are written as a triangle, then a(n) gives the row of the triangle in which the number 2^n can be found. See A017911 for a more elaborate explanation and relation with A000217. [Original definition by Clark Kimberling, Jul 30 2000, clarified by M. F. Hasler, Feb 20 2012, following an observation from T. D. Noe, Apr 27 2003]

Examples

			Write the natural numbers A000027 as a triangle:
row 1: 1 . . . <- 2^0 in row 1=a(0)
row 2: 2 3 . . . <- 2^1 in row 2=a(1)
row 3: 4 5 6 . . . <- 2^2 in row 3=a(2)
row 4: 7 8 9 10 . . <- 2^3 in row 4=a(3)
row 5: 11 12 13 14 15
row 6: 16 17 18 19 20 21 <- 2^4 in row 6=a(4).
		

Programs

  • Magma
    [Round(Sqrt(2)^(n+1)): n in [0..50]]; // Vincenzo Librandi, Mar 24 2013
    
  • Mathematica
    Table[Round[Sqrt[2]^(n+1)], {n, 0, 50}] (* Vincenzo Librandi, Mar 24 2013 *)
  • PARI
    A057048(n)=round(sqrt(2^(n+1)))  /* for large values, an implementation using integer arithmetic would be preferable */ \\ M. F. Hasler, Feb 20 2012
    
  • PARI
    a(n)=sqrtint(2^(n+1)) \\ Charles R Greathouse IV, Aug 19 2016
    
  • Python
    from math import isqrt
    def A057048(n): return -isqrt(m:=1<Chai Wah Wu, Jun 18 2024

Formula

a(2n-1) = 2^n, n > 0. - M. F. Hasler, Feb 20 2012

A001521 a(1) = 1; thereafter a(n+1) = floor(sqrt(2*a(n)*(a(n)+1))).

Original entry on oeis.org

1, 2, 3, 4, 6, 9, 13, 19, 27, 38, 54, 77, 109, 154, 218, 309, 437, 618, 874, 1236, 1748, 2472, 3496, 4944, 6992, 9888, 13984, 19777, 27969, 39554, 55938, 79108, 111876, 158217, 223753, 316435, 447507, 632871, 895015, 1265743, 1790031, 2531486, 3580062, 5062972
Offset: 1

Views

Author

Keywords

Comments

Graham and Pollak give an elementary proof of the following result: For given m, define a(n) by a(1) = m and a(n+1) = floor(sqrt(2*a_n*(a_n + 1))), n >= 1. Then a(n) = tau_m(2^((n-1)/2) + 2^((n-2)/2)) where tau_m is the m-th smallest element of {1, 2, 3, ... } union { sqrt(2), 2*sqrt(2), 3*sqrt(2), ... }. For m=1 it follows as a curious corollary that a(2n+1) - 2*a(2n-1) is exactly the n-th bit in the binary expansion of sqrt(2) (A004539).
a(n) is also the curvature (rounded down) of the circle inscribed in the n-th 45-45-90 triangle arranged in a spiral as shown in the illustration in the links section. - Kival Ngaokrajang, Aug 21 2013

References

  • R. L. Graham, D. E. Knuth and O. Pataschnic, Concrete Mathematics, Addison-Wesley, Reading (1994) 2nd Ed., Ex. 3.46.
  • F. K. Hwang, and Shen Lin. "An analysis of Ford and Johnson's sorting algorithm." In Proc. Third Annual Princeton Conf. on Inform. Sci. and Systems, pp. 292-296. 1969.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000196.
First, second, and third differences give A017911, A190660, A241576.

Programs

  • Haskell
    a001521 n = a001521_list !! (n-1)
    a001521_list = 1 : (map a000196 $ zipWith (*)
                        (map (* 2) a001521_list) (map (+ 1) a001521_list))
    -- Reinhard Zumkeller, Dec 16 2013
    
  • Magma
    [Floor(Sqrt(2)^(n-1)+Sqrt(2)^(n-2)): n in [1..45]]; // Vincenzo Librandi, May 24 2015
    
  • Maple
    Digits:=200;
    f:=proc(n) option remember;
    if n=1 then 1 else floor(sqrt(2*f(n-1)*(f(n-1)+1))); fi; end;
    [seq(f(n),n=1..200)];
  • Mathematica
    With[{c=Sqrt[2]},Table[Floor[c^(n-1)+c^(n-2)],{n,1,50}]] (* Harvey P. Dale, May 11 2011 *)
    NestList[Floor[Sqrt[2#(#+1)]]&,1,50] (* Harvey P. Dale, Aug 28 2013 *)
  • PARI
    a(n)=if(n>1, sqrtint(2^(n-1)) + sqrtint(2^(n-2)), 1) \\ Charles R Greathouse IV, Nov 27 2016
    
  • PARI
    first(n)=my(v=vector(n)); v[1]=1; for(k=2,n, v[k]=sqrtint(2*(v[k-1]+1)*v[k-1])); v \\ Charles R Greathouse IV, Jan 23 2020
  • Sage
    [floor(sqrt(2)^(n-1))+ floor(sqrt(2)^(n-2)) for n in (1..50)] # Bruno Berselli, May 25 2015
    

Formula

a(n) = floor( sqrt(2)^(n-1) ) + floor( sqrt(2)^(n-2) ), n>1. - Ralf Stephan, Sep 18 2004
k * sqrt(2)^n - 2 < a(n) < k * sqrt(2)^n, where k = (1 + sqrt(2))/2 = A174968 = 1.2071.... Probably the first inequality can be improved (!). - Charles R Greathouse IV, Jan 23 2020

Extensions

Additional comments from Torsten Sillke, Apr 06 2001

A329278 Irregular table read by rows. The n-th row is the permutation of {0, 1, 2, ..., 2^n-1} given by T(n,k) = k(k+1)/2 (mod 2^n).

Original entry on oeis.org

0, 0, 1, 0, 1, 3, 2, 0, 1, 3, 6, 2, 7, 5, 4, 0, 1, 3, 6, 10, 15, 5, 12, 4, 13, 7, 2, 14, 11, 9, 8, 0, 1, 3, 6, 10, 15, 21, 28, 4, 13, 23, 2, 14, 27, 9, 24, 8, 25, 11, 30, 18, 7, 29, 20, 12, 5, 31, 26, 22, 19, 17, 16, 0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 2
Offset: 0

Views

Author

Peter Kagey, Nov 11 2019

Keywords

Comments

Conjecture: for n > 0, the n-th row has 2^(n-1)-1 descents.
T(n,k) = A000217(k) for 0 <= k <= A017911(n+1), and T(n,2^n-1) = 2^(n-1).

Examples

			Table begins:
  0;
  0, 1;
  0, 1, 3, 2;
  0, 1, 3, 6,  2,  7, 5,  4;
  0, 1, 3, 6, 10, 15, 5, 12, 4, 13, 7, 2, 14, 11, 9, 8;
  ...
		

Crossrefs

Programs

  • Maple
    T:= (n, k)-> irem(k*(k+1)/2, 2^n):
    seq(seq(T(n, k), k=0..2^n-1), n=0..6);  # Alois P. Heinz, Jan 08 2020

A001675 a(n) = round(sqrt( 2*Pi )^n).

Original entry on oeis.org

1, 3, 6, 16, 39, 99, 248, 622, 1559, 3907, 9793, 24546, 61529, 154230, 386598, 969056, 2429064, 6088760, 15262259, 38256810, 95895601, 240374624, 602529829, 1510318305, 3785806568, 9489609784, 23786924201, 59624976768, 149457652642, 374634777972
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A001674 (floor sqrt(2 Pi)^n), A001698 (ceiling sqrt(2 Pi)^n).
Cf. A017911 (round sqrt(2)), A000227 (round e^n), A002160 (round Pi^n).

Programs

  • Mathematica
    Table[Floor[Sqrt[2*Pi]^n + 1/2], {n, 0, 50}] (* T. D. Noe, Aug 09 2012 *)
    Round[(Sqrt[2*Pi])^Range[0,30] ] (* Harvey P. Dale, Jun 05 2018 *)
  • PARI
    apply( a(n)=(2*Pi)^(n/2)\/1, [0..40]) \\ M. F. Hasler, May 29 2018

A190660 Number of triangular numbers T(k) between powers of 2, 2^(n-1) < T(k) <= 2^n.

Original entry on oeis.org

1, 0, 1, 1, 2, 2, 3, 5, 7, 9, 13, 19, 27, 37, 53, 75, 106, 150, 212, 300, 424, 600, 848, 1200, 1697, 2399, 3393, 4799, 6786, 9598, 13573, 19195, 27146, 38390, 54292, 76780, 108584, 153560, 217167, 307121, 434334, 614242, 868669, 1228483, 1737338, 2456966
Offset: 0

Views

Author

John W. Nicholson, May 16 2011

Keywords

Comments

Count of triangular numbers between powers of 2.
a(n)/a(n-1) converges to sqrt(2) (A002193). [John W. Nicholson, May 16 2011]
Essentially first differences of A017911. - Jeremy Gardiner, Aug 11 2013. Also second differences of A001521. - N. J. A. Sloane, Apr 27 2014

Examples

			Between 2^(6-1)=32 and 2^6=64 are T(8)=36, T(9)=45, T(10)=55 so A190660(6)=3.
		

Crossrefs

Programs

  • Mathematica
    TriangularIndex[n_] := (-1 + Sqrt[1 + 8*n])/2; Differences[Table[Floor[TriangularIndex[2^n]], {n, -1, 50}]] (* T. D. Noe, May 19 2011 *)
  • PARI
    a(n) = if (n==0, 1, sum(i=2^(n-1)+1, 2^n, ispolygonal(i, 3))); \\ Michel Marcus, Apr 28 2014

Extensions

Extended by T. D. Noe, May 19 2011

A017929 Powers of sqrt(8) rounded to nearest integer.

Original entry on oeis.org

1, 3, 8, 23, 64, 181, 512, 1448, 4096, 11585, 32768, 92682, 262144, 741455, 2097152, 5931642, 16777216, 47453133, 134217728, 379625062, 1073741824, 3037000500, 8589934592, 24296004000, 68719476736
Offset: 0

Views

Author

Keywords

Programs

Formula

a(n) = A017911(3n). - R. J. Mathar, Apr 28 2008

A241576 Third differences of A001521.

Original entry on oeis.org

0, 1, 0, 0, 1, 0, 1, 2, 2, 2, 4, 6, 8, 10, 16, 22, 31, 44, 62, 88, 124, 176, 248, 352, 497, 702, 994, 1406, 1987, 2812, 3975, 5622, 7951, 11244, 15902, 22488, 31804, 44976, 63607, 89954, 127213, 179908, 254427, 359814, 508855, 719628, 1017709
Offset: 1

Views

Author

N. J. A. Sloane, Apr 27 2014

Keywords

Crossrefs

Programs

  • Mathematica
    Differences[NestList[Floor[Sqrt[2#(#+1)]]&,1,50],3] (* Harvey P. Dale, Dec 17 2019 *)

A305289 Powers of 2*Pi, rounded to the nearest integer.

Original entry on oeis.org

1, 6, 39, 248, 1559, 9793, 61529, 386598, 2429064, 15262259, 95895601, 602529829, 3785806568, 23786924201, 149457652642, 939070127125, 5900351625162, 37073002638414, 232936545470713, 1463583480006755, 9195966217409213, 57779959822545404, 363042194606444109, 2281061383037441740
Offset: 0

Views

Author

M. F. Hasler, May 29 2018

Keywords

Crossrefs

Cf. A001674 (floor(sqrt(2 Pi)^n)), A001675 (round sqrt(2 Pi)^n), A001698 (ceiling sqrt(2 Pi)^n), A017911 (round sqrt(2)^n), A000227 (round e^n), A002160 (round Pi^n).

Programs

  • Mathematica
    Round[(2Pi)^Range[0,30]] (* Harvey P. Dale, Aug 12 2021 *)
  • PARI
    apply( a(n)=(2*Pi)^n\/1, [0..40])

Formula

a(n) = round((2 Pi)^n) = A001675(2*n) >= A001674(2n).
Showing 1-8 of 8 results.