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

A270385 Numbers n such that n^2 is a term of A007692 while n is not.

Original entry on oeis.org

25, 75, 100, 150, 169, 175, 195, 225, 255, 275, 289, 300, 350, 375, 390, 400, 435, 455, 475, 507, 510, 525, 550, 555, 575, 595, 600, 615, 663, 675, 676, 700, 715, 750, 775, 780, 795, 825, 841, 867, 870, 875, 900, 910, 915, 935, 950, 975, 1014, 1015, 1020, 1050, 1075, 1095
Offset: 1

Views

Author

Altug Alkan, May 17 2016

Keywords

Comments

Subsequence of A009177.

Examples

			25 is a term because 25 is not a term of A007692 while 25^2 = 625 is a term of A007692.
		

Crossrefs

Programs

  • Mathematica
    fQ[n_] := Length@ Select[PowersRepresentations[n, 2, 2], First@ # != 0 &] > 1; Select[Range@1100, And[! fQ@ #, fQ[#^2]] &] (* Michael De Vlieger, May 17 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; }
    lista(nn) = for(n=1, nn, if(!isA007692(n) && isA007692(n^2), print1(n, ", ")));

A273123 Values of A007692(n) that are not of the form x^2 + y^2 + z^2 where x, y, z are nonzero integers.

Original entry on oeis.org

85, 130, 340, 520, 1360, 2080, 5440, 8320, 21760, 33280, 87040, 133120, 348160, 532480, 1392640, 2129920, 5570560, 8519680, 22282240, 34078720, 89128960, 136314880, 356515840, 545259520, 1426063360, 2181038080, 5704253440, 8724152320
Offset: 1

Views

Author

Altug Alkan, May 16 2016

Keywords

Comments

If n is in this sequence, then 4*n is also in this sequence. So 85*4^k and 130*4^k are terms of this sequence for all nonnegative values of k.
For more details see A051952.

Examples

			85 is a term because 85 = 2^2 + 9^2 = 6^2 + 7^2 and 85 = x^2 + y^2 + z^2 has no solution for nonzero integer values of x, y, z.
130 is a term because 130 = 3^2 + 11^2 = 7^2 + 9^2 and 130 = x^2 + y^2 + z^2 has no solution for nonzero integer values of x, y, z.
340 is a term because 340 = 4*85 and 85 is a term.
		

Crossrefs

Programs

  • Mathematica
    twoQ[n_] := 2 == Length@ Select[ PowersRepresentations[n, 2, 2], Times @@ # > 0 &, 2]; threeQ[n_] := {} != Quiet@ IntegerPartitions[n, {3}, Range[ Sqrt@ n]^2, 1]; Select[Range[10^5], twoQ[#] && ! threeQ[#] &] (* Giovanni Resta, May 16 2016 *)

Extensions

a(14)-a(28) from Giovanni Resta, May 16 2016

A000404 Numbers that are the sum of 2 nonzero squares.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

From the formula it is easy to see that if k is in this sequence, then so are all odd powers of k. - T. D. Noe, Jan 13 2009
Also numbers whose cubes are the sum of two nonzero squares. - Joe Namnath and Lawrence Sze
A line perpendicular to y=mx has its first integral y-intercept at a^2+b^2. The remaining ones for that slope are multiples of that primitive value. - Larry J Zimmermann, Aug 19 2010
The primes in this sequence are sequence A002313.
Complement of A018825; A025426(a(n)) > 0; A063725(a(n)) > 0. - Reinhard Zumkeller, Aug 16 2011
If the two squares are not equal, then any power is still in the sequence: if k = x^2 + y^2 with x != y, then k^2 = (x^2-y^2)^2 + (2xy)^2 and k^3 = (x(x^2-3y^2))^2 + (y(3x^2-y^2))^2, etc. - Carmine Suriano, Jul 13 2012
There are never more than 3 consecutive terms that differ by 1. Triples of consecutive terms that differ by 1 occur infinitely many times, for example, 2(k^2 + k)^2, (k^2 - 1)^2 + (k^2 + 2 k)^2, and (k^2 + k - 1)^2 + (k^2 + k + 1)^2 for any integer k > 1. - Ivan Neretin, Mar 16 2017 [Corrected by Jerzy R Borysowicz, Apr 14 2017]
Number of terms less than 10^k, k=1,2,3,...: 3, 34, 308, 2690, 23873, 215907, 1984228, ... - Muniru A Asiru, Feb 01 2018
The squares in this sequence are the squares of the so-called hypotenuse numbers A009003. - M. F. Hasler, Jun 20 2025

Examples

			25 = 3^2 + 4^2, therefore 25 is a term. Note that also 25^3 = 15625 = 44^2 + 117^2, therefore 15625 is a term.
		

References

  • David A. Cox, "Primes of the Form x^2 + n y^2", Wiley, 1989.
  • GCHQ, The GCHQ Puzzle Book, Penguin, 2016. See page 103.
  • E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, p. 75, Theorem 4, with Theorem 2, p. 15.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, p. 219, th. 251, 252.
  • Ian Stewart, "Game, Set and Math", Chapter 8, 'Close Encounters of the Fermat Kind', Penguin Books, Ed. 1991, pp. 107-124.

Crossrefs

A001481 gives another version (allowing for zero squares).
Cf. A004431 (2 distinct squares), A063725 (number of representations), A024509 (numbers with multiplicity), A025284, A018825. Also A050803, A050801, A001105, A033431, A084888, A000578, A000290, A057961, A232499, A007692.
Cf. A003325 (analog for cubes), A003336 (analog for 4th powers).
Cf. A009003 (square roots of the squares in this sequence).
Column k=2 of A336725.

Programs

  • GAP
    P:=List([1..10^4],i->i^2);;
    A000404 := Set(Flat(List(P, i->List(P, j -> i+j)))); # Muniru A Asiru, Feb 01 2018
    
  • Haskell
    import Data.List (findIndices)
    a000404 n = a000404_list !! (n-1)
    a000404_list = findIndices (> 0) a025426_list
    -- Reinhard Zumkeller, Aug 16 2011
    
  • Magma
    lst:=[]; for n in [1..178] do f:=Factorization(n); if IsSquare(n) then for m in [1..#f] do d:=f[m]; if d[1] mod 4 eq 1 then Append(~lst, n); break; end if; end for; else t:=0; for m in [1..#f] do d:=f[m]; if d[1] mod 4 eq 3 and d[2] mod 2 eq 1 then t:=1; break; end if; end for; if t eq 0 then Append(~lst, n); end if; end if; end for; lst; // Arkadiusz Wesolowski, Feb 16 2017
    
  • Maple
    nMax:=178: A:={}: for i to floor(sqrt(nMax)) do for j to floor(sqrt(nMax)) do if i^2+j^2 <= nMax then A := `union`(A, {i^2+j^2}) else  end if end do end do: A; # Emeric Deutsch, Jan 02 2017
  • Mathematica
    nMax=1000; n2=Floor[Sqrt[nMax-1]]; Union[Flatten[Table[a^2+b^2, {a,n2}, {b,a,Floor[Sqrt[nMax-a^2]]}]]]
    Select[Range@ 200, Length[PowersRepresentations[#, 2, 2] /. {0, } -> Nothing] > 0 &] (* _Michael De Vlieger, Mar 24 2016 *)
    Module[{upto=200},Select[Union[Total/@Tuples[Range[Sqrt[upto]]^2,2]],#<= upto&]] (* Harvey P. Dale, Sep 18 2021 *)
  • PARI
    is_A000404(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)) \\ M. F. Hasler, Feb 07 2009
    
  • PARI
    list(lim)=my(v=List(),x2); lim\=1; for(x=1,sqrtint(lim-1), x2=x^2; for(y=1,sqrtint(lim-x2), listput(v,x2+y^2))); Set(v) \\ Charles R Greathouse IV, Apr 30 2016
    
  • Python
    from itertools import count, islice
    from sympy import factorint
    def A000404_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:
                    yield n
    A000404_list = list(islice(A000404_gen(),30)) # Chai Wah Wu, Jul 01 2022

Formula

Let k = 2^t * p_1^a_1 * p_2^a_2 * ... * p_r^a_r * q_1^b_1 * q_2^b_2 * ... * q_s^b_s with t >= 0, a_i >= 0 for i=1..r, where p_i == 1 (mod 4) for i=1..r and q_j == -1 (mod 4) for j=1..s. Then k is a term iff 1) b_j == 0 (mod 2) for j=1..s and 2) r > 0 or t == 1 (mod 2) (or both).
From Charles R Greathouse IV, Nov 18 2022: (Start)
a(n) ~ k*n*sqrt(log n), where k = 1.3085... = 1/A064533.
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. (End)

Extensions

Edited by Ralf Stephan, Nov 15 2004
Typo in formula corrected by M. F. Hasler, Feb 07 2009
Erroneous Mathematica program fixed by T. D. Noe, Aug 07 2009
PARI code fixed for versions > 2.5 by M. F. Hasler, Jan 01 2013

A001235 Taxi-cab numbers: sums of 2 cubes in more than 1 way.

Original entry on oeis.org

1729, 4104, 13832, 20683, 32832, 39312, 40033, 46683, 64232, 65728, 110656, 110808, 134379, 149389, 165464, 171288, 195841, 216027, 216125, 262656, 314496, 320264, 327763, 373464, 402597, 439101, 443889, 513000, 513856, 515375, 525824, 558441, 593047, 684019, 704977
Offset: 1

Views

Author

Keywords

Comments

From Wikipedia: "1729 is known as the Hardy-Ramanujan number after a famous anecdote of the British mathematician G. H. Hardy regarding a hospital visit to the Indian mathematician Srinivasa Ramanujan. In Hardy's words: 'I remember once going to see him when he was ill at Putney. I had ridden in taxi cab number 1729 and remarked that the number seemed to me rather a dull one, and that I hoped it was not an unfavorable omen. "No," he replied, "it is a very interesting number; it is the smallest number expressible as the sum of two cubes in two different ways."'"
A011541 gives another version of "taxicab numbers".
If n is in this sequence, then n*k^3 is also in this sequence for all k > 0. So this sequence is obviously infinite. - Altug Alkan, May 09 2016

Examples

			4104 belongs to the sequence as 4104 = 2^3 + 16^3 = 9^3 + 15^3.
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, Section D1.
  • G. H. Hardy, Ramanujan, Cambridge Univ. Press, 1940, p. 12.
  • Ya. I. Perelman, Algebra can be fun, pp. 142-143.
  • H. W. Richmond, On integers which satisfy the equation t^3 +- x^3 +- y^3 +- z^3, Trans. Camb. Phil. Soc., 22 (1920), 389-403, see p. 402.
  • D. Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, 165.

Crossrefs

Subsequence of A003325.
Cf. A007692, A008917, A011541, A018786, A018850 (primitive solutions), A051347 (allows negatives), A343708, A360619.
Solutions in greater numbers of ways:
(>2): A018787 (A003825 for primitive, A023050 for coprime),
(>3): A023051 (A003826 for primitive),
(>4): A051167 (A155057 for primitive).

Programs

  • Mathematica
    Select[Range[750000],Length[PowersRepresentations[#,2,3]]>1&] (* Harvey P. Dale, Nov 25 2014, with correction by Zak Seidov, Jul 13 2015 *)
  • PARI
    is(n)=my(t);for(k=ceil((n/2)^(1/3)),(n-.4)^(1/3),if(ispower(n-k^3,3),if(t,return(1),t=1)));0 \\ Charles R Greathouse IV, Jul 15 2011
    
  • PARI
    T=thueinit(x^3+1,1);
    is(n)=my(v=thue(T,n)); sum(i=1,#v,v[i][1]>=0 && v[i][2]>=v[i][1])>1 \\ Charles R Greathouse IV, May 09 2016

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

A022544 Numbers that are not the sum of 2 squares.

Original entry on oeis.org

3, 6, 7, 11, 12, 14, 15, 19, 21, 22, 23, 24, 27, 28, 30, 31, 33, 35, 38, 39, 42, 43, 44, 46, 47, 48, 51, 54, 55, 56, 57, 59, 60, 62, 63, 66, 67, 69, 70, 71, 75, 76, 77, 78, 79, 83, 84, 86, 87, 88, 91, 92, 93, 94, 95, 96, 99, 102, 103, 105, 107, 108, 110, 111, 112, 114, 115, 118, 119, 120, 123, 124, 126, 127, 129, 131, 132, 133, 134, 135, 138, 139, 140, 141, 142, 143, 147, 150, 151, 152, 154, 155, 156, 158, 159, 161, 163, 165, 166, 167, 168, 171, 172, 174, 175, 176, 177, 179, 182, 183, 184, 186, 187, 188, 189, 190, 191, 192, 195, 198, 199
Offset: 1

Views

Author

Keywords

Comments

Conjecture: if k is not the sum of 2 squares then sigma(k) == 0 (mod 4) (the converse does not hold, as demonstrated by the entries in A025303). - Benoit Cloitre, May 19 2002
Numbers having some prime factor p == 3 (mod 4) to an odd power. sigma(n) == 0 (mod 4) because of this prime factor. Every k == 3 (mod 4) is a term. First differences are always 1, 2, 3 or 4, each occurring infinitely often. - David W. Wilson, Mar 09 2005
Complement of A000415 in the nonsquare positive integers A000037. - Max Alekseyev, Jan 21 2010
Integers with an equal number of 4k+1 and 4k+3 divisors. - Ant King, Oct 05 2010
A000161(a(n)) = 0; A070176(a(n)) > 0; A046712 is a subsequence. - Reinhard Zumkeller, Feb 04 2012, Aug 16 2011
There are arbitrarily long runs of consecutive terms. Record runs start at 3, 6, 21, 75, ... (A260157). - Ivan Neretin, Nov 09 2015
From Klaus Purath, Sep 04 2023: (Start)
There are no squares in this sequence.
There are also no numbers of the form n^2 + 1 (A002522) or n^2 + 4 (A087475).
Every term a(n) raised to an odd power belongs to the sequence just as every product of an odd number of terms. This is also true for all integer sequences represented by the indefinite binary quadratic forms a(n)*x^2 - y^2. These sequences also do not contain squares. (End)

References

  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, pp. 98-104.

Crossrefs

Complement of A001481; subsequence of A111909.

Programs

  • Haskell
    import Data.List (elemIndices)
    a022544 n = a022544_list !! (n-1)
    a022544_list = elemIndices 0 a000161_list
    -- Reinhard Zumkeller, Aug 16 2011
    
  • Magma
    [n: n in [0..160] | NormEquation(1, n) eq false]; // Vincenzo Librandi, Jan 15 2017
    
  • Mathematica
    Select[Range[199], Length[PowersRepresentations[ #, 2, 2]] == 0 &] (* Ant King, Oct 05 2010 *)
    Select[Range[200],SquaresR[2,#]==0&] (* Harvey P. Dale, Apr 21 2012 *)
  • PARI
    for(n=0,200,if(sum(i=0,n,sum(j=0,i,if(i^2+j^2-n,0,1)))==0,print1((n),",")))
    
  • PARI
    is(n)=if(n%4==3, return(1)); my(f=factor(n)); for(i=1,#f~, if(f[i,1]%4==3 && f[i,2]%2, return(1))); 0 \\ Charles R Greathouse IV, Sep 01 2015
    
  • Python
    def aupto(lim):
      squares = [k*k for k in range(int(lim**.5)+2) if k*k <= lim]
      sum2sqs = set(a+b for i, a in enumerate(squares) for b in squares[i:])
      return sorted(set(range(lim+1)) - sum2sqs)
    print(aupto(199)) # Michael S. Branicky, Mar 06 2021
    
  • Python
    from itertools import count, islice
    from sympy import factorint
    def A022544_gen(): # generator of terms
        return filter(lambda n:any(p & 3 == 3 and e & 1 for p, e in factorint(n).items()),count(0))
    A022544_list = list(islice(A022544_gen(),30)) # Chai Wah Wu, Jun 28 2022

Formula

Limit_{n->oo} a(n)/n = 1.

Extensions

More terms from Benoit Cloitre, May 19 2002

A025426 Number of partitions of n into 2 nonzero squares.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

For records see A007511, A048610, A016032. - R. J. Mathar, Feb 26 2008

Crossrefs

Cf. A000161 (2 nonnegative squares), A063725 (order matters), A025427 (3 nonzero squares).
Cf. A172151, A004526. - Reinhard Zumkeller, Jan 26 2010
Column k=2 of A243148.

Programs

  • Haskell
    a025426 n = sum $ map (a010052 . (n -)) $
                          takeWhile (<= n `div` 2) $ tail a000290_list
    a025426_list = map a025426 [0..]
    -- Reinhard Zumkeller, Aug 16 2011
    
  • Maple
    A025426 := proc(n)
        local a,x;
        a := 0 ;
        for x from 1 do
            if 2*x^2 > n then
                return a;
            end if;
            if issqr(n-x^2) then
                a := a+1 ;
            end if;
        end do:
    end proc: # R. J. Mathar, Sep 15 2015
  • Mathematica
    m[n_] := m[n] = SquaresR[2, n]/4; a[0] = 0; a[n_] := If[ EvenQ[ m[n] ], m[n]/2, (m[n] - (-1)^IntegerExponent[n, 2])/2]; Table[ a[n], {n, 0, 107}] (* Jean-François Alcover, Jan 31 2012, after Max Alekseyev *)
    nmax = 107; sq = Range[Sqrt[nmax]]^2;
    Table[Length[Select[IntegerPartitions[n, All, sq], Length[#] == 2 &]], {n, 0, nmax}] (* Robert Price, Aug 17 2020 *)
  • PARI
    a(n)={my(v=valuation(n,2),f=factor(n>>v),t=1);for(i=1,#f[,1],if(f[i,1]%4==1,t*=f[i,2]+1,if(f[i,2]%2,return(0))));if(t%2,t-(-1)^v,t)/2;} \\ Charles R Greathouse IV, Jan 31 2012
    
  • Python
    from math import prod
    from sympy import factorint
    def A025426(n): return ((m:=prod(1 if p==2 else (e+1 if p&3==1 else (e+1)&1) for p, e in factorint(n).items()))+((((~n & n-1).bit_length()&1)<<1)-1 if m&1 else 0))>>1 # Chai Wah Wu, Jul 07 2022

Formula

Let m = A004018(n)/4. If m is even then a(n) = m/2, otherwise a(n) = (m - (-1)^A007814(n))/2. - Max Alekseyev, Mar 09 2009, Mar 14 2009
a(A018825(n)) = 0; a(A000404(n)) > 0; a(A025284(n)) = 1; a(A007692(n)) > 1. - Reinhard Zumkeller, Aug 16 2011
a(A000578(n)) = A084888(n). - Reinhard Zumkeller, Jul 18 2012
a(n) = Sum_{i=1..floor(n/2)} A010052(i) * A010052(n-i). - Wesley Ivan Hurt, Apr 19 2019
a(n) = [x^n y^2] Product_{k>=1} 1/(1 - y*x^(k^2)). - Ilya Gutkovskiy, Apr 19 2019
Conjecture: Sum_{k=1..n} a(k) ~ n*Pi/8. - Vaclav Kotesovec, Dec 28 2023

A024796 Numbers expressible in more than one way as i^2 + j^2 + k^2, where 1 <= i <= j <= k.

Original entry on oeis.org

27, 33, 38, 41, 51, 54, 57, 59, 62, 66, 69, 74, 75, 77, 81, 83, 86, 89, 90, 94, 98, 99, 101, 102, 105, 107, 108, 110, 113, 114, 117, 118, 121, 122, 123, 125, 126, 129, 131, 132, 134, 137, 138, 139, 141, 146, 147, 149, 150, 152, 153, 154, 155, 158, 161, 162, 164, 165, 166, 170
Offset: 1

Views

Author

Keywords

Comments

a(n) multiplied by (h^2)/(8*m*a^2) is the n-th energy level exhibiting accidental degeneracy, for a quantum mechanical particle of mass m in a cubic box of side length a (h is Planck's constant). - A. Timothy Royappa, Feb 12 2019

Crossrefs

Programs

  • Mathematica
    okQ[n_]:= Length[Select[PowersRepresentations[n, 3, 2], !MemberQ[#, 0] &]] > 1; (* Jinyuan Wang, Feb 12 2019 *)
  • PARI
    is(n)=if(n<27, return(0)); if(n%4==0, return(is(n/4))); my(w); for(i=sqrtint((n-1)\3)+1,sqrtint(n-2), my(t=n-i^2); for(j=sqrtint((t-1)\2)+1,min(sqrtint(t-1),i), if(issquare(t-j^2), w++>1 && return(1)))); 0 \\ Charles R Greathouse IV, Aug 05 2024

Formula

{n: A025427(n) > 1 }. - R. J. Mathar, Aug 05 2022

A025284 Numbers that are the sum of 2 nonzero squares in exactly 1 way.

Original entry on oeis.org

2, 5, 8, 10, 13, 17, 18, 20, 25, 26, 29, 32, 34, 37, 40, 41, 45, 52, 53, 58, 61, 68, 72, 73, 74, 80, 82, 89, 90, 97, 98, 100, 101, 104, 106, 109, 113, 116, 117, 122, 128, 136, 137, 146, 148, 149, 153, 157, 160, 162, 164, 169, 173, 178, 180, 181, 193, 194, 197, 202, 208, 212
Offset: 1

Views

Author

Keywords

Comments

A025426(a(n)) = 1. - Reinhard Zumkeller, Aug 16 2011

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a025284 n = a025284_list !! (n-1)
    a025284_list = elemIndices 1 a025426_list
    -- Reinhard Zumkeller, Aug 16 2011
  • Mathematica
    selQ[n_] := Length[ Select[ PowersRepresentations[n, 2, 2], Times @@ # != 0 &]] == 1; Select[Range[300], selQ] (* Jean-François Alcover, Oct 03 2013 *)
    b[n_, i_, k_, t_] := b[n, i, k, t] = If[n == 0, If[t == 0, 1, 0], If[i<1 || t<1, 0, b[n, i - 1, k, t] + If[i^2 > n, 0, b[n - i^2, i, k, t - 1]]]];
    T[n_, k_] := b[n, Sqrt[n] // Floor, k, k];
    Position[Table[T[n, 2], {n, 0, 300}], 1] - 1 // Flatten (* Jean-François Alcover, Nov 06 2020, after Alois P. Heinz in A243148 *)

Formula

A243148(a(n),2) = 1. - Alois P. Heinz, Feb 25 2019

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