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

A214328 Intersection of A004214 and A018825.

Original entry on oeis.org

1, 4, 7, 15, 16, 23, 28, 31, 39, 47, 55, 60, 63, 64, 71, 79, 87, 92, 95, 103, 111, 112, 119, 124, 127, 135, 143, 151, 156, 159, 167, 175, 183, 188, 191, 199, 207, 215, 220, 223, 231, 239, 240, 247, 252, 255, 256, 263, 271, 279, 284, 287, 295, 303, 311, 316, 319, 327, 335, 343, 348, 351, 359, 367, 368, 375, 380, 383, 391, 399, 407, 412, 415, 423, 431, 439
Offset: 1

Views

Author

N. J. A. Sloane, Jul 26 2012, following a suggestion from Hans Isdahl, Apr 19 2012

Keywords

Crossrefs

Formula

a(n) ~ 6 * n. - Bill McEachen, Mar 24 2024

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

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

A063725 Number of ordered pairs (x,y) of positive integers such that x^2 + y^2 = n.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Aug 23 2001

Keywords

Comments

a(A018825(n))=0; a(A000404(n))>0; a(A081324(n))=1; a(A004431(n))>1. - Reinhard Zumkeller, Aug 16 2011

Examples

			a(5) = 2 from the solutions (1,2) and (2,1).
		

Crossrefs

Cf. A000404 (the numbers n that can be represented in this form).
Column k=2 of A337165.

Programs

  • Haskell
    a063725 n =
       sum $ map (a010052 . (n -)) $ takeWhile (< n) $ tail a000290_list
    a063725_list = map a063725 [0..]
    -- Reinhard Zumkeller, Aug 16 2011
    
  • Mathematica
    nn = 100; t = Table[0, {nn}]; s = Sqrt[nn]; Do[n = x^2 + y^2; If[n <= nn, t[[n]]++], {x, s}, {y, s}]; Join[{0}, t] (* T. D. Noe, Apr 03 2011 *)
  • PARI
    a(n)=if(n==0, return(0)); my(f=factor(n)); prod(i=1, #f~, if(f[i, 1]%4==1, f[i, 2]+1, f[i, 2]%2==0 || f[i, 1]==2)) - issquare(n) \\ Charles R Greathouse IV, May 18 2016
    
  • Python
    from math import prod
    from sympy import factorint
    def A063725(n):
        f = factorint(n)
        return prod(1 if p==2 else (e+1 if p&3==1 else (e+1)&1) for p, e in f.items())-(not any(e&1 for e in f.values())) if n else 0 # Chai Wah Wu, May 17 2023

Formula

G.f.: (Sum_{m=1..inf} x^(m^2))^2.
a(n) = ( A004018(n) - 2*A000122(n) + A000007(n) )/4. - Max Alekseyev, Sep 29 2012
G.f.: (theta_3(q) - 1)^2/4, where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Aug 08 2018

A016032 Least positive integer that is the sum of two squares of positive integers in exactly n ways.

Original entry on oeis.org

2, 50, 325, 1105, 8125, 5525, 105625, 27625, 71825, 138125, 5281250, 160225, 1221025, 2442050, 1795625, 801125, 446265625, 2082925, 41259765625, 4005625, 44890625, 30525625, 61051250, 5928325, 303460625, 53955078125, 35409725, 100140625, 1289367675781250
Offset: 1

Views

Author

Keywords

Examples

			a(0) = 1 as 1 is the least positive integer not expressible as the sum of two squared positives.
a(1) = 2 from 2 = 1^2 + 1^2.
a(2) = 50 from 50 = 1^2 + 7^2 = 5^2 + 5^2.
		

References

  • A. Beiler, Recreations in the Theory of Numbers, Dover, pp. 140-141.

Crossrefs

Cf. A018825, A048610, A025284-A025293 (first entries).
See A000446, A124980 and A093195 for other versions.

Programs

Formula

a(n) = min(2*A018782(2n-1), A018782(2n), A018782(2n+1)).

Extensions

Corrected and extended by Jud McCranie
Definition improved by several correspondents, Nov 12 2007

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

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

A081324 Twice a square but not the sum of 2 distinct squares.

Original entry on oeis.org

0, 2, 8, 18, 32, 72, 98, 128, 162, 242, 288, 392, 512, 648, 722, 882, 968, 1058, 1152, 1458, 1568, 1922, 2048, 2178, 2592, 2888, 3528, 3698, 3872, 4232, 4418, 4608, 4802, 5832, 6272, 6498, 6962, 7688, 7938, 8192, 8712, 8978, 9522, 10082, 10368, 11552
Offset: 1

Views

Author

Benoit Cloitre, Apr 20 2003

Keywords

Comments

Conjecture: for n>1 this is A050804.
From Altug Alkan, Apr 12 2016: (Start)
Conjecture is true. Proof :
If n = a^2 + b^2, where a and b are nonzero integers, then n^3 = (a^2 + b^2)^3 = A^2 + B^2 = C^2 + D^2 where;
A = 2*a^2*b + (a^2-b^2)*b = 3*a^2*b - b^3,
B = 2*a*b^2 - (a^2-b^2)*a = 3*a*b^2 - a^3,
C = 2*a*b^2 + (a^2-b^2)*a = 1*a*b^2 + a^3,
D = 2*a^2*b - (a^2-b^2)*b = 1*a^2*b + b^3.
Obviously, A, B, C, D are always nonzero because a and b are nonzero integers. Additionally, if a^2 is not equal to b^2, then (A, B) and (C, D) are distinct pairs, that is, n^3 can be expressible as a sum of two nonzero squares more than one way. Since we know that n is a sum of two nonzero squares if and only if n^3 is a sum of two nonzero squares (see comment section of A000404); if n^3 is the sum of two nonzero squares in exactly one way, n must be a^2 + b^2 with a^2 = b^2 and n is the sum of two nonzero squares in exactly one way. That is the definition of this sequence, so this sequence is exactly A050804 except "0" that is the first term of this sequence. (End) [Edited by Altug Alkan, May 14 2016]
Conjecture: sequence consists of numbers of form 2*k^2 such that sigma(2*k^2)==3 (mod 4) and k is not divisible by 5.
The reason of related observation is that 5 is the least prime of the form 4*m+1. However, counterexamples can be produced. For example 57122 = 2*169^2 and sigma(57122) == 3 (mod 4) and it is not divisible by 5. - Altug Alkan, Jun 10 2016
For n > 0, this sequence lists numbers n such that n is the sum of two nonzero squares while n^2 is not. - Altug Alkan, Apr 11 2016
2*k^2 where k has no prime factor == 1 (mod 4). - Robert Israel, Jun 10 2016

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a081324 n = a081324_list !! (n-1)
    a081324_list = 0 : elemIndices 1 a063725_list
    -- Reinhard Zumkeller, Aug 17 2011
    
  • Maple
    map(k -> 2*k^2, select(k -> andmap(t -> t[1] mod 4 <> 1, ifactors(k)[2]), [$0..100])); # Robert Israel, Jun 10 2016
  • Mathematica
    Select[ Range[0, 12000], MatchQ[ PowersRepresentations[#, 2, 2], {{n_, n_}}] &] (* Jean-François Alcover, Jun 18 2013 *)
  • PARI
    concat([0,2],apply(n->2*n^2, select(n->vecmin(factor(n)[, 1]%4)>1, vector(100,n,n+1)))) \\ Charles R Greathouse IV, Jun 18 2013

Formula

A063725(a(n)) = 1. [Reinhard Zumkeller, Aug 17 2011]
a(n) = 2*A004144(n-1)^2 for n > 1. - Charles R Greathouse IV, Jun 18 2013

Extensions

a(19)-a(45) from Donovan Johnson, Nov 15 2009
Offset corrected by Reinhard Zumkeller, Aug 17 2011

A123120 Numbers k>0 such that m+k is not the sum of m nonzero squares for any m>5.

Original entry on oeis.org

1, 2, 4, 5, 7, 10, 13
Offset: 1

Views

Author

Alexander Adamchuk, Sep 28 2006

Keywords

Comments

Also, numbers which are not the sum of "squares-minus-1" (cf. A005563). - Benoit Jubin, Apr 14 2010
Conjecture: All but (n+6) positive numbers are equal to the sum of n>5 nonzero squares. For all n>5 the only (n+6) positive numbers that are not equal to the sum of n nonzero squares are {1,2,3,...,n-3,n-2,n-1,n+1,n+2,n+4,n+5,n+7,n+10,n+13}.
Numbers that are not squares (n=1): A000037 = {2, 3, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28,...}
Numbers that are not the sum of 2 nonzero squares (n=2): A018825 = {1, 3, 4, 6, 7, 9, 11, 12, 14, 15, 16, 19, 21, 22, 23, 24, 27, 28, 30, 31, 33, 35, 36,...}.
Numbers that are not the sum of three nonzero squares (n=3): A004214 = {1, 2, 4, 5, 7, 8, 10, 13, 15, 16, 20, 23, 25, 28, 31, 32, 37, 39, 40, 47, 52, 55, 58,...}.
Numbers that are not the sum of 4 nonzero squares (n=4): A000534 ={1, 2, 3, 5, 6, 8, 9, 11, 14, 17, 24, 29, 32, 41, 56, 96, 128, 224, 384, 512,...}.
Numbers that are not the sum of 5 nonzero squares (n=5): A047701 = {1, 2, 3, 4, 6, 7, 9, 10, 12, 15, 18, 33}.
Numbers that are not the sum of 6 nonzero squares (n=6): {1, 2, 3, 4, 5, 7, 8, 10, 11, 13, 16, 19}.
Numbers that are not the sum of 7 nonzero squares (n=7): {1, 2, 3, 4, 5, 6, 8, 9, 11, 12, 14, 17, 20}.
Numbers that are not the sum of 8 nonzero squares (n=8): {1, 2, 3, 4, 5, 6, 7, 9, 10, 12, 13, 15, 18, 21}.
Numbers that are not the sum of 9 nonzero squares (n=9): {1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 13, 14, 16, 19, 22}.
The above conjecture appears as Theorem 2 on p. 73 in the Grosswald reference, where it is attributed to E. Dubouis (1911). - Wolfdieter Lang, Mar 27 2013

References

  • E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, pp. 73-74.

Crossrefs

Extensions

Edited by M. F. Hasler, Feb 23 2018
Showing 1-10 of 17 results. Next