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

A217462 a(n) is the sum of total number of nonnegative integer solutions to each of a^2 + b^2 = n, a^2 + 2*b^2 = n, a^2 + 3*b^2 = n and a^2 + 7*b^2 = n. (Order does not matter for the equation a^2+b^2 = n).

Original entry on oeis.org

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

Views

Author

V. Raman, Oct 04 2012

Keywords

Comments

Note: For the equation a^2 + b^2 = n, if there are two solutions (a,b) and (b,a), then they will be counted only once.
The sequences A216501 and A216671 give how many of the four k values, k = 1, 2, 3, 7 does the equation a^2 + k*b^2 = n have a solution to.
1, 2, 3, 7 are the first four numbers, with the class number 1.
"If a composite number C is of the form a^2 + kb^2 for some integers a & b, then every prime factor of C raised to an odd power is of the form c^2 + kd^2 for some integers c & d."
This statement is only true for k = 1, 2, 3.
For k = 7, with the exception of the prime factor 2, the statement mentioned above is true.
A number can be written as a^2 + b^2 if and only if it has no prime factor congruent to 3 (mod 4) raised to an odd power.
A number can be written as a^2 + 2b^2 if and only if it has no prime factor congruent to 5 (mod 8) or 7 (mod 8) raised to an odd power.
A number can be written as a^2 + 3b^2 if and only if it has no prime factor congruent to 2 (mod 3) raised to an odd power.
A number can be written as a^2 + 7b^2 if and only if it has no prime factor congruent to 3 (mod 7) or 5 (mod 7) or 6 (mod 7) raised to an odd power, and the exponent of 2 is not 1.

References

  • David A. Cox, Primes of the Form x^2 + n y^2, Wiley, 1989.

Crossrefs

Cf. A217868 (related sequence of this when the order does matter for the equation a^2 + b^2 = n).
Cf. A216501 (how many of the four k values, k = 1, 2, 3, 7 does the equation a^2 + k*b^2 = n have a solution to, with a > 0, b > 0).
Cf. A216671 (how many of the four k values, k = 1, 2, 3, 7 does the equation a^2 + k*b^2 = n have a solution to, with a >= 0, b >= 0).
Cf. A000161 (number of solutions to n = a^2+b^2 (when the solutions (a, b) and (b, a) are being counted as the same) with a >= 0, b >= 0).
Cf. A216282 (number of solutions to n = a^2+2*b^2 with a >= 0, b >= 0).
Cf. A119395 (number of solutions to n = a^2+3*b^2 with a >= 0, b >= 0).
Cf. A216512 (number of solutions to n = a^2+7*b^2 with a >= 0, b >= 0).

Programs

  • PARI
    for(n=1,100,sol=0;for(x=0,100,if(issquare(n-x*x)&&n-x*x>=0&&x*x<=n-x*x,sol++);if(issquare(n-2*x*x)&&n-2*x*x>=0,sol++);if(issquare(n-3*x*x)&&n-3*x*x>=0,sol++);if(issquare(n-7*x*x)&&n-7*x*x>=0,sol++));printf(sol","))

A306358 Odd numbers which are the sum of two squares in two or more different ways.

Original entry on oeis.org

25, 65, 85, 125, 145, 169, 185, 205, 221, 225, 265, 289, 305, 325, 365, 377, 425, 445, 481, 485, 493, 505, 533, 545, 565, 585, 625, 629, 685, 689, 697, 725, 745, 765, 785, 793, 841, 845, 865, 901, 905, 925, 949, 965, 985, 1025, 1037, 1073, 1105, 1125, 1145, 1157, 1165, 1189, 1205, 1225, 1241
Offset: 1

Views

Author

Joerg Arndt, Feb 10 2019

Keywords

Comments

Odd terms of A118882.
Odd numbers k such that A000161(k) >= 2.

Examples

			The decompositions of the first terms are
25: [[4, 3], [5, 0]]
65: [[7, 4], [8, 1]]
85: [[7, 6], [9, 2]]
125: [[10, 5], [11, 2]]
145: [[9, 8], [12, 1]]
169: [[12, 5], [13, 0]]
185: [[11, 8], [13, 4]]
205: [[13, 6], [14, 3]]
221: [[11, 10], [14, 5]]
225: [[12, 9], [15, 0]]
265: [[12, 11], [16, 3]]
289: [[15, 8], [17, 0]]
305: [[16, 7], [17, 4]]
325: [[15, 10], [17, 6], [18, 1]]
365: [[14, 13], [19, 2]]
377: [[16, 11], [19, 4]]
		

Programs

  • PARI
    A000161(n)=sum(k=sqrtint((n-1)\2)+1, sqrtint(n), issquare(n-k^2));
    is(n)=if(n%2==1, A000161(n)>1, 0);
    select(is,vector(1300,n,n))
    
  • Python
    from itertools import count, islice
    from math import prod
    from sympy import factorint
    def A306358_gen(startvalue=1): # generator of terms >= startvalue
        for n in count(max(startvalue+1-(startvalue&1),1),2):
            f = factorint(n)
            if 1>1):
                yield n
    A306358_list = list(islice(A306358_gen(),30)) # Chai Wah Wu, Sep 09 2022

A328804 The maximum value of j + k where j and k are positive integers with j^2 + k^2 = A001481(n).

Original entry on oeis.org

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

Views

Author

Peter Kagey, Oct 27 2019

Keywords

Examples

			For n = 14, A001481(14) = 25 = 0^2 + 5^2 = 3^2 + 4^2, so a(14) = max{0+5, 3+4} = 7.
		

Crossrefs

Programs

  • Python
    from itertools import count, islice
    from sympy.solvers.diophantine.diophantine import diop_DN
    from sympy import factorint
    def A328804_gen(): # generator of terms
        return map(lambda n: max((a+b for a, b in diop_DN(-1,n))), filter(lambda n:(lambda m:all(d&3!=3 or m[d]&1==0 for d in m))(factorint(n)), count(0)))
    A328804_list = list(islice(A328804_gen(),30)) # Chai Wah Wu, Sep 09 2022

A379925 Numbers k for which nonnegative integers x and y exist such that x^2 + y^2 = k and x + y is a square.

Original entry on oeis.org

0, 1, 8, 10, 16, 41, 45, 53, 65, 81, 128, 130, 136, 146, 160, 178, 200, 226, 256, 313, 317, 325, 337, 353, 373, 397, 425, 457, 493, 533, 577, 625, 648, 650, 656, 666, 680, 698, 720, 746, 776, 810, 848, 890, 936, 986, 1040, 1098, 1160, 1201, 1205, 1213, 1225, 1226
Offset: 1

Views

Author

Felix Huber, Jan 25 2025

Keywords

Comments

Numbers k for which exists at least one solution to k = x^2 + (z^2 - x)^2 in integers x and z with x >= 0 and z >= sqrt(2*x).
Subsequence of A001481.

Examples

			10 is in the sequence because 10 = 1^2 + 3^2 and 1 + 3 = 2^2.
81 is in the sequence because 81 = 0^2 + 9^2 and 0 + 9 = 3^2.
		

Crossrefs

Programs

  • Maple
    # Calculates the first 10005 terms.
    A379925:=proc(K)
        local i,j,L;
        L:={};
        for i from 0 to floor(sqrt((K+1)^2)/2) do
            for j from 0 to floor(sqrt((K+1)^2/2-i^2)) do
                if issqr(i+j) then
                    L:=L union {i^2+j^2}
                fi
            od
        od;
        return op(L)
    end proc;
    A379925(1737);
  • PARI
    isok(n)=my(x=0, r=0); while(x<=sqrt(n) && r==0, if(issquare(n-x^2) && issquare(x+sqrtint(n-x^2)), r=1); x++); r; \\ Michel Marcus, Feb 10 2025

Formula

k = m^(4*j) is in the sequence for nonnegative integers m and j (not both 0) because x = 0 and z = m^j is a solution to m^(4*j) = x^2 + (z^2 - x)^2.

A116905 Number of partitions of n-th 3-almost prime into 2 squares.

Original entry on oeis.org

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

Views

Author

Jonathan Vos Post, Mar 15 2006

Keywords

Comments

See also A000161 Number of partitions of n into 2 squares (when order does not matter and zero is allowed).

Examples

			a(1) = 1 because A014612(1) = 8 = 2^2 + 2^2, the unique sum of squares.
a(2) = 0 because A014612(2) = 12 has no decomposition into sum of 2 squares because it has a prime factor p == 3 (mod 4) with an odd power.
a(11) = 2 because A014612(11) = 50 = 2*5^2 = 1^2 + 7^2 = 5^2 + 5^2.
a(30) = 2 because A014612(30) = 125 = 5^3 = 2^2 + 11^2 = 5^2 + 1^0.
a(31) = 2 because A014612(31) = 130 = 2*5*13 = 3^2 + 11^2 = 7^2 + 9^2.
a(39) = 2 because A014612(39) = 170 = 2*5*17 = 1^2 + 13^2 = 7^2 + 11^2.
		

Crossrefs

Formula

a(n) = A000161(A014612(n)).
Previous Showing 61-65 of 65 results.