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

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

A018825 Numbers that are not the sum of 2 nonzero squares.

Original entry on oeis.org

1, 3, 4, 6, 7, 9, 11, 12, 14, 15, 16, 19, 21, 22, 23, 24, 27, 28, 30, 31, 33, 35, 36, 38, 39, 42, 43, 44, 46, 47, 48, 49, 51, 54, 55, 56, 57, 59, 60, 62, 63, 64, 66, 67, 69, 70, 71, 75, 76, 77, 78, 79, 81, 83, 84, 86, 87, 88, 91, 92, 93, 94, 95, 96, 99, 102, 103, 105, 107, 108, 110
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A022544, A081324, A000404 (complement), A004431.

Programs

  • Haskell
    import Data.List (elemIndices)
    a018825 n = a018825_list !! (n-1)
    a018825_list = tail $ elemIndices 0 a025426_list
    -- Reinhard Zumkeller, Aug 16 2011
    
  • Maple
    isA000404 := proc(n)
        local x,y ;
        for x from 1 do
            if x^2> n then
                return false;
            end if;
            for y from 1 do
                if x^2+y^2 > n then
                    break;
                elif x^2+y^2 = n then
                    return true;
                end if;
            end do:
        end do:
    end proc:
    A018825 := proc(n)
        if n = 1 then
            1;
        else
            for a from procname(n-1)+1 do
                if not isA000404(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    seq(A018825(n),n=1..30) ; # R. J. Mathar, Jul 28 2014
  • Mathematica
    q=13;q2=q^2+1;lst={};Do[Do[z=a^2+b^2;If[z<=q2,AppendTo[lst,z]],{b,a,1,-1}],{a,q}];lst; u=Union@lst;Complement[Range[q^2],u] (* Vladimir Joseph Stephan Orlovsky, May 30 2010 *)
  • PARI
    is(n)=my(f=factor(n), t=prod(i=1,#f~, if(f[i,1]%4==1, f[i,2]+1, if(f[i,2]%2 && f[i,1]>2, 0, 1)))); if(t!=1, return(!t)); for(k=sqrtint((n-1)\2)+1, sqrtint(n-1), if(issquare(n-k^2), return(0))); 1 \\ Charles R Greathouse IV, Sep 02 2015

Formula

A025426(a(n)) = 0; A063725(a(n)) = 0. - Reinhard Zumkeller, Aug 16 2011

A025285 Numbers that are the sum of 2 nonzero squares in exactly 2 ways.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Order and signs don't count. E.g. 50 = 5^2+5^2 = 7^2+1^2 (= (-5)^2+5^2, but that doesn't count as different).
A131574 is a subsequence. - Zak Seidov, Jan 31 2014
A025426(a(n)) = 2. - Reinhard Zumkeller, Feb 26 2015

Crossrefs

Programs

  • Haskell
    a025285 n = a025285_list !! (n-1)
    a025285_list = filter ((== 2) . a025426) [1..]
    -- Reinhard Zumkeller, Feb 26 2015
    
  • Mathematica
    selQ[n_] := Length[ Select[ PowersRepresentations[n, 2, 2], Times @@ # != 0 &]] == 2; Select[Range[1000], selQ] (* Jean-François Alcover, Oct 03 2013 *)
  • PARI
    is(n)=sum(k=sqrtint((n-1)\2)+1,sqrtint(n-1), issquare(n-k^2))==2 \\ Charles R Greathouse IV, May 24 2016
    
  • PARI
    is(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)==4 \\ Charles R Greathouse IV, May 24 2016

Formula

a(n) >= A007692(n) with equality only for n <= 16. - Alois P. Heinz, Mar 23 2023

A050795 Numbers n such that n^2 - 1 is expressible as the sum of two nonzero squares in at least one way.

Original entry on oeis.org

3, 9, 17, 19, 33, 35, 51, 73, 81, 99, 105, 129, 145, 147, 161, 163, 179, 195, 201, 233, 243, 273, 289, 291, 297, 339, 361, 387, 393, 451, 465, 467, 483, 489, 513, 521, 577, 579, 585, 611, 627, 649, 675, 721, 723, 739, 777, 801, 809, 819, 849, 883, 899, 915
Offset: 1

Views

Author

Patrick De Geest, Sep 15 1999

Keywords

Comments

Analogous solutions exist for the sum of two identical squares z^2-1 = 2.r^2 (e.g. 99^2-1 = 2.70^2). Values of 'z' are the terms in sequence A001541, values of 'r' are the terms in sequence A001542.
Looking at a^2 + b^2 = c^2 - 1 modulo 4, we must have a and b even and c odd. Taking a = 2u, b = 2v and c = 2w - 1 and simplifying, we get u^2 + v^2 = w(w+1). - Franklin T. Adams-Watters, May 19 2008
If n is in this sequence, then so is n^(2^k), for all k >= 0. - Altug Alkan, Apr 13 2016

Examples

			E.g. 51^2 - 1 = 10^2 + 50^2 = 22^2 + 46^2 = 34^2 + 38^2.
		

Crossrefs

Programs

  • Mathematica
    t={}; Do[i=c=1; While[iJayanta Basu, Jun 01 2013 *)
    Select[Range@ 1000, Length[PowersRepresentations[#^2 - 1, 2, 2] /. {0, } -> Nothing] > 0 &] (* _Michael De Vlieger, Apr 13 2016 *)
  • PARI
    select( {is_A050795(n)=#qfbsolve(Qfb(1,0,1),n^2-1,2)}, [1..999]) \\ M. F. Hasler, Mar 07 2022
  • Python
    from itertools import islice, count
    from sympy import factorint
    def A050795_gen(startvalue=2): # generator of terms >= startvalue
        for k in count(max(startvalue,2)):
            if all(map(lambda d: d[0] % 4 != 3 or d[1] % 2 == 0, factorint(k**2-1).items())):
                yield k
    A050795_list = list(islice(A050795_gen(),20)) # Chai Wah Wu, Mar 07 2022
    

Formula

a(n) = 2*A140612(n) + 1. - Franklin T. Adams-Watters, May 19 2008
{k : A025426(k^2-1)>0}. - R. J. Mathar, Mar 07 2022

A025455 a(n) is the number of partitions of n into 2 positive cubes.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

In other words, number of solutions to the equation x^3 + y^3 = n with x >= y > 0. - Antti Karttunen, Aug 28 2017
The first term > 1 is a(1729) = 2. - Michel Marcus, Apr 23 2019

Crossrefs

Cf. A025456, A025468, A003108, A003325, A000578, A048766, A001235 (two or more ways, positions where a(n) > 1).
Cf. also A025426, A216284.

Programs

Formula

If a(n) > 0 then A025456(n + k^3) > 0 for k>0; a(A113958(n)) > 0; a(A003325(n)) > 0. - Reinhard Zumkeller, Jun 03 2006
a(n) >= A025468(n). - Antti Karttunen, Aug 28 2017
a(n) = [x^n y^2] Product_{k>=1} 1/(1 - y*x^(k^3)). - Ilya Gutkovskiy, Apr 23 2019

Extensions

Secondary offset added by Antti Karttunen, Aug 28 2017
Secondary offset corrected by Michel Marcus, Apr 23 2019

A084888 Number of partitions of n^3 into two squares>0.

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, 3, 2, 0, 0, 2, 0, 0, 1, 0, 2, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 2, 0, 0, 0, 0, 4, 0, 2, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 8, 0, 0, 2, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 8, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 2, 1, 0, 3, 2
Offset: 0

Views

Author

Reinhard Zumkeller, Jun 10 2003

Keywords

Comments

a(A050804(n)) = 1.

Examples

			n=100: 100^3 = 1000000 = 960^2 + 280^2 = 936^2 + 352^2 = 800^2 + 600^2, therefore a(100)=3.
		

Crossrefs

Programs

  • Haskell
    a084888 = a025426 . a000578  -- Reinhard Zumkeller, Jul 18 2012
    
  • PARI
    a(n)=my(f=factor(n^3)); (prod(i=1,#f~,if(f[i,1]%4==1,f[i,2]+1,f[i,2]%2==0||f[i,1]<3))-issquare(n)+1)\2 \\ Charles R Greathouse IV, May 18 2016
    
  • Python
    from math import prod
    from sympy import factorint
    def A084888(n): return ((m:=prod(1 if p==2 else (3*e+1 if p&3==1 else (3*e+1)&1) for p, e in factorint(n).items()))+((((~n**3 & n**3-1).bit_length()&1)<<1)-1 if m&1 else 0))>>1 # Chai Wah Wu, May 17 2023

Formula

a(n) = A025426(A000578(n)).

A216282 Number of nonnegative solutions to the equation x^2 + 2*y^2 = n.

Original entry on oeis.org

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

Views

Author

V. Raman, Sep 03 2012

Keywords

Comments

Records occur at 1, 9, 81, 297, 891, 1683, 5049, 15147, 31977, ... - Antti Karttunen, Aug 23 2017

Examples

			For n = 9, there are two solutions: 9 = 9^2 + 2*(0^2) = 1^2 + 2*(2^2), thus a(9) = 2.
For n = 81, there are three solutions: 81 = 9^2 + 2*(0^2) = 3^2 + 2*(6^2) = 7^2 + 2*(4^2), thus a(81) = 3.
For n = 65536, there is one solution: 65536 = 256^2 + 2*(0^2) = 65536 + 0, thus a(65536) = 1.
For n = 65537, there is one solution: 65537 = 255^2 + 2*(16^2) = 65205 + 512, thus a(65537) = 1.
		

Crossrefs

Cf. A002479 (positions of nonzeros), A097700 (of zeros).

Programs

  • Mathematica
    r[n_] := Reduce[x >= 0 && y >= 0 && x^2 + 2 y^2 == n, Integers];
    a[n_] := Which[rn = r[n]; rn === False, 0, Head[rn] === And, 1, Head[rn] === Or, Length[rn], True, -1];
    Table[a[n], {n, 1, 120}] (* Jean-François Alcover, Jun 24 2017 *)
  • Scheme
    (define (A216282 n) (cond ((< n 2) 1) (else (let loop ((k (- (A000196 n) (modulo (- n (A000196 n)) 2))) (s 0)) (if (< k 0) s (let ((x (/ (- n (* k k)) 2))) (loop (- k 2) (+ s (A010052 x))))))))) ;; Antti Karttunen, Aug 23 2017

Extensions

Examples from Antti Karttunen, Aug 23 2017

A321437 Expansion of Product_{1 <= i <= j} 1/(1 - x^(i^2 + j^2)).

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 1, 1, 2, 1, 4, 1, 4, 3, 4, 5, 5, 6, 9, 6, 13, 8, 14, 13, 15, 19, 21, 21, 29, 24, 38, 32, 42, 44, 51, 56, 65, 65, 83, 79, 102, 99, 120, 125, 144, 154, 176, 183, 213, 219, 262, 266, 311, 322, 369, 392, 437, 465, 526, 550, 635, 650, 747, 781, 871, 937
Offset: 0

Views

Author

Seiichi Manyama, Nov 09 2018

Keywords

Crossrefs

Convolution inverse of A321436.

Formula

G.f.: Product_{k>0} 1/(1 - x^k)^A025426(k).
Previous Showing 11-20 of 45 results. Next