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

A000194 n appears 2n times, for n >= 1; also nearest integer to square root of n.

Original entry on oeis.org

0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10
Offset: 0

Views

Author

Keywords

Comments

Define the oblong root obrt(x) to be the (larger) solution of y * (y+1) = x; i.e., obrt(x) = sqrt(x+1/4) - 1/2. So obrt(x) is an integer iff x is an oblong number (A002378). Then a(n) = ceiling(obrt(n)). - Franklin T. Adams-Watters, Jun 24 2015
From Wolfdieter Lang, Mar 12 2019: (Start)
The general Pell equation is related to the non-reduced form F(n) = Xvec^T A(n) Xvec = x^2 - D(n)*y^2 with D(n) = A000037(n) (D not a square), Xvec = (x,y)^T (T for transposed) and A(n) = matrix[[1,0], [0,-D(n)]]. The discriminant of F(n) = [1, 0, -D(n)] is 4*D(n).
The first reduced form appears after two applications of an equivalence transformation A' = R^T A R obtained with R = R(t) = matrix([0, -1], [1, t]), namely first with t = 0, leading to the still not reduced form [-D, 0, 1], and then with t = ceiling(f(4*D(n))/2 - 1), where f(4*D(n)) = ceiling(2*sqrt(D(n))). This can be shown to be a(n), which is also D(n) - n, for n >= 1 (see a formula below).
This leads to the reduced form FR(n) = [1, 2*a(n), -(D(n) - a(n)^2)] = [1, 2*a(n), -(n - a(n)*(a(n) - 1))]. Example: n = 5, a(5) = 2: D(5) = 7 and FR(5) = [1, 4, -3]. (End)

Examples

			G.f. = x + x^2 + 2*x^3 + 2*x^4 + 2*x^5 + 2*x^6 + 3*x^7 + 3*x^8 + 3*x^9 + 3*x^10 + ...
		

References

  • Titu Andreescu, Dorin Andrica, and Zuming Feng, 104 Number Theory Problems, Birkhäuser, 2006, 59-60.
  • B. C. Berndt, Ramanujan's Notebooks Part IV, Springer-Verlag, see p. 78, Entry 24.

Crossrefs

Partial sums of A005369.
Cf. A000196 (floor(sqrt(n))), A003059 (ceiling(sqrt(n))).

Programs

  • Haskell
    a000194 n = a000194_list !! (n-1)
    a000194_list = concat $ zipWith ($) (map replicate [2,4..]) [1..]
    -- Reinhard Zumkeller, Mar 18 2011
    
  • Maple
    Digits := 100; f := n->round(evalf(sqrt(n))); [ seq(f(n), n=0..100) ];
    # More efficient:
    a := n -> isqrt(n): seq(a(n), n=0..98); # Peter Luschny, Mar 13 2019
  • Mathematica
    A000194[n_] := Floor[(1 + Sqrt[4 n - 3])/2]; (* Enrique Pérez Herrero, Apr 14 2010 *)
    Flatten[Table[PadRight[{}, 2 n, n], {n, 10}]] (* Harvey P. Dale, Nov 16 2011 *)
    CoefficientList[Series[x QPochhammer[-x^2, x^4] QPochhammer[x^8, x^8]/(1 - x), {x, 0, 50}], x] (* Eric W. Weisstein, Jan 10 2024 *)
  • PARI
    {a(n) = ceil( sqrtint(4*n) / 2)}; /* Michael Somos, Feb 11 2004 */
    
  • PARI
    a(n)=(sqrtint(4*n) + 1)\2 \\ Charles R Greathouse IV, Jun 08 2020
    
  • PARI
    apply( {A000194(n)=sqrtint(4*n)\/2}, [0..99]) \\ M. F. Hasler, Jun 22 2024
    
  • Python
    from math import isqrt
    def A000194(n): return (m:=isqrt(n))+int(n-m*(m+1)>=1) # Chai Wah Wu, Jul 30 2022

Formula

a(n) = A000037(n) - n.
G.f.: x * f(x^2, x^6)/(1-x) where f(,) is Ramanujan's two-variable theta function. - Michael Somos, May 31 2000
a(n) = a(n - 2*a(n - a(n-1))) + 1. - Benoit Cloitre, Oct 27 2002
a(n+1) = a(n) + A005369(n).
a(n) = floor((1/2)*(1 + sqrt(4*n - 3))). - Zak Seidov, Jan 18 2006
a(n) = A000037(n) - n. - Jaroslav Krizek, Jun 14 2009
a(n) = floor(A027434(n)/2). - Gregory R. Bryant, Apr 17 2013
From Mikael Aaltonen, Jan 17 2015: (Start)
a(n) = floor(sqrt(n) + 1/2).
a(n) = sqrt(A053187(n)). (End)
a(0) = 0, and a(n) = k for k from the closed interval [k^2 - k + 1, k*(k+1)] = [A002061(k), A002378(k)], for k >= 1. See A053187. - Wolfdieter Lang, Mar 12 2019
a(n) = floor(2*sqrt(n)) - floor(sqrt(n)). - Ridouane Oudra, Jun 08 2020
Sum_{n>=1} 1/a(n)^s = 2*zeta(s-1), for s > 2 (Borwein, 1994). - Amiram Eldar, Oct 31 2020

Extensions

Additional comments from Michael Somos, May 31 2000
Edited by M. F. Hasler, Mar 01 2014
Initial 0 added by N. J. A. Sloane, Nov 13 2017

A147773 a(n) = round((n^n)^(1/3)).

Original entry on oeis.org

1, 2, 3, 6, 15, 36, 94, 256, 729, 2154, 6583, 20736, 67156, 223150, 759375, 2642246, 9387369, 34012224, 125537306, 471556032, 1801088541, 6989288907, 27536796143, 110075314176, 446169698824, 1832746290156, 7625597484987, 32122422687591
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    lst={};Do[AppendTo[lst,Round[(n^n)^(1/3)]],{n,40}];lst
  • Python
    from gmpy2 import iroot_rem
    def A147773(n):
        i, j = iroot_rem(n**n,3)
        return int(i+int(8*j >= 6*i*(2*i+1)+1)) # Chai Wah Wu, Aug 16 2016

Formula

a(n) = A105209(A000312(n)). - Michel Marcus, Aug 19 2016

A321028 a(n) = 6 + round(n^3) - (minimal number of squares in a dissection of an (n) X (n+1) oblong into squares).

Original entry on oeis.org

5, 4, 3, 3, 3, 3, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Ed Pegg Jr, Oct 26 2018

Keywords

Comments

After a(18) = 2, all terms through a(387) are in (-1,0,1). The first known term outside of this range is a(969) >= 2.

Crossrefs

Formula

a(n) = 6 + A105209(n) - A279317(n).

A338478 Let b be an odd function such that b(0) = 0, b(1) = 1, and for any n > 1 such that 3^x < 2*n < 3^(x+1) for some x > 0, b(n) = b(3^x-n) - 3^x; a(n) = abs(b(n)) for any n >= 0.

Original entry on oeis.org

0, 1, 2, 3, 4, 13, 12, 11, 8, 9, 10, 7, 6, 5, 32, 33, 34, 37, 36, 35, 38, 39, 40, 31, 30, 29, 26, 27, 28, 25, 24, 23, 14, 15, 16, 19, 18, 17, 20, 21, 22, 103, 102, 101, 98, 99, 100, 97, 96, 95, 104, 105, 106, 109, 108, 107, 110, 111, 112, 121, 120, 119, 116
Offset: 0

Views

Author

Rémy Sigrist, Oct 29 2020

Keywords

Comments

This sequence is a self-inverse permutation of the nonnegative integers.
It is possible to build a continuous injective complex-valued function of a real-variable, say f, such that Im(f(r)) = 0 iff r is an integer and for any n in Z, f(n) = b(n) (see illustration in Links section).

Examples

			For n = 3:
- we have 3^1 < 2*3 < 3^(1+1),
- so b(3) = b(3 - 3) - 3 = 0 - 3 = -3,
- a(3) = abs(b(3)) = 3.
		

Crossrefs

Programs

  • PARI
    b(n) = { if (n<0,  return (-b(-n)), n==0, return (0), n==1, return (1), for (x=1, oo, my (w=3^x, h=w\2); if (w<2*n && 2*n<3*w, return (b(w-n)-w)))) }
    a(n) = abs(b(n))

Formula

a(n) = n iff abs(n - 3^x) <= 1 for some x >= 0.

A339276 Nearest integer to the fourth root of n.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
Offset: 1

Views

Author

Amiram Eldar, Dec 13 2020

Keywords

Examples

			a(1) = 1 since 1^(1/4) = 1.
a(6) = 2 since 6^(1/4) = 1.565... and its nearest integer is 2.
		

Crossrefs

Programs

  • Mathematica
    Table[Round[Surd[n, 4]], {n, 1, 100}]
  • Python
    from sympy import integer_nthroot
    def A339276(n): return (m:=integer_nthroot(n,4)[0])+((n<<4)>=((m<<1)+1)**4) # Chai Wah Wu, Jun 06 2025

Formula

Sum_{n>=1} 1/a(n)^s = 4*zeta(s-3) + zeta(s-1), for s>4 (Borwein, 1994).
Showing 1-5 of 5 results.