login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A000037 Numbers that are not squares (or, the nonsquares).
(Formerly M0613 N0223)
163

%I M0613 N0223 #155 Dec 09 2023 04:27:29

%S 2,3,5,6,7,8,10,11,12,13,14,15,17,18,19,20,21,22,23,24,26,27,28,29,30,

%T 31,32,33,34,35,37,38,39,40,41,42,43,44,45,46,47,48,50,51,52,53,54,55,

%U 56,57,58,59,60,61,62,63,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99

%N Numbers that are not squares (or, the nonsquares).

%C Note the remarkable formula for the n-th term (see the FORMULA section)!

%C These are the natural numbers with an even number of divisors. The number of divisors is odd for the complementary sequence, the squares (sequence A000290) and the numbers for which the number of divisors is divisible by 3 is sequence A059269. - Ola Veshta (olaveshta(AT)my-deja.com), Apr 04 2001

%C a(n) is the largest integer m not equal to n such that n = (floor(n^2/m) + m)/2. - _Alexander R. Povolotsky_, Feb 10 2008

%C Union of A007969 and A007970; A007968(a(n)) > 0. - _Reinhard Zumkeller_, Jun 18 2011

%C Terms of even numbered rows in the triangle A199332. - _Reinhard Zumkeller_, Nov 23 2011

%C If a(n) and a(n+1) are of the same parity then (a(n)+a(n+1))/2 is a square. - _Zak Seidov_, Aug 13 2012

%C Theaetetus of Athens proved the irrationality of the square roots of these numbers in the 4th century BC. - _Charles R Greathouse IV_, Apr 18 2013

%C 4*a(n) are the even members of A079896, the discriminants of indefinite binary quadratic forms. - _Wolfdieter Lang_, Jun 14 2013

%D Titu Andreescu, Dorin Andrica, and Zuming Feng, 104 Number Theory Problems, Birkhäuser, 2006, 58-60.

%D N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).

%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

%H Ray Chandler, <a href="/A000037/b000037.txt">Table of n, a(n) for n = 1..10000</a> (first 9900 terms from N. J. A. Sloane)

%H E. R. Berlekamp, <a href="/A257113/a257113.pdf">A contribution to mathematical psychometrics</a>, Unpublished Bell Labs Memorandum, Feb 08 1968 [Annotated scanned copy]

%H A. J. dos Reis and D. M. Silberger, <a href="http://www.jstor.org/stable/2691513">Generating nonpowers by formula</a>, Math. Mag., 63 (1990), 53-55.

%H Bakir Farhi, <a href="http://arxiv.org/abs/1105.1127">An explicit formula generating the non-Fibonacci numbers</a>, arXiv:1105.1127 [math.NT], May 05 2011.

%H S. R. Finch, <a href="http://www.people.fas.harvard.edu/~sfinch/">Class number theory</a>

%H Steven R. Finch, <a href="/A000924/a000924.pdf">Class number theory</a> [Cached copy, with permission of the author]

%H Henry W. Gould, <a href="/A003099/a003099.pdf">Letters to N. J. A. Sloane, Oct 1973 and Jan 1974</a>.

%H S. Kaji, T. Maeno, K. Nuida, and Y. Numata, <a href="http://arxiv.org/abs/1506.02742">Polynomial Expressions of Carries in p-ary Arithmetics</a>, arXiv preprint arXiv:1506.02742 [math.CO], 2015-2016.

%H J. Lambek and L. Moser, <a href="http://www.jstor.org/stable/2308078">Inverse and complementary sequences of natural numbers</a>, Amer. Math. Monthly, 61 (1954), 454-458. doi 10.2307/2308078, see example 4 (includes the formula). [Nicolas Normand (Nicolas.Normand(AT)polytech.univ-nantes.fr), Nov 24 2009]

%H R. P. Loh, A. G. Shannon, and A. F. Horadam, <a href="/A000969/a000969.pdf">Divisibility Criteria and Sequence Generators Associated with Fermat Coefficients</a>, Preprint, 1980.

%H Cristinel Mortici, <a href="http://www.fq.math.ca/Papers1/48-4/Mortici.pdf">Remarks on Complementary Sequences</a>, Fibonacci Quart. 48 (2010), no. 4, 343-347.

%H R. D. Nelson, <a href="http://www.jstor.org/stable/3618253">Sequences which omit powers</a>, The Mathematical Gazette, Number 461, 1988, pages 208-211.

%H M. A. Nyblom, <a href="http://www.jstor.org/stable/2695446">Some curious sequences involving floor and ceiling functions</a>, Am. Math. Monthly 109 (#6, 2002), 559-564.

%H Rosetta Code, <a href="http://rosettacode.org/wiki/Sequence_of_non-squares">Sequence of non-squares</a>

%H J. Scholes, <a href="https://mks.mff.cuni.cz/kalva/putnam/putn66.html">27th Putnam 1966 Prob. A4</a>

%H Aaron Snook, <a href="http://www.cs.cmu.edu/afs/cs/user/mjs/ftp/thesis-program/2012/theses/snook.pdf">Augmented Integer Linear Recurrences</a>, 2012. - From _N. J. A. Sloane_, Dec 19 2012

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/SquareNumber.html">Square Number</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/ContinuedFraction.html">Continued Fraction</a>

%F a(n) = n + floor(1/2 + sqrt(n)).

%F a(n) = n + floor(sqrt( n + floor(sqrt n))).

%F A010052(a(n)) = 0. - _Reinhard Zumkeller_, Jan 26 2010

%F A173517(a(n)) = n; a(n)^2 = A030140(n). - _Reinhard Zumkeller_, Feb 20 2010

%F a(n) = A000194(n) + n = floor(1/2 *(1 + sqrt(4*n-3))) + n. - _Jaroslav Krizek_, Jun 14 2009

%F a(n) = A000194(n) + n.

%e For example note that the squares 0, 1, 4, 9, 16 are not included.

%e a(A002061(n)) = a(n^2-n+1) = A002522(n) = n^2 + 1. A002061(n) = central polygonal numbers (n^2-n+1). A002522(n) = numbers of the form n^2 + 1. - _Jaroslav Krizek_, Jun 21 2009

%p A000037 := n->n+floor(1/2+sqrt(n));

%t a[n_] := (n + Floor[Sqrt[n + Floor[Sqrt[n]]]]); Table[a[n], {n, 71}] (* _Robert G. Wilson v_, Sep 24 2004 *)

%t With[{upto=100},Complement[Range[upto],Range[Floor[Sqrt[upto]]]^2]] (* _Harvey P. Dale_, Dec 02 2011 *)

%t a[ n_] := If[ n < 0, 0, n + Round @ Sqrt @ n]; (* _Michael Somos_, May 28 2014 *)

%o (Magma) [n : n in [1..1000] | not IsSquare(n) ];

%o (Magma) at:=0; for n in [1..10000] do if not IsSquare(n) then at:=at+1; print at, n; end if; end for;

%o (PARI) {a(n) = if( n<0, 0, n + (1 + sqrtint(4*n)) \ 2)};

%o (Haskell)

%o a000037 n = n + a000196 (n + a000196 n)

%o -- _Reinhard Zumkeller_, Nov 23 2011

%o (Maxima) A000037(n):=n + floor(1/2 + sqrt(n))$ makelist(A000037(n),n,1,50); /* _Martin Ettl_, Nov 15 2012 */

%o (Python)

%o from math import isqrt

%o def A000037(n): return n+isqrt(n+isqrt(n)) # _Chai Wah Wu_, Mar 31 2022

%Y Cf. A007412, A000005, A000290, A059269, A134986, A087153, A172151, A000196, A049068 (subsequence).

%Y Cf. A242401 (subsequence).

%Y Cf. A086849 (partial sums), A048395.

%K easy,nonn,nice

%O 1,1

%A _N. J. A. Sloane_, _Simon Plouffe_

%E Edited by _Charles R Greathouse IV_, Oct 30 2009

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 11:45 EDT 2024. Contains 371278 sequences. (Running on oeis4.)