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.

Previous Showing 11-16 of 16 results.

A254371 Sum of cubes of the first n even numbers (A016743).

Original entry on oeis.org

0, 8, 72, 288, 800, 1800, 3528, 6272, 10368, 16200, 24200, 34848, 48672, 66248, 88200, 115200, 147968, 187272, 233928, 288800, 352800, 426888, 512072, 609408, 720000, 845000, 985608, 1143072, 1318688, 1513800, 1729800, 1968128, 2230272, 2517768, 2832200, 3175200
Offset: 0

Views

Author

Luciano Ancora, Mar 16 2015

Keywords

Comments

Property: for n >= 2, each (a(n), a(n)+1, a(n)+2) is a triple of consecutive terms that are the sum of two nonzero squares; precisely: a(n) = (n*(n + 1))^2 + (n*(n + 1))^2, a(n)+1 = (n^2+2n)^2 + (n^2-1)^2 and a(n)+2 = (n^2+n+1)^2 + (n^2+n-1)^2 (see Diophante link). - Bernard Schott, Oct 05 2021

Crossrefs

Cf. A000537 (sum of first n cubes); A002593 (sum of first n odd cubes).
Cf. A060300 (2*a(n)).
First bisection of A105636; second bisection of A212892.

Programs

  • GAP
    List([0..35],n->2*(n*(n+1))^2); # Muniru A Asiru, Oct 24 2018
  • Magma
    [2*n^2*(n+1)^2: n in [0..40]]; // Bruno Berselli, Mar 23 2015
    
  • Maple
    A254371:=n->2*n^2*(n + 1)^2: seq(A254371(n), n=0..50); # Wesley Ivan Hurt, Apr 28 2017
  • Mathematica
    Table[2 n^2 (n+1)^2, {n, 0, 40}] (* or *) LinearRecurrence[{5, -10, 10, -5, 1}, {0, 8, 72, 288, 800}, 40]
    Accumulate[Range[0,80,2]^3] (* Harvey P. Dale, Jun 26 2017 *)
  • PARI
    a(n)=sum(i=0, n, 8*i^3); \\ Michael B. Porter, Mar 16 2015
    

Formula

G.f.: 8*x*(1 + 4*x + x^2)/(1 - x)^5.
a(n) = 2*n^2*(n + 1)^2.
a(n) = 2*A035287(n+1) = 2*A002378(n)^2 = 8*A000217(n)^2. - Bruce J. Nicholson, Apr 23 2017
a(n) = 8*A000537(n). - Michel Marcus, Apr 23 2017
From Amiram Eldar, Aug 25 2022: (Start)
Sum_{n>=1} 1/a(n) = Pi^2/6 - 3/2.
Sum_{n>=1} (-1)^(n+1)/a(n) = 3/2 - 2*log(2). (End)
From Elmo R. Oliveira, Aug 14 2025: (Start)
E.g.f.: 2*x*(2 + x)*(2 + 6*x + x^2)*exp(x).
a(n) = 5*a(n-1) - 10*a(n-2) + 10*a(n-3) - 5*a(n-4) + a(n-5).
a(n) = 4*A163102(n) = A060300(n)/2. (End)

A073412 Lesser of three consecutive nonsquare integers each of which is the sum of two squares.

Original entry on oeis.org

72, 232, 520, 584, 800, 808, 1096, 1152, 1312, 1664, 1744, 1800, 1872, 1960, 2248, 2312, 2384, 2592, 2824, 3328, 3392, 3528, 4112, 4176, 4328, 5120, 5408, 5904, 6056, 6120, 6272, 6352, 6408, 6568, 6920, 8080, 8144, 8296, 8352, 8584, 8712, 9160, 9376
Offset: 1

Views

Author

Jason Earls, Aug 23 2002

Keywords

Comments

a(n) == 0 mod 8. - Zak Seidov, Jan 26 2013
Is this sequence the same as A064715? - Zak Seidov, Jan 26 2013
This sequence is distinct from A064715 since it allows numbers equal to twice a square, like 72, 1152, 2592, 3528, etc. - Giovanni Resta, Jan 29 2013
This sequence lists lesser of three consecutive nonsquare integers each of which is the sum of two squares. So this sequence is a subsequence of A064716. - Altug Alkan, Jul 07 2016

Examples

			232 is here since 232 = 6^2 + 14^2; 233 = 8^2 + 13^2; 234 = 3^2 + 15^2 and 232, 233, 234 are all nonsquares.
288 is not a term because 288 = 12^2 + 12^2, 289 = 8^2 + 15^2, 290 = 1^2 + 17^2 but 289 is also square.
		

Crossrefs

Programs

  • Maple
    is415:= proc(n) local F;
      if issqr(n) then return false fi;
      F:= select(t -> t[1] mod 4 = 3, ifactors(n)[2]);
      andmap(t -> t[2]::even, F);
    end proc:
    Q:= select(is415, [seq(seq(8*i+j,j=0..2),i=1..2000)]):
    Q[select(t -> Q[t+2]-Q[t]=2, [$1..nops(Q)-2])]; # Robert Israel, Mar 05 2018
  • Mathematica
    nsQ[x_] := !IntegerQ[Sqrt[x]];
    prQ[x_] := With[{pr = PowersRepresentations[x, 2, 2]}, pr != {} && AllTrue[pr[[1]], IntegerQ]];
    selQ[x_] := nsQ[x] && nsQ[x+1] && nsQ[x+2] && prQ[x] && prQ[x+1] && prQ[x+2];
    Select[8 Range[10000], selQ] (* Jean-François Alcover, Jun 11 2020 *)
  • PARI
    isA001481(n) = my(f=factor(n)); for(i=1, #f[, 1], if(f[i, 2]%2 && f[i, 1]%4==3, return(0))); 1;
    isok(n) = isA001481(n) && isA001481(n+1) && isA001481(n+2) && !issquare(n) && !issquare(n+1);
    lista(nn) = for(n=1, nn, if(isok(8*n), print1(8*n, ", "))); \\ Altug Alkan, Jul 07 2016

Extensions

Edited by Robert Israel, Mar 05 2018

A172001 Nonsquare positive integers n such that Pell equation y^2 - n*x^2 = -1 has rational solutions but the norm of fundamental unit of quadratic field Q(sqrt(n)) is 1.

Original entry on oeis.org

34, 136, 146, 178, 194, 205, 221, 305, 306, 377, 386, 410, 466, 482, 505, 514, 544, 545, 562, 584, 674, 689, 706, 712, 745, 776, 793, 802, 820, 850, 866, 884, 890, 898, 905, 1154, 1186, 1202, 1205, 1220, 1224, 1234, 1282, 1314, 1345, 1346, 1394, 1405, 1469
Offset: 1

Views

Author

Max Alekseyev, Jan 21 2010

Keywords

Comments

If the fundamental unit y0 + x0*sqrt(n) of Q(sqrt(n)) has norm -1, then (x0,y0) represents a rational solution to Pell equation y^2 - n*x^2 = -1. For n in this sequence, rational solutions exist but not delivered by the fundamental unit.

Crossrefs

Set difference of A000415 and its subsequence A172000.
Set difference of A087643 and its subsequence A022544.
Squarefree terms form A031398.
Odd terms form A249052.

Formula

A positive integer n is in this sequence iff its squarefree core A007913(n) belongs to A031398.

Extensions

Edited by Max Alekseyev, Mar 09 2010

A263765 Minimum number of squares necessary to write n as a sum or difference of squares.

Original entry on oeis.org

1, 1, 2, 2, 1, 2, 3, 2, 2, 1, 2, 2, 2, 2, 3, 2, 1, 2, 2, 2, 2, 2, 3, 2, 2, 1, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 1, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 1, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 1, 2, 3, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2
Offset: 0

Views

Author

Jean-Christophe Hervé, Oct 25 2015

Keywords

Comments

This sequence is equivalent to A002828 (least number of squares that add up to n) for sums and differences of squares. Here the possible forms include not only sums of squares, but also differences like x^2 - y^2 or x^2 + y^2 - z^2.
a(n) <= A002828(n) which is <= 4 (Lagrange's "Four Squares theorem"). In fact, a(n) <= 3: numbers of the form 4k, 4k+1 or 4k+3 are equal to the difference of two squares, therefore a(n) <= 2 in this case, and a(4k+2) <= 3 because 4k+2 = 4k+1+1^2. More precisely, a(4k) = 1 or 2; a(4k+1) = 1 or 2; a(4k+2) = 2 or 3; a(4k+3) = 2.
If A002828(n) = 4, a(n) = 2 (see A004215); if A002828(n) = 3, a(n) = 2 or 3: this shows that the form x^2 + y^2 - z^2 is never necessary to write an integer with the minimum number of squares; and of course, if A002828 = 1 or 2, a(n) = A002828.

Examples

			a(6) = 3 because 6 = 2^2 + 1^2 + 1^2 and 6 is not the sum or the difference of two squares; a(28) = 2 because 28 = 8^2 - 6^2.
		

Crossrefs

Formula

Using the partition of the natural numbers into A000290 (square numbers), A000415 (sum of 2 nonzero squares), A263737 (difference but not sum of 2 squares) and A062316 (neither the sum or difference of 2 squares), the sequence is completely defined by: a(A000290(n)) = 1, a(A000415(n)) = a(A263737(n)) = 2, a(A062316(n)) = 3.

A355769 Numbers k such that both k and k+1 can be written as the sum of two nonzero squares.

Original entry on oeis.org

17, 25, 40, 52, 72, 73, 89, 97, 100, 116, 136, 145, 148, 169, 180, 193, 225, 232, 233, 241, 244, 260, 288, 289, 292, 305, 313, 337, 369, 388, 400, 404, 409, 424, 449, 457, 481, 520, 521, 544, 548, 577, 584, 585, 592, 612, 625, 628, 640, 656, 673, 676, 697, 724
Offset: 1

Views

Author

Angad Singh, Jul 16 2022

Keywords

Comments

The numbers in the sequence are useful in solving various second-degree Diophantine equations.
The identity (3n-12)^2 + (4n-12)^2 + 1 = (3n-8)^2 + (4n-15)^2 proves that there are infinitely many such numbers in this sequence.

Examples

			17 is a term since 17 = 4^2 + 1^2 and 17 + 1 = 18 = 3^2 + 3^2.
169 is a term since 169 = 5^2 + 12^2 and 169 + 1 = 170 = 1^2 + 13^2.
		

Crossrefs

Programs

  • PARI
    is1(n)= for( i=1, #n=factor(n)~%4, n[1, i]==3 && n[2, i]%2 && return); n && ( vecmin(n[1, ])==1 || (n[1, 1]==2 && n[2, 1]%2)); \\ A000404
    isok(k) = is1(k) && is1(k+1); \\ Michel Marcus, Jul 18 2022

A355778 Numbers k such that both k and k^2 + 2 can be written as the sum of two nonzero squares.

Original entry on oeis.org

40, 68, 72, 104, 148, 180, 320, 392, 468, 544, 612, 648, 720, 788, 832, 900, 936, 968, 1040, 1044, 1156, 1192, 1256, 1300, 1332, 1508, 1732, 1796, 1800, 1832, 1872, 1940, 2056, 2196, 2308, 2336, 2372, 2448, 2664, 2696, 2740, 2804, 2848, 2880, 3060, 3200, 3280
Offset: 1

Views

Author

Angad Singh, Jul 16 2022

Keywords

Comments

The terms in this sequence can be considered as a solution to the "near miss" problem which occurs frequently while solving Diophantine equations. It is known that if a number k can be written as the sum of two nonzero distinct squares then so can k^2 and k^2+1. Thus, finding numbers k such that k^2+2 satisfies the same property makes it quite interesting.

Examples

			40 is a term since 40 = 2^2 + 6^2 as well as 40^2 + 2 = 1602 = 9^2 + 39^2.
320 is a term since 320 = 8^2 + 16^2 as well as 320^2 + 2 = 102402 = 201^2 + 249^2.
		

Crossrefs

Programs

  • PARI
    is1(n)= for( i=1, #n=factor(n)~%4, n[1, i]==3 && n[2, i]%2 && return); n && ( vecmin(n[1, ])==1 || (n[1, 1]==2 && n[2, 1]%2)); \\ A000404
    isok(k) = is1(k) && is1(k^2+2); \\ Michel Marcus, Jul 18 2022
    
  • Python
    from itertools import count, islice
    from sympy import factorint
    def A355778_gen(startvalue=1): # generator of terms >= startvalue
        for n in count(max(startvalue, 1)):
            c = False
            for p in (f:=factorint(n)):
                if (q:= p & 3)==3 and f[p]&1:
                    break
                elif q == 1:
                    c = True
            else:
                if c or f.get(2, 0)&1:
                    c = False
                    for p in (f:=factorint(n**2+2)):
                        if (q:= p & 3)==3 and f[p]&1:
                            break
                        elif q == 1:
                            c = True
                    else:
                        if c or f.get(2, 0)&1:
                            yield n
    A355778_list = list(islice(A355778_gen(),30)) # Chai Wah Wu, Sep 14 2022
Previous Showing 11-16 of 16 results.