%I #46 Jul 31 2022 07:49:35
%S 0,1,0,0,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,
%T 0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,
%U 1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1
%N n 0's followed by n 1's.
%C It appears that a(n) is the number of positive solutions to the equation x*floor(x) = n - 1 (for example, it appears x = 5/2 is the only positive solution to x*floor(x) = 5). - _Melvin Peralta_, Apr 13 2016
%C From _Branko Curgus_, Apr 25 2017: (Start)
%C a(n) is 0 if the nearest square to n is greater than or equal to n, otherwise 1.
%C a(n) is the number of positive solutions to the equation x*floor(x) = n - 1. (End)
%H Boris Putievskiy, <a href="http://arxiv.org/abs/1212.2732">Transformations [Of] Integer Sequences And Pairing Functions</a>, arXiv preprint arXiv:1212.2732 [math.CO], 2012.
%F G.f.: (x / (1 - x)) * (Sum_{k>0} x^k^2 * (1 - x^k)). - _Michael Somos_, Nov 05 2011
%F a(n) = floor((n-1)/A000194(n)) - A000194(n)+1, where A000194(n) = round(sqrt(n)). - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Feb 23 2003
%F a(n+1) = 1 - A118175(n). - _Philippe Deléham_, Jan 02 2012
%F a(n) = ceiling(sqrt(n)) - round(sqrt(n)). - _Branko Curgus_, Apr 26 2017
%e x^2 + x^5 + x^6 + x^10 + x^11 + x^12 + x^17 + x^18 + x^19 + x^20 + ...
%p A000194 := n->round(sqrt(n)):A079813 := n->(floor((n-1)/A000194(n))-A000194(n)+1);
%t Table[{Table[0, n], Table[1, n]}, {n, 11}] // Flatten (* or *)
%t Rest@ CoefficientList[Series[(x/(1 - x)) Sum[x^k^2 (1 - x^k), {k, 12}], {x, 0, 120}], x] (* or *)
%t Table[Floor[(n - 1)/#] - # + 1 &@ Round[Sqrt@ n], {n, 120}] (* _Michael De Vlieger_, Apr 13 2016 *)
%t Table[Ceiling[Sqrt[n]] - Round[Sqrt[n]], {n, 1, 257}] (* _Branko Curgus_, Apr 25 2017 *)
%o (PARI) {a(n) = if( n<1, 0, n--; m = sqrtint(n); n - m^2 < m)} /* _Michael Somos_, Nov 05 2011 */
%o (Python)
%o from math import isqrt
%o def A079813(n): return int((m:=isqrt(n))**2!=n)-int(n-m*(m+1)>=1) # _Chai Wah Wu_, Jul 30 2022
%K easy,nonn
%O 1,1
%A _Olivier Gérard_, Feb 19 2003