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-20 of 65 results. Next

A000925 Number of ordered ways of writing n as a sum of 2 squares of nonnegative integers.

Original entry on oeis.org

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

Views

Author

Jacques Haubrich (jhaubrich(AT)freeler.nl)

Keywords

References

  • A. Das and A. C. Melissinos, Quantum Mechanics: A Modern Introduction, Gordon and Breach, 1986, p. 47.
  • E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985.

Crossrefs

Programs

  • Haskell
    a000925 n = sum $ map (a010052 . (n -)) $ takeWhile (<= n) a000290_list
    -- Reinhard Zumkeller, Sep 14 2014
  • Mathematica
    a[n_] := (pr = PowersRepresentations[n, 2, 2]; Count[Union[Join[pr, Reverse /@ pr]], {j_ /; j >= 0, k_ /; k >= 0}]); a /@ Range[0, 100] (* Jean-François Alcover, Apr 05 2011 *)
    nn = 100; t = CoefficientList[Series[Sum[x^k^2, {k, 0, Sqrt[nn]}]^2, {x, 0, nn}], x] (* T. D. Noe, Apr 05 2011 *)
    SquareQ[n_] := IntegerQ[Sqrt[n]]; Table[Count[FrobeniusSolve[{1, 1}, n], {?SquareQ}], {n, 0, 100}] (* Robert G. Wilson v, Apr 15 2017 *)
  • PARI
    a(n)=sum(i=0,n,sum(j=0,n,if(i^2+j^2-n,0,1)))
    

Formula

Coefficient of q^k in (1/4)*(1 + theta_3(0, q))^2.
a(A001481(n))>0; a(A022544(n))=0. - Benoit Cloitre, Apr 20 2003

A133388 Largest integer m such that n-m^2 is a square, or 0 if no such m exists.

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Nov 23 2007

Keywords

Comments

The sequence could be extended to a(0) = 0.
We could have defined a(n) = -1 instead of 0 if n is not sum of two squares, and then include unambiguously a(0) = 0. At present, a(n) = 0 <=> A000161(n) = 0.

Examples

			a(3) = 0 since 3 cannot be written as sum of 2 perfect squares;
a(5) = 2 since 5 = 2^2 + 1^2.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) local t, d;
          for t from 0 do d:= n-t^2;
            if d<0 then break elif issqr(d) then return isqrt(d) fi
          od; 0
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, May 14 2015
  • Mathematica
    a[n_] := Module[{m, d, s}, For[m = 0, True, m++, d = n - m^2; If[d < 0, Break[], s = Sqrt[d]; If[IntegerQ[s], Return[s]]]]; 0];
    Table[a[n], {n, 1, 100}] (* Jean-François Alcover, May 18 2018, after Alois P. Heinz *)
  • PARI
    sum2sqr(n)={ if(n>1, my(L=List(), f, p=1); for(i=1, matsize(f=factor(n))[1], if(f[i,1]%4==1, listput(L, [qfbsolve(Qfb(1,0,1), f[i,1])*[1, I]~, f[i,2]] ),/*elseif*/ f[i,1]==2, p = (1+I)^f[i,2],/*elseif*/ bittest(f[i,2],0), return([]),/*else*/ p *= f[i,1]^(f[i,2]\2))); L=apply(s->vector(s[2]+1, j, s[1]^(s[2]+1-j)*conj(s[1])^(j-1)), L); my(S=List()); forvec(T=vector(#L, i, [1,#L[i]]), listput(S, prod( j=1, #T, L[j][T[j]] ))); Set(apply(f->vecsort(abs([real(f), imag(f)])), Set(S)*p)), if(n<0, [], [[0, n]]))} \\ updated by M. F. Hasler, May 12 2018. (If PARI version 2.12.x returns an error, append [1] to qfbsolve(...) above. - M. F. Hasler, Dec 12 2019)
    apply( A133388=n->if(n=sum2sqr(n),vecmax(Mat(n~))), [1..50]) \\ This sequence: maximum
    
  • Python
    from sympy.solvers.diophantine.diophantine import diop_DN
    def A133388(n): return max((a for a, b in diop_DN(-1,n)),default=0) # Chai Wah Wu, Sep 08 2022

Formula

a(n) = max( sup { max(a,b) | a^2+b^2 = n ; a,b in Z }, 0 )
a(A022544(j))=0, j>0. - R. J. Mathar, Jun 17 2009
a(n^2) = a(n^2 + 1) = n, for all n. Conversely, whenever a(n) = a(n+1), then n = k^2. - M. F. Hasler, Sep 02 2018

A000174 Number of partitions of n into 5 squares.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 2, 2, 2, 3, 2, 1, 3, 3, 3, 3, 4, 3, 3, 2, 2, 4, 4, 4, 4, 5, 3, 3, 4, 3, 5, 5, 5, 6, 5, 3, 5, 5, 5, 6, 5, 6, 5, 4, 4, 6, 7, 6, 8, 8, 7, 5, 6, 5, 8, 8, 4, 9, 7, 6, 7, 7, 8, 9, 9, 7, 9, 6, 7, 8, 10, 9, 9, 11, 7, 8, 8, 8, 11, 11, 9, 12, 11, 7, 9, 9, 12, 13, 9, 10, 11, 8, 6, 10, 13, 13, 13
Offset: 0

Views

Author

Keywords

References

  • E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, p. 84.

Crossrefs

Equivalent sequences for other numbers of squares: A010052 (1), A000161 (2), A000164 (3), A002635 (4), A000177 (6), A025422 (7), A025423 (8), A025424 (9), A025425 (10).
Cf. A025429, A295160 (largest number k with a(k) = n).

Programs

  • Mathematica
    Table[PowersRepresentations[n, 5, 2] // Length, {n, 0, 100}] (* Jean-François Alcover, Feb 04 2016 *)

A300667 Number of ways to write n as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers and z <= w such that 3*x or y is a square and x + 2*y is also a square.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Mar 10 2018

Keywords

Comments

Conjecture 1: a(n) > 0 for all n >= 0, and a(n) = 1 only for n = 16^k*m with k = 0,1,2,... and m = 0, 3, 7, 11, 12, 15, 28, 39, 47, 60, 71, 92, 119, 172, 232, 253, 263, 316, 347, 515.
Conjecture 2: Each n = 0,1,2,... can be written as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that 3*x or y is a square and 2*x - y is also a square.
By the author's 2017 JNT paper, any nonnegative integer can be written as the sum of a fourth power and three squares.
See also A281976, A300666, A300708 and A300712 for similar conjectures.
a(n) > 0 for all n = 0..10^8. Also, Conjecture 2 holds for all n = 0..10^8. In a 2018 paper Y.-C. Sun and Z.-W. Sun proved that any nonnegative integer can be written as x^2 + y^2 + z^2 + w^2 with x + 2*y a square, where x,y,z,w are nonnegative integers. - Zhi-Wei Sun, Oct 04 2020

Examples

			a(12) = 1 since 12 = 0^2 + 2^2 + 2^2 + 2^2 with 3*0 = 0^2 and 0 + 2*2 = 2^2.
a(39) = 1 since 39 = 2^2 + 1^2 + 3^2 + 5^2 with 1 = 1^2 and 2 + 2*1 = 2^2.
a(172) = 1 since 172 = 7^2 + 1^2 + 1^2 + 11^2 with 1 = 1^2 and 7 + 2*1 = 3^2.
a(232) = 1 since 232 = 0^2 + 0^2 + 6^2 + 14^2 with 0 = 0^2 and 0 + 2*0 = 0^2.
a(253) = 1 since 253 = 8^2 + 4^2 + 2^2 + 13^2 with 4 = 2^2 and 8 + 2*4 = 4^2.
a(263) = 1 since 263 = 3^2 + 3^2 + 7^2 + 14^2 with 3*3 = 3^2 and 3 + 2*3 = 3^2.
a(515) = 1 since 515 = 1^2 + 0^2 + 15^2 + 17^2 with 0 = 0^2 and 1 + 2*0 = 1^2.
		

References

  • Yu-Chen Sun and Zhi-Wei Sun, Some variants of Lagrange's four squares theorem, Acta Arith. 183(2018), 339-356.

Crossrefs

Programs

  • Mathematica
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
    tab={};Do[r=0;Do[If[(SQ[3(m^2-2y)]||SQ[y])&&SQ[n-(m^2-2y)^2-y^2-z^2],r=r+1],{m,0,(5n)^(1/4)},{y,0,Min[m^2/2,Sqrt[n]]},{z,0,Sqrt[Max[0,(n-(m^2-2y)^2-y^2)/2]]}];tab=Append[tab,r],{n,0,80}];Print[tab]
  • PARI
    A300667(n)=sum(x=0,sqrtint(n),sum(y=0,sqrtint(n-x^2),if(issquare(x+2*y)&&(issquare(y)||issquare(3*x)),if(n>x^2+y^2,A000161(n-x^2-y^2),1)))) \\ M. F. Hasler, Mar 11 2018

A118882 Numbers which are the sum of two squares in two or more different ways.

Original entry on oeis.org

25, 50, 65, 85, 100, 125, 130, 145, 169, 170, 185, 200, 205, 221, 225, 250, 260, 265, 289, 290, 305, 325, 338, 340, 365, 370, 377, 400, 410, 425, 442, 445, 450, 481, 485, 493, 500, 505, 520, 530, 533, 545, 565, 578, 580, 585, 610, 625, 629, 650, 676, 680
Offset: 1

Views

Author

Keywords

Comments

Numbers whose prime factorization includes at least two primes (not necessarily distinct) congruent to 1 mod 4 and any prime factor congruent to 3 mod 4 has even multiplicity. Products of two values in A004431.
Squares of distances that are the distance between two points in the square lattice in two or more nontrivially different ways. A quadrilateral with sides a,b,c,d has perpendicular diagonals iff a^2+c^2 = b^2+d^2. This sequence is the sums of the squares of opposite sides of such quadrilaterals, excluding kites (a=b,c=d), but including right triangles (the degenerate case d=0).

Examples

			50 = 7^2 + 1^2 = 5^2 + 5^2, so 50 is in the sequence.
		

Crossrefs

Programs

  • Haskell
    import Data.List (findIndices)
    a118882 n = a118882_list !! (n-1)
    a118882_list = findIndices (> 1) a000161_list
    -- Reinhard Zumkeller, Aug 16 2011
    
  • Mathematica
    Select[Range[1000], Length[PowersRepresentations[#, 2, 2]] > 1&] (* Jean-François Alcover, Mar 02 2019 *)
  • Python
    from itertools import count, islice
    from math import prod
    from sympy import factorint
    def A118882_gen(startvalue=1): # generator of terms >= startvalue
        for n in count(max(startvalue,1)):
            f = factorint(n)
            if 1>1):
                yield n
    A118882_list = list(islice(A118882_gen(),30)) # Chai Wah Wu, Sep 09 2022

Formula

A000161(a(n)) > 1. [Reinhard Zumkeller, Aug 16 2011]

A025435 Number of partitions of n into 2 distinct squares.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

a(A004435(n)) = 0; a(A001983(n)) > 0. - Reinhard Zumkeller, Dec 20 2013

Examples

			G.f. = x + x^4 + x^5 + x^9 + x^10 + x^13 + x^16 + x^17 + x^20 + 2*x^25 + ...
		

Crossrefs

Programs

  • Haskell
    a025435 0 = 0
    a025435 n = a010052 n + sum
       (map (a010052 . (n -)) $ takeWhile (< n `div` 2) $ tail a000290_list)
    -- Reinhard Zumkeller, Dec 20 2013
    
  • Maple
    A025435 := proc(n)
        local i, j, ans;
        ans := 0;
        for i from 0 to n do
            for j from i+1 to n do
                if i^2+j^2=n then
                    ans := ans+1
                fi
            end do
        end do;
        ans ;
    end proc: # R. J. Mathar, Aug 04 2018
  • Mathematica
    a[ n_] := If[ n < 0, 0, Sum[ Boole[ n == i^2 + j^2], {i, Sqrt[n]}, {j, 0, i - 1}]]; (* Michael Somos, Jun 24 2015 *)
    a[ n_] := Length@ PowersRepresentations[ n, 2, 2] - Boole @ IntegerQ @ Sqrt[2 n]; (* Michael Somos, Jun 24 2015 *)
    a[ n_] := SeriesCoefficient[ With[ {f = (EllipticTheta[ 3, 0, x] + 1)/2, g = (EllipticTheta[ 3, 0, x^2] + 1)/2}, f f - g] / 2, {x, 0, n}]; (* Michael Somos, Jun 24 2015 *)
  • PARI
    {a(n) = if( n<0, 0, sum(i=1, sqrtint(n), sum(j=0, i-1, n == i^2 + j^2)))}; /* Michael Somos, Jun 24 2015 */
    
  • PARI
    A025435(n)=sum(k=sqrtint((n-1+!n)\2)+1, sqrtint(n), issquare(n-k^2))-issquare(n/2) \\ or A000161(n)-issquare(n/2). - M. F. Hasler, Aug 05 2018
    
  • Python
    from math import prod
    from sympy import factorint
    def A025435(n):
        f = factorint(n)
        return int(not any(e&1 for p,e in f.items() if p>2))*(1-((f.get(2,0)&1)<<1)) + (((m:=prod(1 if p==2 else (e+1 if p&3==1 else (e+1)&1) for p, e in f.items()))+((((~n & n-1).bit_length()&1)<<1)-1 if m&1 else 0))>>1) if n else 0 # Chai Wah Wu, Sep 08 2022

Formula

a(n) = A000161(n) - A010052(2*n). - M. F. Hasler, Aug 05 2018
a(n) = Sum_{i=1..n} c(i) * c(2*n-i), where c is the square characteristic (A010052). - Wesley Ivan Hurt, Nov 26 2020

A063014 Number of solutions to n^2 = b^2 + c^2 (with c >= b >= 0).

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Jul 26 2001

Keywords

Examples

			a(0)=1 since 0^2 = 0^2 + 0^2;
a(5)=2 since 5^2 = 0^2 + 5^2 = 3^2 + 4^2;
a(25)=3 since 25^2 = 0^2 + 25^2 = 7^2 + 24^2 = 15^2 + 20^2.
		

Crossrefs

Column k=2 of A255212.

Programs

  • Maple
    with(NumberTheory):
    A063014 := n -> nops(SumOfSquares(n^2));
    seq(A063014(n), n = 0 .. 100); # Felix Huber, Jun 01 2024

Formula

a(0) = 1; a(n) = A046080(n) + 1 for n > 0. [amended by Georg Fischer, Jan 25 2020]
a(n) = A000161(n^2). - Christian Krause, Dec 08 2022

A234300 Number of unit squares, aligned with a Cartesian grid, partially encircled along the edge of the first quadrant of a circle centered at the origin ordered by increasing radius.

Original entry on oeis.org

0, 1, 1, 3, 2, 3, 3, 5, 3, 5, 4, 5, 5, 7, 5, 7, 5, 7, 7, 9, 7, 9, 8, 9, 7, 9, 7, 11, 9, 11, 9, 11, 10, 11, 9, 11, 11, 13, 11, 13, 11, 13, 11, 13, 11, 13, 13, 15, 12, 15, 13, 15, 13, 15, 13, 15, 13, 15, 15, 17, 13, 17, 15, 17, 16, 17, 15, 17, 15, 17, 15, 17, 17, 19, 17, 19, 15, 19, 17, 19, 17, 19, 17, 19, 18, 19, 17, 21, 19, 21, 19, 21, 19, 21, 19, 21, 19, 21, 19, 21
Offset: 0

Views

Author

Rajan Murthy, Dec 22 2013

Keywords

Comments

The first decrease from a(4) = 3 to a(5) = 2 occurs when the radius squared increases from an arbitrary position between 1 and 2 (when 3 squares are on the edge) to exactly 2 (when only 2 squares are on the edge because the circle of square radius 2 passes through the upper right corner on the y=x line). Similar decreases occur when the circle passes through other upper right corners. At least some (if not all) adjacent duplicates occur when the square radius corresponds to a perfect square, that is a corner which is only a lower right corner, i.e., on the y = 0 line. For example, a(6)=a(7)=3 occurs when, for n = 6 , a(n) corresponding to the interval between 2 and 4; and, for n=7, a(n) corresponding to the exact square radius of 4. Some of the confusion may come from the fact that for odd n, there is a unique circle corresponding to elements of a(n) (passing through the corner of specific square(s) on the grid), while for even n, there is a set of circles with a range of radii (which do not pass through corners) corresponding to the elements of a(n). It seems easier to organize the concept in terms of intervals and corners for the sake of consistency.
a(n) is even when the radius squared corresponds to an element of A024517.

Examples

			At radius 0, there are no partially filled squares.  At radius >1 but < sqrt(2), there are 3 partially filled squares along the edge of the circle.  At radius = sqrt(2), there are 2 partially filled squares along the edge of the circle.
		

Crossrefs

Cf. A001481 (corresponds to the square radius of alternate entries), A232499 (number of completely encircled squares when the radii are indexed by A000404), A235141 (first differences), A024517.
A237708 is the analog for the 3-dimensional Cartesian lattice and A239353 for the 4-dimensional Cartesian lattice.

Programs

  • Scilab
    function index = n_edgeindex (N)
        if N < 1 then
            N = 1
        end
        N = floor(N)
        i = 0:ceil(N/2)
        i = i^2
        index = i
        for j = 1:length(i)
           index = [index i+ i(j).*ones(i)]
        end
        index = unique(index)
        index = index(1:ceil(N))
        d = diff(index)/2
        d = d +  index(1:length(d))
        index = gsort([index d],"g","i")
        index = index(1:N)
    endfunction
    function l = n_edge_n (i)
            l=0
            h=0
            while (i > (2*h^2))
                h=h+1
            end
            if i < (2*h^2) then
                    l = l+1
            end
            if i >1 then
                t=[0 1]
               while (i>max(t))
                   t = [t (sqrt(max(t))+1)^2]
               end
            for j = 1:h
               b=t
               t=[2*(j)^2 (j+1)^2 + (j)^2]
               while (i>max(t))
                   t = [t (sqrt(max(t)-(j)^2)+1)^2 + (j)^2]
               end
               l = l+ 2*(length(b)-length(t))
               if max(t) == i then
                   l = l-2
               end
            end
           end
    endfunction
    function a =n_edge (N)
        if N <1 then
            N =1
        end
        N = floor(N)
        a= []
        index = n_edgeindex(N)
        for i = index
            a = [a n_edge_n(i)]
        end
    endfunction

Formula

a(2k+1) = a(2k) + 2*A000161(A001481(k+1)) - A010052(A001481(k+1)/2). - Rajan Murthy, Jan 14 2013
a(2k) = a(2k-1) - 2*(A000161(A001481(k+1)) - A010052(A001481(k+1))) + A010052(A001481(k+1)/2). - Rajan Murthy, Jan 14 2013

A069011 Triangle with T(n,k) = n^2 + k^2.

Original entry on oeis.org

0, 1, 2, 4, 5, 8, 9, 10, 13, 18, 16, 17, 20, 25, 32, 25, 26, 29, 34, 41, 50, 36, 37, 40, 45, 52, 61, 72, 49, 50, 53, 58, 65, 74, 85, 98, 64, 65, 68, 73, 80, 89, 100, 113, 128, 81, 82, 85, 90, 97, 106, 117, 130, 145, 162, 100, 101, 104, 109, 116, 125, 136, 149, 164, 181, 200
Offset: 0

Views

Author

Henry Bottomley, Apr 02 2002

Keywords

Comments

For any i,j >=0 a(i)*a(j) is a member of this sequence, since (a^2 + b^2)*(c^2 + d^2) = (a*c + b*d)^2 + (a*d - b*c)^2. - Boris Putievskiy, May 05 2013
A227481(n) = number of squares in row n. - Reinhard Zumkeller, Oct 11 2013
Norm of the complex numbers n +- i*k and k +- i*n, where i denotes the imaginary unit. - Stefano Spezia, Aug 07 2025

Examples

			Triangle T(n,k) begins:
    0;
    1,   2;
    4,   5,   8;
    9,  10,  13,  18;
   16,  17,  20,  25,  32;
   25,  26,  29,  34,  41,  50;
   36,  37,  40,  45,  52,  61,  72;
   49,  50,  53,  58,  65,  74,  85,  98;
   64,  65,  68,  73,  80,  89, 100, 113, 128;
   81,  82,  85,  90,  97, 106, 117, 130, 145, 162;
  100, 101, 104, 109, 116, 125, 136, 149, 164, 181, 200;
  ...
		

Crossrefs

Cf. A001481 for terms in this sequence, A000161 for number of times each term appears, A048147 for square array.
Column k=0 gives A000290.
Main diagonal gives A001105.
Row sums give A132124.
T(2n,n) gives A033429.

Programs

  • Haskell
    a069011 n k = a069011_tabl !! n !! k
    a069011_row n = a069011_tabl !! n
    a069011_tabl = map snd $ iterate f (1, [0]) where
       f (i, xs@(x:_)) = (i + 2, (x + i) : zipWith (+) xs [i + 1, i + 3 ..])
    -- Reinhard Zumkeller, Oct 11 2013
  • Mathematica
    Table[n^2 + k^2, {n, 0, 12}, {k, 0, n}] (* Paolo Xausa, Aug 07 2025 *)

Formula

T(n+1,k+1) = T(n,k) + 2*(n+k+1), k=0..n; T(n+1,0) = T(n,0) + 2*n + 1. - Reinhard Zumkeller, Oct 11 2013
G.f.: x*(1 + 2*y + 5*x^3*y^2 - x^2*y*(2 + 5*y) + x*(1 - 4*y + 2*y^2))/((1 - x)^3*(1 - x*y)^3). - Stefano Spezia, Aug 04 2025

A125022 Numbers with a unique partition as the sum of 2 squares x^2 + y^2.

Original entry on oeis.org

0, 1, 2, 4, 5, 8, 9, 10, 13, 16, 17, 18, 20, 26, 29, 32, 34, 36, 37, 40, 41, 45, 49, 52, 53, 58, 61, 64, 68, 72, 73, 74, 80, 81, 82, 89, 90, 97, 98, 101, 104, 106, 109, 113, 116, 117, 121, 122, 128, 136, 137, 144, 146, 148, 149, 153, 157, 160, 162, 164, 173, 178, 180, 181
Offset: 1

Views

Author

Artur Jasinski, Nov 16 2006

Keywords

Comments

A000161(a(n)) = 1. [Reinhard Zumkeller, Aug 16 2011]

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a125022 n = a125022_list !! (n-1)
    a125022_list = elemIndices 1 a000161_list
    -- Reinhard Zumkeller, Aug 16 2011
  • Mathematica
    Select[Range[0,200],Length@PowersRepresentations[#,2,2]==1&] (* Giorgos Kalogeropoulos, Mar 21 2021 *)

Formula

a(n) = A125021(n)/2.

Extensions

Name edited by Giorgos Kalogeropoulos, Mar 21 2021
Previous Showing 11-20 of 65 results. Next