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-10 of 12 results. Next

A124979 Numbers in A118882 for which 5 is not a divisor.

Original entry on oeis.org

169, 221, 289, 338, 377, 442, 481, 493, 533, 578, 629, 676, 689, 697, 754, 793, 841, 884, 901, 949, 962, 986, 1037, 1066, 1073, 1156, 1157, 1189, 1241, 1258, 1261, 1313, 1352, 1369, 1378, 1394, 1417, 1469, 1508, 1513, 1517
Offset: 1

Views

Author

Artur Jasinski, Nov 15 2006

Keywords

Crossrefs

Cf. A118882.

Programs

  • Python
    from itertools import count, islice
    from math import prod
    from sympy import factorint
    def A124979_gen(startvalue=1): # generator of terms >= startvalue
        for n in count(max(startvalue,1)):
            f = factorint(n)
            if n%5 and 1>1):
                yield n
    A124979_list = list(islice(A124979_gen(),30)) # Chai Wah Wu, Sep 09 2022

Extensions

Corrected and extended by M. F. Hasler, Feb 08 2009
Further corrections following an observation by P. McNab, by M. F. Hasler, Jul 08 2015

A001481 Numbers that are the sum of 2 squares.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Numbers n such that n = x^2 + y^2 has a solution in nonnegative integers x, y.
Closed under multiplication. - David W. Wilson, Dec 20 2004
Also, numbers whose cubes are the sum of 2 squares. - Artur Jasinski, Nov 21 2006 (Cf. A125110.)
Terms are the squares of smallest radii of circles covering (on a square grid) a number of points equal to the terms of A057961. - Philippe Lallouet (philip.lallouet(AT)wanadoo.fr), Apr 16 2007. [Comment corrected by T. D. Noe, Mar 28 2008]
Numbers with more 4k+1 divisors than 4k+3 divisors. If a(n) is a member of this sequence, then so too is any power of a(n). - Ant King, Oct 05 2010
A000161(a(n)) > 0; A070176(a(n)) = 0. - Reinhard Zumkeller, Feb 04 2012, Aug 16 2011
Numbers that are the norms of Gaussian integers. This sequence has unique factorization; the primitive elements are A055025. - Franklin T. Adams-Watters, Nov 25 2011
These are numbers n such that all of n's odd prime factors congruent to 3 modulo 4 occur to an even exponent (Fermat's two-squares theorem). - Jean-Christophe Hervé, May 01 2013
Let's say that an integer n divides a lattice if there exists a sublattice of index n. Example: 2, 4, 5 divide the square lattice. The present sequence without 0 is the sequence of divisors of the square lattice. Say that n is a "prime divisor" if the index-n sublattice is not contained in any other sublattice except the original lattice itself. Then A055025 (norms of Gaussian primes) gives the "prime divisors" of the square lattice. - Jean-Christophe Hervé, May 01 2013
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
The sequence is closed under multiplication. Primitive elements are in A055025. The sequence can be split into 3 multiplicatively closed subsequences: {0}, A004431 and A125853. - Jean-Christophe Hervé, Nov 17 2013
Generalizing Jasinski's comment, same as numbers whose odd powers are the sum of 2 squares, by Fermat's two-squares theorem. - Jonathan Sondow, Jan 24 2014
By the 4 squares theorem, every nonnegative integer can be expressed as the sum of two elements of this sequence. - Franklin T. Adams-Watters, Mar 28 2015
There are never more than 3 consecutive terms. Runs of 3 terms start at 0, 8, 16, 72, ... (A082982). - Ivan Neretin, Nov 09 2015
Conjecture: barring the 0+2, 0+4, 0+8, 0+16, ... sequence, the sum of 2 distinct terms in this sequence is never a power of 2. - J. Lowell, Jan 14 2022
All the areas of squares whose vertices have integer coordinates. - Neeme Vaino, Jun 14 2023
Numbers represented by the definite binary quadratic forms x^2 + 2nxy + (n^2+1)y^2 for any integer n. This sequence contains the even powers of any integer. An odd power of a number appears only if the number itself belongs to the sequence. The equation given in the comment by Boris Putievskiy 2013 is Brahmagupta's identity with n = 1. It proves that any set of numbers of the form a^2 + nb^2 is closed under multiplication. - Klaus Purath, Sep 06 2023

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 106.
  • David A. Cox, "Primes of the Form x^2 + n y^2", Wiley, 1989.
  • L. Euler, (E388) Vollständige Anleitung zur Algebra, Zweiter Theil, reprinted in: Opera Omnia. Teubner, Leipzig, 1911, Series (1), Vol. 1, p. 417.
  • S. R. Finch, Mathematical Constants, Cambridge, 2003, pp. 98-104.
  • G. H. Hardy, Ramanujan, pp. 60-63.
  • P. Moree and J. Cazaran, On a claim of Ramanujan in his first letter to Hardy, Expos. Math. 17 (1999), pp. 289-312.
  • 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

Disjoint union of A000290 and A000415.
Complement of A022544.
A000404 gives another version. Subsequence of A091072, supersequence of A046711.
Column k=2 of A336820.

Programs

  • Haskell
    a001481 n = a001481_list !! (n-1)
    a001481_list = [x | x <- [0..], a000161 x > 0]
    -- Reinhard Zumkeller, Feb 14 2012, Aug 16 2011
    
  • Magma
    [n: n in [0..160] | NormEquation(1, n) eq true]; // Arkadiusz Wesolowski, May 11 2016
    
  • Maple
    readlib(issqr): for n from 0 to 160 do for k from 0 to floor(sqrt(n)) do if issqr(n-k^2) then printf(`%d,`,n); break fi: od: od:
  • Mathematica
    upTo = 160; With[{max = Ceiling[Sqrt[upTo]]}, Select[Union[Total /@ (Tuples[Range[0, max], {2}]^2)], # <= upTo &]]  (* Harvey P. Dale, Apr 22 2011 *)
    Select[Range[0, 160], SquaresR[2, #] != 0 &] (* Jean-François Alcover, Jan 04 2013 *)
  • PARI
    isA001481(n)=local(x,r);x=0;r=0;while(x<=sqrt(n) && r==0,if(issquare(n-x^2),r=1);x++);r \\ Michael B. Porter, Oct 31 2009
    
  • PARI
    is(n)=my(f=factor(n));for(i=1,#f[,1],if(f[i,2]%2 && f[i,1]%4==3, return(0))); 1 \\ Charles R Greathouse IV, Aug 24 2012
    
  • PARI
    B=bnfinit('z^2+1,1);
    is(n)=#bnfisintnorm(B,n) \\ Ralf Stephan, Oct 18 2013, edited by M. F. Hasler, Nov 21 2017
    
  • PARI
    list(lim)=my(v=List(),t); for(m=0,sqrtint(lim\=1), t=m^2; for(n=0, min(sqrtint(lim-t),m), listput(v,t+n^2))); Set(v) \\ Charles R Greathouse IV, Jan 05 2016
    
  • PARI
    is_A001481(n)=!for(i=2-bittest(n,0),#n=factor(n)~, bittest(n[1,i],1)&&bittest(n[2,i],0)&&return) \\ M. F. Hasler, Nov 20 2017
    
  • Python
    from itertools import count, islice
    from sympy import factorint
    def A001481_gen(): # generator of terms
        return filter(lambda n:(lambda m:all(d & 3 != 3 or m[d] & 1 == 0 for d in m))(factorint(n)),count(0))
    A001481_list = list(islice(A001481_gen(),30)) # Chai Wah Wu, Jun 27 2022

Formula

n = square * 2^{0 or 1} * {product of distinct primes == 1 (mod 4)}.
The number of integers less than N that are sums of two squares is asymptotic to constant*N/sqrt(log(N)), hence lim_{n->infinity} a(n)/n = infinity.
Nonzero terms in expansion of Dirichlet series Product_p (1 - (Kronecker(m, p) + 1)*p^(-s) + Kronecker(m, p)*p^(-2s))^(-1) for m = -1.
a(n) ~ k*n*sqrt(log n), where k = 1.3085... = 1/A064533. - Charles R Greathouse IV, Apr 16 2012
There are B(x) = x/sqrt(log x) * (K + B2/log x + O(1/log^2 x)) terms of this sequence up to x, where K = A064533 and B2 = A227158. - Charles R Greathouse IV, Nov 18 2022

Extensions

Deleted an incorrect comment. - N. J. A. Sloane, Oct 03 2023

A004431 Numbers that are the sum of 2 distinct nonzero squares.

Original entry on oeis.org

5, 10, 13, 17, 20, 25, 26, 29, 34, 37, 40, 41, 45, 50, 52, 53, 58, 61, 65, 68, 73, 74, 80, 82, 85, 89, 90, 97, 100, 101, 104, 106, 109, 113, 116, 117, 122, 125, 130, 136, 137, 145, 146, 148, 149, 153, 157, 160, 164, 169, 170, 173, 178, 180, 181, 185, 193, 194, 197
Offset: 1

Views

Author

Keywords

Comments

Numbers whose prime factorization includes at least one prime congruent to 1 mod 4 and any prime factor congruent to 3 mod 4 has even multiplicity. - Franklin T. Adams-Watters, May 03 2006
Reordering of A055096 by increasing values and without repetition. - Paul Curtz, Sep 08 2008
A063725(a(n)) > 1. - Reinhard Zumkeller, Aug 16 2011
The square of these numbers is also the sum of two nonzero squares, so this sequence is a subsequence of A009003. - Jean-Christophe Hervé, Nov 10 2013
Closed under multiplication. Primitive elements are those with exactly one prime factor congruent to 1 mod 4 with multiplicity one (A230779). - Jean-Christophe Hervé, Nov 10 2013
From Bob Selcoe, Mar 23 2016: (Start)
Numbers c such that there is d < c, d >= 1 where c + d and c - d are square. For example, 53 + 28 = 81, 53 - 28 = 25.
Given a prime p == 1 mod 4, a term appears if and only if it is of the form p^i, p*2^j or p*k^2 {i,j,k >= 1}, or a product of any combination of these forms. Therefore, the products of any terms to any powers also are terms. For example, p(1) = 5 and p(2) = 13 so term 45 appears because 5*3^2 = 45 and term 416 appears because 13*2^5 = 416; therefore 45 * 416 = 18720 appears, as does 45^3 * 416^11 = 18720^3 * 416^8.
Numbers of the form j^2 + 2*j*k + 2*k^2 {j,k >= 1}. (End)
Suppose we have a term t = x^2 + y^2. Then s^2*t = (s*x)^2 + (s*y)^2 is a term for any s > 0. Also 2*t = (y+x)^2 + (x-y)^2 is a term. It follows that q*s^2*t is a term for any s > 0 and q=1 or 2. Examples: 2*7^2*26 = 28^2 + 42^2; 6^2*17 = 6^2 + 24^2. - Jerzy R Borysowicz, Aug 11 2017
To find terms up to some upper bound u, we can search for x^2 + y^2 = t where x is odd and y is even. Then we add all numbers of the form 2^m * t <= u and then remove duplicates. - David A. Corneth, Oct 04 2017
From Bernard Schott, Apr 13 2022: (Start)
The 5th comment "Closed under multiplication" can be proved with Brahmagupta's identity: (a^2+b^2) * (c^2+d^2) = (ac + bd)^2 + (ad - bc)^2.
The subsequence of primes is A002144. (End)

Examples

			53 = 7^2 + 2^2, so 53 is in the sequence.
		

Crossrefs

Programs

  • Haskell
    import Data.List (findIndices)
    a004431 n = a004431_list !! (n-1)
    a004431_list = findIndices (> 1) a063725_list
    -- Reinhard Zumkeller, Aug 16 2011
    
  • Maple
    isA004431 := proc(n)
        local a,b ;
        for a from 2 do
            if a^2>= n then
                return false;
            end if;
            b := n -a^2 ;
            if b < 1 then
                return false ;
            end if;
            if issqr(b) then
                if ( sqrt(b) <> a ) then
                    return true;
                end if;
            end if;
        end do:
        return false;
    end proc:
    A004431 := proc(n)
        option remember ;
        local a;
        if n = 1 then
            5;
        else
            for a from procname(n-1)+1 do
                if isA004431(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc: # R. J. Mathar, Jan 29 2013
  • Mathematica
    A004431 = {}; Do[a = 2 m * n; b = m^2 - n^2; c = m^2 + n^2; AppendTo[A004431, c], {m, 100}, {n, m - 1}]; Take[Union@A004431, 63] (* Robert G. Wilson v, May 02 2009 *)
    Select[Range@ 200, Length[PowersRepresentations[#, 2, 2] /. {{0, } -> Nothing, {a, b_} /; a == b -> Nothing}] > 0 &] (* Michael De Vlieger, Mar 24 2016 *)
  • PARI
    select( isA004431(n)={n>1 && vecmin((n=factor(n)%4)[,1])==1 && ![f[1]>2 && f[2]%2 | f<-n~]}, [1..199]) \\ M. F. Hasler, Feb 06 2009, updated Nov 24 2019
    
  • PARI
    is(n)=if(n<5, return(0)); my(f=factor(n)%4); if(vecmin(f[, 1])>1, return(0)); for(i=1, #f[, 1], if(f[i, 1]==3 && f[i, 2]%2, return(0))); 1
    for(n=1, 1e3, if(is(n), print1(n, ", "))) \\ Altug Alkan, Dec 06 2015
    
  • PARI
    upto(n) = {my(res = List(), s); forstep(i=1, sqrtint(n), 2, forstep(j = 2, sqrtint(n - i^2), 2, listput(res, i^2 + j^2))); s = #res; for(i = 1, s, t = res[i]; for(e = 1, logint(n \ res[i], 2), listput(res, t<<=1))); listsort(res, 1); res} \\ David A. Corneth, Oct 04 2017
    
  • Python
    def aupto(limit):
      s = [i*i for i in range(1, int(limit**.5)+2) if i*i < limit]
      s2 = set(a+b for i, a in enumerate(s) for b in s[i+1:] if a+b <= limit)
      return sorted(s2)
    print(aupto(197)) # Michael S. Branicky, May 10 2021

A000161 Number of partitions of n into 2 squares.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Number of ways of writing n as a sum of 2 (possibly zero) squares when order does not matter.
Number of similar sublattices of square lattice with index n.
Let Pk = the number of partitions of n into k nonzero squares. Then we have A000161 = P0 + P1 + P2, A002635 = P0 + P1 + P2 + P3 + P4, A010052 = P1, A025426 = P2, A025427 = P3, A025428 = P4. - Charles R Greathouse IV, Mar 08 2010, amended by M. F. Hasler, Jan 25 2013
a(A022544(n))=0; a(A001481(n))>0; a(A125022(n))=1; a(A118882(n))>1. - Reinhard Zumkeller, Aug 16 2011

Examples

			25 = 3^2+4^2 = 5^2, so a(25) = 2.
		

References

  • J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 339

Crossrefs

Equivalent sequences for other numbers of squares: A010052 (1), A000164 (3), A002635 (4), A000174 (5).

Programs

  • Haskell
    a000161 n =
       sum $ map (a010052 . (n -)) $ takeWhile (<= n `div` 2) a000290_list
    a000161_list = map a000161 [0..]
    -- Reinhard Zumkeller, Aug 16 2011
    
  • Maple
    A000161 := proc(n) local i,j,ans; ans := 0; for i from 0 to n do for j from i to n do if i^2+j^2=n then ans := ans+1 fi od od; RETURN(ans); end; [ seq(A000161(i), i=0..50) ];
    A000161 := n -> nops( numtheory[sum2sqr](n) ); # M. F. Hasler, Nov 23 2007
  • Mathematica
    Length[PowersRepresentations[ #,2,2]] &/@Range[0,150] (* Ant King, Oct 05 2010 *)
  • PARI
    a(n)=sum(i=0,n,sum(j=0,i,if(i^2+j^2-n,0,1))) \\ for illustrative purpose
    
  • PARI
    A000161(n)=sum(k=sqrtint((n-1)\2)+1,sqrtint(n),issquare(n-k^2)) \\ Charles R Greathouse IV, Mar 21 2014, improves earlier code by M. F. Hasler, Nov 23 2007
    
  • PARI
    A000161(n)=#sum2sqr(n) \\ See A133388 for sum2sqr(). - M. F. Hasler, May 13 2018
    
  • Python
    from math import prod
    from sympy import factorint
    def A000161(n):
        f = factorint(n)
        return int(not any(e&1 for e in f.values())) + (((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 1 # Chai Wah Wu, Sep 08 2022

Formula

a(n) = card { { a,b } c N | a^2+b^2 = n }. - M. F. Hasler, Nov 23 2007
Let f(n)= the number of divisors of n that are congruent to 1 modulo 4 minus the number of its divisors that are congruent to 3 modulo 4, and define delta(n) to be 1 if n is a perfect square and 0 otherwise. Then a(n)=1/2 (f(n)+delta(n)+delta(1/2 n)). - Ant King, Oct 05 2010

A007692 Numbers that are the sum of 2 nonzero squares in 2 or more ways.

Original entry on oeis.org

50, 65, 85, 125, 130, 145, 170, 185, 200, 205, 221, 250, 260, 265, 290, 305, 325, 338, 340, 365, 370, 377, 410, 425, 442, 445, 450, 481, 485, 493, 500, 505, 520, 530, 533, 545, 565, 578, 580, 585, 610, 625, 629, 650, 680, 685, 689, 697, 725, 730, 740, 745, 754, 765
Offset: 1

Views

Author

Keywords

Comments

A025426(a(n)) > 1. - Reinhard Zumkeller, Aug 16 2011
For the question that is in the link AskNRICH Archive: It is easy to show that (a^2 + b^2)*(c^2 + d^2) = (a*c + b*d)^2 + (a*d - b*c)^2 = (a*d + b*c)^2 + (a*c - b*d)^2. So terms of this sequence can be generated easily. 5 is the least number of the form a^2 + b^2 where a and b distinct positive integers and this is a list sequence. This is the why we observe that there are many terms which are divisible by 5. - Altug Alkan, May 16 2016
Square roots of square terms: {25, 50, 65, 75, 85, 100, 125, 130, 145, 150, 169, 170, 175, 185, 195, 200, 205, 221, 225, 250, 255, 260, 265, 275, 289, 290, 300, 305, ...}. They are also listed by A009177. - Michael De Vlieger, May 16 2016

Examples

			50 is a term since 1^2 + 7^2 and 5^2 + 5^2 equal 50.
25 is not a term since though 3^2 + 4^2 = 25, 25 is square, i.e., 0^2 + 5^2 = 25, leaving it with only one possible sum of 2 nonzero squares.
625 is a term since it is the sum of squares of {0,25}, {7,24}, and {15,20}.
		

References

  • Ming-Sun Li, Kathryn Robertson, Thomas J. Osler, Abdul Hassen, Christopher S. Simons and Marcus Wright, "On numbers equal to the sum of two squares in more than one way", Mathematics and Computer Education, 43 (2009), 102 - 108.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • D. Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, 125.

Crossrefs

Subsequence of A001481. A subsequence is A025285 (2 ways).

Programs

  • Haskell
    import Data.List (findIndices)
    a007692 n = a007692_list !! (n-1)
    a007692_list = findIndices (> 1) a025426_list
    -- Reinhard Zumkeller, Aug 16 2011
    
  • Mathematica
    Select[Range@ 800, Length@ Select[PowersRepresentations[#, 2, 2], First@ # != 0 &] > 1 &] (* Michael De Vlieger, May 16 2016 *)
  • PARI
    isA007692(n)=nb = 0; lim = sqrtint(n); for (x=1, lim, if ((n-x^2 >= x^2) && issquare(n-x^2), nb++); ); nb >= 2; \\ Altug Alkan, May 16 2016
    
  • PARI
    is(n)=my(t); if(n<9, return(0)); for(k=sqrtint(n\2-1)+1,sqrtint(n-1), if(issquare(n-k^2)&&t++>1, return(1))); 0 \\ Charles R Greathouse IV, Jun 08 2016

A118886 Numbers expressible as x^2 + x*y + y^2, 0 <= x <= y, in 2 or more ways.

Original entry on oeis.org

49, 91, 133, 147, 169, 196, 217, 247, 259, 273, 301, 343, 361, 364, 399, 403, 427, 441, 469, 481, 507, 511, 532, 553, 559, 588, 589, 637, 651, 676, 679, 703, 721, 741, 763, 777, 784, 793, 817, 819, 868, 871, 889, 903, 931, 949, 961, 973, 988, 1027, 1029, 1036, 1057, 1083, 1092, 1099
Offset: 1

Views

Author

Keywords

Comments

Squares of distances between two points in the triangular lattice in two or more nontrivially different ways.
Numbers whose prime factorization contains at least two (not necessarily distinct) primes congruent to 1 mod 6 and any prime factor congruent to 2 mod 3 has even multiplicity. Products of two elements of A024606.
If k is in the sequence then so is k * m^2 for m > 0. - David A. Corneth, Jun 21 2018

Examples

			a(2) = 91 = 1^2 + 1*9 + 9^2 = 5^2 + 5*6 + 6^2;
a(45) = 931 = 1^2+1*30+30^2 = 9^2+9*25+25^2 = 14^2+14*21+21^2;
a(97) = 1729 = 3^2+3*40+40^2 = 8^2+8*37+37^2 = 15^2+15*32+32^2 = 23^2+23*25+25^2. - _Reinhard Zumkeller_, Oct 30 2011
		

Crossrefs

Subsequence of Loeschian numbers A003136.
Complement of A198772 with respect to A003136.
Subsequences: A198773, A198774, A198775.

Programs

  • Haskell
    a118886 n = a118886_list !! (n-1)
    a118886_list = filter ((> 1) . a088534) a003136_list
    -- Reinhard Zumkeller, Oct 30 2011
    
  • Julia
    function isA118886(n)
        n < 49 && return false
        n % 3 == 2 && return false
        M = Int(round(2*sqrt(n/3)))
        count = 0
        for y in 0:M, x in 0:y
            n == x^2 + y^2 + x*y && (count += 1)
            count == 2 && break
        end
        return count >= 2
    end
    A118886list(upto) = [n for n in 0:upto if isA118886(n)]
    A118886list(1099) |> println # Peter Luschny, Mar 17 2018
  • Mathematica
    amax = 2000; xmax = Sqrt[amax] // Ceiling; Clear[f]; f[_] = 0; Do[q = x^2 + x y + y^2; f[q] = f[q] + 1, {x, 0, xmax}, {y, x, xmax}];
    A118886 = Select[Range[0, 3 xmax^2], # <= amax && f[#] > 1&] (* Jean-François Alcover, Jun 21 2018 *)
  • PARI
    is(n)=#bnfisintnorm(bnfinit(z^2+z+1), n) > 2;
    select(is, vector(1500,j,j)) \\ Joerg Arndt, Jan 11 2015
    

Formula

A088534(a(n)) > 1. - Reinhard Zumkeller, Oct 30 2011

A009177 Numbers that are the hypotenuses of more than one Pythagorean triangle.

Original entry on oeis.org

25, 50, 65, 75, 85, 100, 125, 130, 145, 150, 169, 170, 175, 185, 195, 200, 205, 221, 225, 250, 255, 260, 265, 275, 289, 290, 300, 305, 325, 338, 340, 350, 365, 370, 375, 377, 390, 400, 410, 425, 435, 442, 445, 450, 455, 475, 481, 485, 493, 500, 505, 507, 510, 520, 525
Offset: 1

Views

Author

Keywords

Comments

Also, hypotenuses of Pythagorean triangles in Pythagorean triples (a, b, c, a < b < c) such that a and b are the hypotenuses of Pythagorean triangles, where the Pythagorean triples (x1, y1, a) and (x2, y2, b) are similar triangles. Sequence gives c values. - Naohiro Nomoto
Any multiple of a term of this sequence is also a term. The primitive elements are the products of two primes, not necessarily distinct, that are == 1 (mod 4): A121387. - Franklin T. Adams-Watters, Dec 21 2015
Numbers appearing more than once in A009000. - Sean A. Irvine, Apr 20 2018

Examples

			25^2 = 24^2 + 7^2 = 20^2 + 15^2.
E.g., (a = 15, b = 20, c = 25, a^2 + b^2=c^2); 15 and 20 are the hypotenuses of Pythagorean triangles. The Pythagorean triples (9, 12, 15) and (12, 16, 20) are similar triangles. So c = 25 is in the sequence. - _Naohiro Nomoto_
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) add(`if` (t[1] mod 4 = 1, t[2],0), t = ifactors(n)[2]) >= 2 end proc:
    select(filter, [$1..1000]); # Robert Israel, Dec 21 2015
  • Mathematica
    f[n_] := Module[{i = 0, k = 0}, Do[If[Sqrt[n^2 - i^2] == IntegerPart[Sqrt[n^2 - i^2]], k++], {i, n - 1, 1, -1}]; k];
    lst = {}; Do[If[f[n] > 2, AppendTo[lst, n]], {n, 4*5!}];
    lst (* Vladimir Joseph Stephan Orlovsky, Aug 12 2009 *)

Formula

Of the form b(i)*b(j)*k, where b(n) is A004431(n). Numbers whose prime factorization includes at least 2 (not necessarily distinct) primes congruent to 1 mod 4. - Franklin T. Adams-Watters, May 03 2006. [Typo corrected by Ant King, Jul 17 2008]

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

A124980 Smallest strictly positive number decomposable in n different ways as a sum of two squares.

Original entry on oeis.org

1, 25, 325, 1105, 4225, 5525, 203125, 27625, 71825, 138125, 2640625, 160225, 17850625, 1221025, 1795625, 801125, 1650390625, 2082925, 49591064453125, 4005625, 44890625, 2158203125, 30525625, 5928325, 303460625, 53955078125, 35409725, 100140625
Offset: 1

Views

Author

Artur Jasinski, Nov 15 2006

Keywords

Comments

The number must be strictly positive, but one of the squares may be zero, as we see from a(1) = 1 = 1^2 + 0^2 and a(2) = 25 = 3^2 + 4^2 = 5^0 + 0^2. - M. F. Hasler, Jul 07 2024

Examples

			a(3) = 325 is decomposable in 3 ways: 15^2 + 10^2 = 17^2 + 6^2 = 18^2 + 1^2.
		

Crossrefs

See A016032, A000446 and A093195 for other versions.

Programs

  • PARI
    A124980(n)={for(a=1, oo, A000161(a)==n && return(a))} \\ R. J. Mathar, Nov 29 2006, edited by M. F. Hasler, Jul 07 2024
    
  • PARI
    PD(n, L=n, D=Vecrev(divisors(n)[^1])) = { if(n>1, concat(vector(#D, i, if(D[i] > L, [], D[i] < n, [concat(D[i], P) | P <- PD(n/D[i], D[i])], [[n]]))), [[]])}
    apply( {A124980(n)=vecmin([prod(i=1, #a, A002144(i)^(a[i]-1)) | a<-concat([PD(n*2,n), PD(n*2-1)])])}, [1..44]) \\ M. F. Hasler, Jul 07 2024
    
  • Python
    from sympy import divisors, isprime, prod
    def PD(n, L=None): return [[]] if n==1 else [
        [d]+P for d in divisors(n)[:0:-1] if d <= (L or n) for P in PD(n//d, d)]
    A2144=lambda upto=999: filter(isprime, range(5, upto, 4))
    def A124980(n):
        return min(prod(a**(f-1) for a,f in zip(A2144(), P))
                   for P in PD(n*2, n)+PD(n*2-1)) # M. F. Hasler, Jul 07 2024

Formula

a(n) = A000446(n), n > 1. - R. J. Mathar, Jun 15 2008
a(n) = min(A018782(2n-1), A018782(2n)).
a(n) = min { k > 0 | A000161(k) = n }. - M. F. Hasler, Jul 07 2024

Extensions

More terms from R. J. Mathar, Nov 29 2006
Edited and extended by Ray Chandler, Jan 07 2012

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
Showing 1-10 of 12 results. Next