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

A060018 a(n) = floor(2*sqrt(n-2)).

Original entry on oeis.org

0, 2, 2, 3, 4, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16
Offset: 2

Views

Author

N. J. A. Sloane, Mar 17 2001

Keywords

Crossrefs

Cf. A060019.

Programs

  • Magma
    [Floor(2*Sqrt(n-2)): n in [2..100]]; // Vincenzo Librandi, Dec 09 2015
    
  • Mathematica
    Floor[2*Sqrt[Range[2,80]-2]] (* Harvey P. Dale, Aug 19 2015 *)
  • PARI
    { default(realprecision, 100); for (n=2, 1000, write("b060018.txt", n, " ", floor(2*sqrt(n - 2))); ) } \\ Harry J. Smith, Jul 01 2009
    
  • PARI
    a(n)=sqrtint(4*n-8) \\ Charles R Greathouse IV, Aug 23 2011
    
  • Python
    from math import isqrt
    def A060018(n): return isqrt(n-2<<2) # Chai Wah Wu, Jun 06 2025

Formula

a(n) = floor(2*sqrt(n-2)) = floor(sqrt(4*n-8)). - Charles R Greathouse IV, Nov 26 2015
G.f.: (Sum_{k>=1} x^(k^2+2) + x^(k^2-k+3))/(1-x)
= (x^2 * (Theta3(x)-1) + x^(11/4) * Theta2(x))/(2-2*x) where Theta2 and Theta3 are Jacobi theta functions. - Robert Israel, Dec 09 2015
a(n) = A000194(n-2) + A000196(n-2) = floor(sqrt(n-2)+1/2) + floor(sqrt(n-2)). - Ridouane Oudra, Jun 07 2019

A297351 Smallest number k such that, for any set S of k distinct nonzero residues mod p = prime(n), any residue mod p can be represented as a sum of zero or more distinct elements of S.

Original entry on oeis.org

1, 2, 3, 4, 6, 6, 7, 8, 9, 10, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 16, 17
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • PARI
    sumHitsAll(v,m)=my(u=[0],n); for(i=1,#v, n=v[i]; u=Set(concat(u,apply(j->(j+n)%m,u))); if(#u==m, return(1))); 0
    a(n,p=prime(n))=for(s=sqrtint(4*p+2)-1,sqrtint(4*p)-1, forvec(v=vector(s,i,[1,p-1]), if(!sumHitsAll(v,p), next(2)), 2); return(s)); sqrtint(4*p)

Formula

For p = prime(n) > 3, sqrt(4p + 5) - 2 < a(n) <= sqrt(4p). The former bound is due to Erdős & Heilbronn and the latter to Olson.

Extensions

a(13) from Charles R Greathouse IV, Jan 27 2018
a(14)-a(22) from Bert Dobbelaere, Apr 20 2019
Showing 1-2 of 2 results.