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.

A055086 n appears 1+[n/2] times.

Original entry on oeis.org

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

Views

Author

Michael Somos, Jun 13 2000

Keywords

Comments

The PARI functions t1, t2 can be used to read a triangular array T(n,k) (n >= 0, 0 <= k <= floor(n/2)) by rows from left to right: n -> T(t1(n), t2(n)).
a(n) gives the number of distinct positive values taken by [n/k]. E.g., a(5)=3: [5/{1,2,3,4,5}]={5,2,1,1,1}. - Marc LeBrun, May 17 2001
This sequence gives the elements in increasing order of the set {i+2j} where i>=0, j>=0. - Benoit Cloitre, Sep 22 2012

Crossrefs

Programs

  • Mathematica
    Flatten[Table[Table[n,{Floor[n/2]+1}],{n,0,20}]] (* Harvey P. Dale, Mar 07 2014 *)
  • PARI
    {a(n) = floor(sqrt(4*n + 1)) - 1}
    
  • PARI
    t1(n)=floor(sqrt(1+4*n)-1) /* A055086 */
    
  • PARI
    t2(n)=(1+4*n-sqr(floor(sqrt(1+4*n))))\4 /* A055087 */
    
  • PARI
    a(n)=if(n<1,0,a(n-1-a(n-1)\2)+1) \\ Benoit Cloitre, May 09 2017
    
  • Python
    from math import isqrt
    def A055086(n): return isqrt((n<<2)|1)-1 # Chai Wah Wu, Nov 23 2024

Formula

a(n) = [sqrt(4*n + 1)] - 1 = A000267(n) - 1.
a(n) = Sum_{k=1..n} A063524(A075993(n, k)), for n>0. - Reinhard Zumkeller, Apr 06 2006
a(n) = ceiling(2*sqrt(n+1)) - 2. - Mircea Merca, Feb 05 2012
a(0) = 0, then for n>=1 a(n) = 1 + a(n-1-floor(a(n-1)/2)). - Benoit Cloitre, May 08 2017
a(n) = floor(b) + floor(n/(floor(b)+1)) where b = (sqrt(4*n+1)-1)/2. - Randell G Heyman, May 08 2019
Sum_{k>=1} (-1)^(k+1)/a(k) = Pi/8 + 3*log(2)/4. - Amiram Eldar, Jan 26 2024

A068050 Number of values of k, 1<=k<=n, for which floor(n/k) is prime.

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 3, 2, 2, 4, 5, 3, 4, 5, 6, 5, 6, 5, 6, 6, 7, 9, 10, 6, 7, 9, 9, 9, 10, 10, 11, 9, 10, 12, 14, 11, 12, 13, 14, 13, 14, 13, 14, 14, 15, 17, 18, 13, 14, 16, 17, 18, 19, 17, 19, 18, 19, 21, 22, 18, 19, 20, 21, 19, 21, 22, 23, 23, 24, 26, 27, 21, 22, 23, 24, 24, 26, 27
Offset: 1

Views

Author

Amarnath Murthy, Feb 12 2002

Keywords

Examples

			a(10) = 4 as floor(10/k) for k = 1 to 10 is 10,5,3,2,2,1,1,1,1,1, respectively; this is prime for k = 2,3,4,5.
		

Crossrefs

Programs

  • Haskell
    a068050 n = length [k | k <- [1..n], a010051 (n `div` k) == 1]
    -- Reinhard Zumkeller, Jan 31 2012
    
  • Mathematica
    a[n_] := Length[Select[Table[Floor[n/i], {i, 1, n}], PrimeQ]]
    Table[Count[Table[Floor[n/k],{k,n}],?PrimeQ],{n,80}] (* _Harvey P. Dale, Nov 19 2022 *)
  • PARI
    a(n) = sum(k=1, n, isprime(n\k)); \\ Michel Marcus, Jun 03 2024

Formula

If p is a prime other than 3, a(p) = a(p-1) + 1. - Franklin T. Adams-Watters, Apr 27 2020
a(n) = A179119*n + O(n^(1/2)). - Randell Heyman, Oct 06 2022
a(n) = Sum_{p prime and p<=n} (floor(n/p) - floor(n/(p+1))). - Ridouane Oudra, Jun 03 2024

Extensions

Edited by Dean Hickerson, Feb 12 2002
Showing 1-2 of 2 results.