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.

A227177 n occurs n^2 - n + 1 times.

Original entry on oeis.org

0, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
Offset: 0

Views

Author

Antti Karttunen, Jul 03 2013

Keywords

Comments

a(n) is the least integer k such that A006527(k) >= n, which implies that each n occurs A002061(n) times.

Crossrefs

Programs

  • Mathematica
    Flatten[Map[ConstantArray[#,(#-2) (#-1)+1]-1&,Range[7]]] (* Peter J. C. Moses, Jul 14 2013 *)
    Flatten[Table[#,{#^2-#+1}]&/@Range[0,7]] (* Harvey P. Dale, Sep 25 2013 *)
  • PARI
    vec(N)=concat(vector(N, i, vector(i^2-i+1, j, i))) \\ Jinyuan Wang, Dec 01 2018
    
  • Python
    from sympy import integer_nthroot
    def A227177(n): return (m:=integer_nthroot(k:=3*n,3)[0])+(k>m*(m**2+2)) # Chai Wah Wu, Nov 07 2024

Formula

a(k + (j^3-j^2+5*j)/3) = j for all j>=0, k=0..(j^2-j). - Jinyuan Wang, Nov 24 2018
a(n) = m+1 if 3n>m*(m^2+2) and a(n) = m otherwise where m=floor((3n)^(1/3)). - Chai Wah Wu, Nov 07 2024