OFFSET
1,2
COMMENTS
a(n) > a(n+1) iff n = m^2 - 1 with m >= 2; that is the answer to the 4th problem of the 32nd British Mathematical Olympiad (1996) [See link BMO]. - Bernard Schott, Oct 28 2019
REFERENCES
A. Gardiner, The Mathematical Olympiad Handbook: An Introduction to Problem Solving, Oxford University Press, 1997, reprinted 2011, Pb 4 pp. 54 and 92-93 (1996).
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..10000
British Mathematical Olympiad, 1996 - Problem 4
FORMULA
For m = positive integer, terms a(m^2) through a(m^2+m-1) each equal m; terms a(m^2+m) through a(m^2+2m-1) each equal m+1; term a(m^2+2m) equals m+2. - Leroy Quet, Apr 02 2007
a(n) = floor(2*sqrt(n+1)) - floor(sqrt(n)). - Wesley Ivan Hurt, Dec 25 2020
From Natalia L. Skirrow, May 13 2025: (Start)
G.f.: (t_3(x)-1)/(2*x) + psi(x^2)/(1-x) - 2, where t_3(x) (A000122) is Jacobi's third theta function and psi(x) is Ramanujan's psi function.
a(n) = A010052(n+1) + A000194(n+1) = [m is square] + floor((sqrt(4*m)+1)/2) where m=n+1 and [] is the Iverson bracket.
(End)
MATHEMATICA
Table[Floor[n/Floor[Sqrt[n]]], {n, 100}] (* Harvey P. Dale, Sep 22 2011 *)
PROG
(PARI) a(n)=floor(n/sqrtint(n))
(Python)
from math import isqrt
def a(n): return n//isqrt(n)
print([a(n) for n in range(1, 100)]) # Michael S. Branicky, May 25 2025
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Benoit Cloitre, Jan 31 2003
STATUS
approved
