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.

Showing 1-3 of 3 results.

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

Original entry on oeis.org

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, 31, 32, 33, 34, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54, 55, 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
Offset: 1

Views

Author

Keywords

Comments

Note the remarkable formula for the n-th term (see the FORMULA section)!
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
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
Union of A007969 and A007970; A007968(a(n)) > 0. - Reinhard Zumkeller, Jun 18 2011
Terms of even numbered rows in the triangle A199332. - Reinhard Zumkeller, Nov 23 2011
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
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
4*a(n) are the even members of A079896, the discriminants of indefinite binary quadratic forms. - Wolfdieter Lang, Jun 14 2013

Examples

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

References

  • Titu Andreescu, Dorin Andrica, and Zuming Feng, 104 Number Theory Problems, Birkhäuser, 2006, 58-60.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A242401 (subsequence).
Cf. A086849 (partial sums), A048395.

Programs

  • Haskell
    a000037 n = n + a000196 (n + a000196 n)
    -- Reinhard Zumkeller, Nov 23 2011
    
  • Magma
    [n : n in [1..1000] | not IsSquare(n) ];
    
  • Magma
    at:=0; for n in [1..10000] do if not IsSquare(n) then at:=at+1; print at, n; end if; end for;
    
  • Maple
    A000037 := n->n+floor(1/2+sqrt(n));
  • Mathematica
    a[n_] := (n + Floor[Sqrt[n + Floor[Sqrt[n]]]]); Table[a[n], {n, 71}] (* Robert G. Wilson v, Sep 24 2004 *)
    With[{upto=100},Complement[Range[upto],Range[Floor[Sqrt[upto]]]^2]] (* Harvey P. Dale, Dec 02 2011 *)
    a[ n_] :=  If[ n < 0, 0, n + Round @ Sqrt @ n]; (* Michael Somos, May 28 2014 *)
  • Maxima
    A000037(n):=n + floor(1/2 + sqrt(n))$ makelist(A000037(n),n,1,50); /* Martin Ettl, Nov 15 2012 */
    
  • PARI
    {a(n) = if( n<0, 0, n + (1 + sqrtint(4*n)) \ 2)};
    
  • Python
    from math import isqrt
    def A000037(n): return n+isqrt(n+isqrt(n)) # Chai Wah Wu, Mar 31 2022
    
  • Python
    from math import isqrt
    def A000037(n): return n+(k:=isqrt(n))+int(n>=k*(k+1)+1) # Chai Wah Wu, Jun 17 2024

Formula

a(n) = n + floor(1/2 + sqrt(n)).
a(n) = n + floor(sqrt( n + floor(sqrt n))).
A010052(a(n)) = 0. - Reinhard Zumkeller, Jan 26 2010
A173517(a(n)) = n; a(n)^2 = A030140(n). - Reinhard Zumkeller, Feb 20 2010
a(n) = A000194(n) + n. - Jaroslav Krizek, Jun 14 2009
a(A002061(n)) = a(n^2-n+1) = A002522(n) = n^2 + 1. - Jaroslav Krizek, Jun 21 2009

Extensions

Edited by Charles R Greathouse IV, Oct 30 2009

A028391 a(n) = n - floor(sqrt(n)).

Original entry on oeis.org

0, 0, 1, 2, 2, 3, 4, 5, 6, 6, 7, 8, 9, 10, 11, 12, 12, 13, 14, 15, 16, 17, 18, 19, 20, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65
Offset: 0

Views

Author

John Mellor (u15630(AT)snet.net)

Keywords

Comments

Number of nonsquares <= n.
Number of k <= n with an even number of divisors. - Benoit Cloitre, Sep 07 2002
Construct the pyramid
............a(0)
.......a(1).a(2).a(3)
..a(4).a(5).a(6).a(7).a(8).. etc.
Now circle all the primes and the result will be a pattern very similar to the famous Ulam spiral. - Sam Alexander, Nov 14 2003
The sequence floor(n-n^(1/2)) gives the same numbers with a different offset. - Mohammad K. Azarian, R. J. Mathar and M. F. Hasler, Apr 30 2008
The number of nonzero values of floor (j^2/n) taken over 1 <= j <= n-1.
a(n) = A173517(n) iff n is not a square. - Reinhard Zumkeller, Feb 20 2010
a(n) - a(n-1) = 0 if n is a square, otherwise 1. - Robert Israel, Dec 30 2014

References

  • B. Alspach, K. Heinrich and G. Liu, Orthogonal factorizations of graphs, pp. 13-40 of Contemporary Design Theory, ed. J. H. Dinizt and D. R. Stinson, Wiley, 1992 (see Theorem 2.7).

Crossrefs

Programs

Formula

a(n) = ceiling(n - sqrt(n)), as follows from ceiling(-x) = -floor(x). [Corrected by M. F. Hasler, Feb 21 2010]
a(n) = 2*n - A028392(n). - Reinhard Zumkeller, Oct 28 2012
G.f.: (1+x)/(2*(1-x)^2) - Theta3(0,x)/(2*(1-x)) where Theta3 is a Jacobi theta function. - Robert Israel, Dec 30 2014

Extensions

Edited by N. J. A. Sloane at the suggestion of R. J. Mathar, May 01 2008
Comment and cross-reference added by Christopher Hunt Gribble, Oct 13 2009
Formula corrected by M. F. Hasler, Feb 21 2010
More terms from Vladimir Joseph Stephan Orlovsky, Mar 29 2010

A320471 a(n) = floor(sqrt(n)) mod ceiling(sqrt(n)).

Original entry on oeis.org

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

Views

Author

Kritsada Moomuang, Oct 13 2018

Keywords

Comments

Sequence consists of zeros interleaved with the positive integers, each positive integer k appearing 2k times.

Crossrefs

Programs

  • Magma
    [Binomial(Ceiling(Sqrt(n)), Floor(Sqrt(n))) - 1: n in [1..100]]; // Vincenzo Librandi, Dec 02 2018
    
  • Maple
    a:= proc(n) modp(floor(sqrt(n)),ceil(sqrt(n))) end: seq(a(n),n=1..100); # Muniru A Asiru, Oct 17 2018
  • Mathematica
    Array[Mod[Floor@ #, Ceiling@ #] &@ Sqrt@ # &, 99] (* or *)
    Array[IntegerPart@ # - If[IntegerQ@ #, #, 0] &@ Sqrt@ # &, 99] (* or *)
    Flatten@ Array[{0}~Join~ConstantArray[#, 2 #] &, 9] (* Michael De Vlieger, Oct 15 2018 *)
  • PARI
    a(n) = sqrtint(n) % (1+sqrtint(n-1)); \\ Michel Marcus, Nov 04 2018
    
  • PARI
    a(n) = sqrtint(n-1) * !issquare(n) \\ David A. Corneth, Nov 04 2018
    
  • Python
    from math import isqrt
    def A320471(n): return 0 if (m:=isqrt(n))**2==n else m # Chai Wah Wu, Jul 29 2022

Formula

a(n) = A000196(n) - A037213(n).
a(n) = A000196(n)*A049240(n).
a(n) = A000196(n) mod A003059(n).
a(n) = (n - A173517(n)) - A037213(n)^2.
a(n) = binomial(ceiling(sqrt(n)),floor(sqrt(n))) - 1.
From David A. Corneth, Nov 04 2018: (Start)
a(k^2) = 0.
a(m) = floor(sqrt(m)) for nonsquare m. (End)

Extensions

Corrected by Michel Marcus, Jun 14 2022
Showing 1-3 of 3 results.