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-9 of 9 results.

A352738 Squares in A086849.

Original entry on oeis.org

16, 64, 441, 729, 81796, 1320201, 2729104, 44488900, 34614230401, 209453590921, 752884200721, 5054227881921, 8106120765625, 14483961408400, 433446375390625, 530837821446724, 1270089068379481, 1383781075827264, 4819866587217081, 7032375864510896656
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Mar 30 2022

Keywords

Comments

Squares that are partial sums of A000037.

Examples

			a(2) = 64 is a term because 64 = 8^2 = 2+3+5+6+7+8+10+11+12 is a square and the sum of the nonsquares up to 12.
		

Crossrefs

Programs

  • Maple
    R:= NULL: count:= 0:
    s:= 0:
    for n from 1 do
      if issqr(n) then next fi;
      s:= s+n;
      if issqr(s) then
        count:= count+1;
        R:= R,s;
        if count = 19 then break fi
      fi;
    od:
    R;
  • Python
    from itertools import islice
    def A352738_gen(): # generator of terms
        c, k, ks, m, ms = 0, 1, 2, 1, 1
        while True:
            for n in range(ks,ks+2*k):
                c += n
                if c == ms:
                    yield c
                elif c > ms:
                    ms += 2*m+1
                    m += 1
            ks += 2*k+1
            k += 1
    A352738_list = list(islice(A352738_gen(),10)) # Chai Wah Wu, Mar 31 2022

Extensions

a(20) from Jon E. Schoenfield, Mar 31 2022

A355371 Intersection of A000330 and A086849.

Original entry on oeis.org

5, 91, 506, 650, 11440
Offset: 1

Views

Author

Ivan N. Ianakiev, Jun 30 2022

Keywords

Comments

Numbers that are the sum of the first r nonsquares and also the sum of the first s squares for some r and s.
If it exists, a(6) > 5.4*10^12.
If it exists, a(6) > 10^20. - Michael S. Branicky, Jul 09 2022

Examples

			1+4+9+16+25+36 = 2+3+5+6+7+8+10+11+12+13+14 = 91, so 91 is a term.
		

Crossrefs

Programs

  • Mathematica
    a000330=Accumulate[Table[i^2,{i,60}]];
    a086849=Accumulate[Table[i+Floor[1/2+Sqrt[i]],{i,370}]];
    Intersection[a000330,a086849]

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

A048395 Sum of consecutive nonsquares.

Original entry on oeis.org

0, 5, 26, 75, 164, 305, 510, 791, 1160, 1629, 2210, 2915, 3756, 4745, 5894, 7215, 8720, 10421, 12330, 14459, 16820, 19425, 22286, 25415, 28824, 32525, 36530, 40851, 45500, 50489, 55830, 61535, 67616, 74085, 80954, 88235, 95940, 104081
Offset: 0

Views

Author

Patrick De Geest, Mar 15 1999

Keywords

Comments

Relationship with natural numbers: a(4) = (first term + last term)*n = (10+15)*3 = (25)*3 = 75; a(5) = (17+24)*4 = (41)*4 = 164; ...
Also (X*Y*Z)/(X+Y+Z) of primitive Pythagorean triples (X,Y,Z=Y+1) as described in A046092 and A001844. - Lambert Herrgesell (zero815(AT)googlemail.com), Dec 13 2005
First differences are in A201279. - J. M. Bergot, Jun 22 2013 [Corrected by Omar E. Pol, Dec 26 2021]

Examples

			Between 3^2 and 4^2 we have 10+11+12+13+14+15 which is 75 or a(4).
		

Crossrefs

Programs

  • Haskell
    a048395 0 = 0
    a048395 n = a199771 (2 * n)  -- Reinhard Zumkeller, Oct 26 2015
  • Mathematica
    Table[n(1+2*n(1+n)),{n,0,40}] (* or *) LinearRecurrence[{4,-6,4,-1},{0,5,26,75},40] (* Harvey P. Dale, Nov 01 2013 *)
  • PARI
    v0=[1,0,1]; M=[1, 2, 2; -2, -1, -2; 2, 2, 3];
    g(v)=v[1]*v[2]*v[3]/(v[1]+v[2]+v[3]);
    a(n)=g(v0*M^n);
    for(i=0,50,print1(a(i),", ")) \\ Lambert Herrgesell (zero815(AT)googlemail.com), Dec 13 2005
    

Formula

a(n) = 2*n^3 + 2*n^2 + n.
a(n) = Sum_{j=0..n} ((n+j+2)^2 - j^2 + 1). - Zerinvary Lajos, Sep 13 2006
O.g.f.: x(x+5)(1+x)/(1-x)^4. - R. J. Mathar, Jun 12 2008
a(n) = A199771(2*n) for n > 0. - Reinhard Zumkeller, Nov 23 2011
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4); a(0)=0, a(1)=5, a(2)=26, a(3)=75. - Harvey P. Dale, Nov 01 2013
E.g.f.: exp(x)*x*(5 + 8*x + 2*x^2). - Stefano Spezia, Jun 25 2022

A109470 Sum of first n noncubes.

Original entry on oeis.org

2, 5, 9, 14, 20, 27, 36, 46, 57, 69, 82, 96, 111, 127, 144, 162, 181, 201, 222, 244, 267, 291, 316, 342, 370, 399, 429, 460, 492, 525, 559, 594, 630, 667, 705, 744, 784, 825, 867, 910, 954, 999, 1045, 1092, 1140, 1189, 1239, 1290, 1342, 1395, 1449, 1504, 1560
Offset: 1

Views

Author

Jonathan Vos Post, Aug 28 2005

Keywords

Examples

			a(6) = 2 + 3 + 4 + 5 + 6 + 7 = 27.
a(7) = 2 + 3 + 4 + 5 + 6 + 7 + 9 = 36.
		

Crossrefs

Programs

  • Mathematica
    Accumulate[With[{no=60},Complement[Range[no],Range[Floor[Power[no, (3)^-1]]]^3]]]  (* Harvey P. Dale, Feb 14 2011 *)
  • PARI
    a(n) = sum(i=1, n, i + sqrtnint(i + sqrtnint(i, 3), 3)); \\ Michel Marcus, Jun 20 2024
  • Python
    from sympy import integer_nthroot
    def A109470(n): return ((m:=n+(k:=integer_nthroot(n,3)[0])+int(n>=(k+1)**3-k))*(m+1)>>1)-((r:=integer_nthroot(m,3)[0])*(r+1)>>1)**2 # Chai Wah Wu, Jun 17 2024
    

Formula

a(n) = Sum_{i=1..n} A007412(i).
a(n) = A000217(A007412(n)) - Sum_{i=1..floor((A007412(n)^(1/3)))} i^3.
a(n) = A000217(A007412(n)) - A000217(floor(A007412(n)^(1/3)))^2.
Let R = A007412(n) and S = floor(R^(1/3)); then a(n) = (R*(R+1))/2 - ((S*(S+1))/2)^2. - Gerald Hillier, Dec 21 2008

A132295 Sum of the nonsquare numbers not larger than n.

Original entry on oeis.org

0, 2, 5, 5, 10, 16, 23, 31, 31, 41, 52, 64, 77, 91, 106, 106, 123, 141, 160, 180, 201, 223, 246, 270, 270, 296, 323, 351, 380, 410, 441, 473, 506, 540, 575, 575, 612, 650, 689, 729, 770, 812, 855, 899, 944, 990, 1037, 1085, 1085, 1135, 1186, 1238, 1291, 1345
Offset: 1

Views

Author

Cino Hilliard, Nov 07 2007

Keywords

Examples

			Let n=5. The sum of the nonsquare numbers <= 5 is 2+3+5 = 10, the 5th entry in the sequence.
		

Crossrefs

Programs

  • Mathematica
    Table[Total[Select[Range[n],!IntegerQ[Sqrt[#]]&]],{n,54}] (* James C. McMahon, Mar 04 2025 *)
  • PARI
    sumNsq(n)= { for(x=1,n,r=floor(sqrt(x));sq=r*(r+1)*(2*r+1)/6;sn=x*(x+1)/2; print1(sn-sq",")) }
    
  • Python
    from math import isqrt
    def A000330(n): return n*(n+1)*(2*n+1)//6
    def A132295(n): return n*(n+1)//2-A000330(isqrt(n)) # Jason Yuen, Jan 30 2024

Formula

Let r = floor(sqrt(n)). Then a(n) = n(n+1)/2 - r(r+1)(2r+1)/6.

Extensions

Definition corrected by R. J. Mathar, Sep 10 2016

A270439 Alternating sum of nonsquares (A000037).

Original entry on oeis.org

2, -1, 4, -2, 5, -3, 7, -4, 8, -5, 9, -6, 11, -7, 12, -8, 13, -9, 14, -10, 16, -11, 17, -12, 18, -13, 19, -14, 20, -15, 22, -16, 23, -17, 24, -18, 25, -19, 26, -20, 27, -21, 29, -22, 30, -23, 31, -24, 32, -25, 33, -26, 34, -27, 35, -28, 37, -29, 38, -30, 39, -31, 40, -32, 41, -33, 42, -34, 43, -35, 44, -36, 46, -37, 47
Offset: 1

Views

Author

Ilya Gutkovskiy, Jul 12 2016

Keywords

Comments

Interleaving of nontriangular numbers (A014132) and negative integers (A001478).

Examples

			a(1) = a(2*1-1) = 1 + floor(1/2 + sqrt(2*1)) = 2;
a(2) = a(2*1) = -1;
a(3) = a(2*2-1) = 2 + floor(1/2 + sqrt(2*2)) = 4;
a(4) = a(2*2) = -2;
a(5) = a(2*3-1) = 3 + floor(1/2 + sqrt(2*3)) = 5;
a(6) = a(2*3) = -3, etc.
or
a(1) = 2;
a(2) = 2 - 3 = -1;
a(3) = 2 - 3 + 5 = 4;
a(4) = 2 - 3 + 5 - 6 = -2;
a(5) = 2 - 3 + 5 - 6 + 7 = 5;
a(6) = 2 - 3 + 5 - 6 + 7 - 8 = -3, etc.
(2, 3, 5, 6, 7, 8, ... is the nonsquares).
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[(-1)^(k + 1) (k + Floor[1/2 + Sqrt[k]]), {k, n}], {n, 75}]
  • PARI
    a(n)=if(n%2, sqrtint(4*n-3)+n+2, -n)\2 \\ Charles R Greathouse IV, Aug 03 2016
    
  • Python
    from math import isqrt
    def A270439(n): return (n>>1)+1+(m:=isqrt(n+1))+int(n-m*(m+1)>=0) if n&1 else -(n>>1) # Chai Wah Wu, Nov 14 2022

Formula

a(n) = Sum_{k = 1..n} (-1)^(k+1)*(k + floor(1/2 + sqrt(k))).
a(n) = Sum_{k = 1..n} (-1)^(k+1)*A000037(k).
a(2^k*m) = -2^(k-1) * m, k > 0.
a(2k - 1) = k + floor(1/2 + sqrt(2*k)), a(2k) = -k, k > 0.
a(2k - 1) = A014132(k), a(2k) = A001478(k).

A329598 Partial sums of the nontriangular numbers (A014132).

Original entry on oeis.org

2, 6, 11, 18, 26, 35, 46, 58, 71, 85, 101, 118, 136, 155, 175, 197, 220, 244, 269, 295, 322, 351, 381, 412, 444, 477, 511, 546, 583, 621, 660, 700, 741, 783, 826, 870, 916, 963, 1011, 1060, 1110, 1161, 1213, 1266, 1320, 1376, 1433, 1491, 1550, 1610, 1671, 1733
Offset: 1

Views

Author

Keywords

Comments

Terms which are triangular: 6, 136, 351, 741, 2415, 3916, 5995, 12561, 17391, 23436, ..., .

Examples

			The nontriangular numbers begin 2, 4, 5, 7, ..., so their partial sums begin 2, 6, 11, 18, etc.
		

References

  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 64.

Crossrefs

Programs

  • Mathematica
    triQ[n_] := IntegerQ @ Sqrt[8n + 1]; Accumulate@ Select[ Range@ 70, !triQ@# &]
  • Python
    from math import isqrt
    def A329598(n): return (k:=(r:=isqrt(m:=n+1<<1))+int((m<<2)>(r<<2)*(r+1)+1)-1)*(k*(-k - 3) + 6*n - 2)//6 + (n*(n+3)>>1) # Chai Wah Wu, Jun 18 2024

Formula

a(n) = Sum_{i=1..n} A014132(i).
a(n) = A000217(n) + A060432(n). [corrected by Gerald Hillier, Jul 31 2022]

A351855 Partial sums of nonsquares that are partial sums of nonprimes.

Original entry on oeis.org

5, 64, 506, 64325, 268723, 480129, 6282620, 64548862, 9657523883, 13480852825, 29766135708, 105223301080, 519861666225, 851245744041, 1378216791896, 581522966976875, 583298551668358, 885441628670251, 1651966084813205, 16868988672306046, 17170433482837259
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Mar 31 2022

Keywords

Examples

			a(2) = 64 is a term because 64 = 1+4+6+8+9+10+12+14 = 2+3+5+6+7+8+10+11+12 is the sum of the first 8 nonprimes and the sum of the first 9 nonsquares.
		

Crossrefs

Intersection of A051349 and A086849.

Programs

  • Maple
    i:= 0: j:= 0: s:= 0: t:= 0:
    R:= NULL: count:= 0:
    while count < 13 do
      if s <= t then
         i:= i+1;
         if not issqr(i) then
           s:= s+i;
           if s=t then R:= R,s; count:= count+1 fi;
         fi
      else
         j:= j+1;
         if not isprime(j) then
           t:= t+j;
           if s=t then R:= R,t; count:= count+1 fi;
         fi
      fi
    od:
    R;
  • Python
    from itertools import islice
    from sympy import nextprime
    def A351855_gen(): # generator of terms
        c, k, ks, m, p, q = 0, 1, 2, 1, 4, 5
        while True:
            for n in range(ks,ks+2*k):
                c += n
                if c == m:
                    yield c
                else:
                    while c > m:
                        m += p
                        p += 1
                        if p == q:
                            q = nextprime(q)
                            p += 1
            ks += 2*k+1
            k += 1
    A351855_list = list(islice(A351855_gen(),20)) # Chai Wah Wu, Apr 04 2022

Extensions

a(20)-a(21) from Jon E. Schoenfield, Mar 31 2022
Showing 1-9 of 9 results.