OFFSET
0,2
COMMENTS
A171746 gives number of iterations to reach a square. - Reinhard Zumkeller, Oct 14 2010
From Carmine Suriano, Oct 15 2010: (Start)
Also the sequence of integers left after performing the following procedure:
1. Remove the element at 1st position (1) and compact the sequence;
2. Remove the element at 4th (2^2-th) position (5) and compact the sequence;
3. Remove the element at 9th (3^2-th) position (11) and compact the sequence;
....
n. Remove the element at (n-square)th position (n^2 + n - 1) and compact the sequence;
(End)
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
L. F. Klosinski, G. L. Alexanderson and A. P. Hillman, The William Lowell Putnam Mathematical Competition: Problem B4, Amer. Math. Monthly 91 (1984), 487-495.
FORMULA
a(n) = 2*n - A028391(n).
G.f.: x / (1 - x)^2 + (theta3(x) - 1) / (2 * (1 - x)). - Michael Somos, Mar 24 2012
EXAMPLE
G.f. = 2*x + 3*x^2 + 4*x^3 + 6*x^4 + 7*x^5 + 8*x^6 + 9*x^7 + 10*x^8 + 12*x^9 + ...
MATHEMATICA
Table[n + Floor[Sqrt[n]], {n, 0, 99}] (* Vladimir Joseph Stephan Orlovsky, Mar 29 2010 *)
PROG
(PARI) {a(n) = if( n<0, 0, n + sqrtint(n))}; /* Michael Somos, Jun 11 2003 */
(Haskell)
a028392 n = n + a000196 n -- Reinhard Zumkeller, Oct 28 2012
(Scala) (0 to 99).map(n => (n + Math.floor(Math.sqrt(n))).toInt) // Alonso del Arte, Nov 03 2019
(Python)
from math import isqrt
def A028392(n): return n+isqrt(n) # Chai Wah Wu, May 16 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved