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 10 results.

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

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

A071383 Squared radii of the circles around (0,0) that contain record numbers of lattice points.

Original entry on oeis.org

0, 1, 5, 25, 65, 325, 1105, 4225, 5525, 27625, 71825, 138125, 160225, 801125, 2082925, 4005625, 5928325, 29641625, 77068225, 148208125, 243061325, 1215306625, 3159797225, 6076533125, 12882250225, 53716552825, 64411251125
Offset: 1

Views

Author

Hugo Pfoertner, May 23 2002

Keywords

Comments

The number of lattice points (i,j) on the circle with i^2 + j^2 = a(n) is given by A071385(n).
In a sci.math posting on May 05 2002 entitled "Circle with 3 lattice points", James R. Buddenhagen asked: Which circles have the property that they pass through more lattice points than any smaller circle? and he gave the terms 1, 25, 65, 325, 1105, 4225, 5525, with the missing 5 added by Ahmed Fares. In the same thread Gerry Myerson mentioned the factorization into primes of the form 4*k+1.
Also, numbers with a record number of divisors all of whose prime factors are of the form 4k + 1. - Amiram Eldar, Sep 12 2019
Indices of records of A004018. Apart from the first term, also indices of records of A002654. - Jianing Song, May 20 2021

Crossrefs

Cf. A000448, A048610, A052199, A071384, A071385, A230655, A300162. Subsequence of A054994 (excluding first term). Where records occur in A004018. See A088959 for circles with integer radius.
Indices of records of Sum_{d|n} kronecker(m, d): A230655 (m=-3), this sequence (m=-4), A279541 (m=-6).

Programs

  • PARI
    my(v=list(10^15), rec=0); print1(0, ", "); for(n=1, #v, if(numdiv(v[n])>rec, rec=numdiv(v[n]); print1(v[n], ", "))) \\ Jianing Song, May 20 2021, see program for A054994
    
  • Python
    from math import prod
    from sympy import isprime
    primes_congruent_1_mod_4 = [5]
    def prime_4k_plus_1(i): # the i-th prime that is congruent to 1 mod 4
        while i>=len(primes_congruent_1_mod_4): # generate primes on demand
            n = primes_congruent_1_mod_4[-1]+4
            while not isprime(n): n += 4
            primes_congruent_1_mod_4.append(n)
        return primes_congruent_1_mod_4[i]
    def generate_A054994():
        TO_DO = {(1,())}
        while True:
            radius, exponents = min(TO_DO)
            yield radius, exponents
            TO_DO.remove((radius, exponents))
            TO_DO.update(successors(radius,exponents))
    def successors(r,exponents):
        for i,e in enumerate(exponents):
            if i==0 or exponents[i-1]>e:
                yield (r*prime_4k_plus_1(i), exponents[:i]+(e+1,)+exponents[i+1:])
        if exponents==() or exponents[-1]>0:
            yield (r*prime_4k_plus_1(len(exponents)), exponents+(1,))
    n,record,radius=1,1,0
    print(radius, end="") # or record, for A071385
    for radius,expo in generate_A054994():
        num_points = 4*prod((e+1) for e in expo)
        if num_points>record:
            record = num_points
            n += 1
            print (",", radius, end="") # or record, for A071385
            if n==27: break
    print()
    # Günter Rote, Sep 12 2023

Formula

For n>1 we have 1 < a(n+1)/a(n) <= 5, since one can multiply the points x+iy for which x^2 + y^2 = N by either 2+i or 2-i to get two new sets of points X+iY for which X^2 + Y^2 = 5N. This strictly increases the number since it is easy to see that the two sets aren't the same. - J. H. Conway, Jun 04 2002
lim n ->infinity Log(a(n))/n = 1. [Conjectured by Benoit Cloitre, proved by J. H. Conway]

A052199 Numbers that are expressible as the sum of 2 distinct positive squares in more ways than any smaller number.

Original entry on oeis.org

1, 5, 65, 325, 1105, 5525, 27625, 71825, 138125, 160225, 801125, 2082925, 4005625, 5928325, 29641625, 77068225, 148208125, 243061325, 1215306625, 3159797225, 6076533125, 12882250225, 53716552825, 64411251125, 167469252925, 322056255625, 785817263725
Offset: 1

Views

Author

Jud McCranie, Jan 28 2000

Keywords

Examples

			65 = 1^2 + 8^2 = 4^2 + 7^2, the smallest expressible in two ways, so 65 is a term.
		

References

  • Donald S. McDonald, Postings to sci.math newsgroup, Feb 21, 1995 and Dec 04, 1995.

Crossrefs

Cf. A001983, A007511, A048610, A071383. Subsequence of A054994. Where records occur in A025441; corresponding number of ways is A060306.

Programs

  • PARI
    c_old=-1;for(n=1,10000,c=0;for(i=1,floor(sqrt(n)),for(j=1,i-1,if(i^2+j^2==n,c+=1)));if(c>c_old,print1(n,", ");c_old=c)) \\ Derek Orr, Mar 15 2019

Extensions

More terms from Randall L Rathbun, Jan 18 2002
Edited by Ray Chandler, Jan 12 2012

A230477 Smallest number that is the sum of n positive n-th powers in >= n ways.

Original entry on oeis.org

1, 50, 5104, 236674, 9006349824, 82188309244
Offset: 1

Views

Author

Jonathan Sondow, Oct 22 2013

Keywords

Comments

Does a(6) exist? For which values of n does a(n) exist? Is there a proof that a(n) < a(n+1) when both exist?

Examples

			1 = 1^1.
50 = 1^2 + 7^2 = 5^2 + 5^2.
5104 = 1^3 + 12^3 + 15^3 = 2^3 + 10^3 + 16^3 = 9^3 + 10^3 + 15^3.
236674 = 1^4 + 2^4 + 7^4 + 22^4 = 3^4 + 6^4 + 18^4 + 19^4 = 7^4 + 14^4 + 16^4 + 19^4 = 8^4 + 16^4 + 17^4 + 17^4.
9006349824 = 8^5 + 34^5 + 62^5 + 68^5 + 92^5 = 8^5 + 41^5 + 47^5 + 79^5 + 89^5 = 12^5 + 18^5 + 72^5 + 78^5 + 84^5 = 21^5 + 34^5 + 43^5 + 74^5 + 92^5 = 24^5 + 42^5 + 48^5 + 54^5 + 96^5.
82188309244 = 1^6 + 9^6 + 29^6 + 44^6 + 55^6 + 60^6 = 2^6 + 12^6 + 25^6 + 51^6 + 53^6 + 59^6 = 5^6 + 23^6 + 27^6 + 44^6 + 51^6 + 62^6 = 10^6 + 16^6 + 41^6 + 45^6 + 51^6 + 61^6 = 12^6 + 23^6 + 33^6 + 34^6 + 55^6 + 61^6 = 15^6 + 23^6 + 31^6 + 36^6 + 53^6 + 62^6.
		

References

  • A. H. Beiler, Recreations in the Theory of Numbers: The Queen of Mathematics Entertains, Dover, NY, 1966, pp. 162-165, 290-291.
  • R. K. Guy, Unsolved Problems in Number Theory, 3rd edition, Springer, 2004, D1.

Crossrefs

a(2) = A048610(2), a(3) = A025398(1), a(4) = A219921(1).
Cf. A146756 (smallest number that is the sum of n distinct positive n-th powers in exactly n ways), A230561 (smallest number that is the sum of two positive n-th powers in >= n ways), A091414 (smallest number that is the sum of n positive n-th powers in >= 2 ways).

Formula

a(n) <= A146756(n), with equality at least for n = 1, 3, 5 and inequality at least for n = 2, 4.
a(n) >= A091414(n) for n > 1, with equality at least for n = 2 and inequality at least for n = 3, 4, 5.

Extensions

a(5) from Donovan Johnson, Oct 23 2013
a(6) from Michael S. Branicky, May 09 2021

A230561 Smallest number that is the sum of two positive n-th powers in >= n ways.

Original entry on oeis.org

2, 50, 87539319
Offset: 1

Views

Author

Jonathan Sondow, Oct 23 2013

Keywords

Comments

Guy, 2004: "Euler knew that 635318657 = 133^4 + 134^4 = 59^4 + 158^4, and Leech showed this to be the smallest example. No one knows of three such equal sums." Thus no one knows whether a(4) exists, which requires four such equal sums.
a(4) > 10^21 (if it exists). There is no number <= 10^21 that is the sum of two positive 4th powers in >= three ways. - Donovan Johnson, Jan 07 2014

Examples

			2 = 1^1 + 1^1.
50 = 1^2 + 7^2 = 5^2 + 5^2.
87539319 = 167^3 + 436^3 = 228^3 + 423^3 = 255^3 + 414^3.
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, 3rd edition, Springer, 2004, D1.

Crossrefs

Cf. A048610, A011541 for a(2), a(3).
Cf. also A016078, A230477.

Formula

a(n) >= A016078(n) for n > 1, with equality at least for n = 2, and inequality at least for n = 3.

A007511 a(n) is the smallest number greater than a(n-1) that is expressible as the sum of two squares in more ways than a(n-1).

Original entry on oeis.org

2, 50, 325, 1105, 5525, 27625, 71825, 138125, 160225, 801125, 2082925, 4005625, 5928325, 29641625, 77068225, 148208125, 243061325, 1215306625, 3159797225, 6076533125, 12882250225, 53716552825, 64411251125, 167469252925, 322056255625, 785817263725
Offset: 1

Views

Author

Gabriel Cunningham (gcasey(AT)mit.edu), Feb 29 2004

Keywords

Comments

Sequence provides the locations of records in A025426 (nonzero squares), rather than in A000161 (definition of squares includes zeros). - R. J. Mathar, Jun 06 2007

Crossrefs

Cf. A048610.

Extensions

a(12)-a(18) from Donovan Johnson, Sep 03 2008
a(19)-a(24) from Donovan Johnson, Jul 01 2009
a(25)-a(26) from Donovan Johnson, Aug 30 2011

A091414 Least number that is the sum of n positive n-th powers in at least 2 ways.

Original entry on oeis.org

50, 251, 259, 4097, 570947, 73310705, 647282661, 79327628290, 1077347903894, 1761813250036143, 2343908545594901
Offset: 2

Views

Author

Gabriel Cunningham (gcasey(AT)mit.edu), Mar 02 2004

Keywords

Comments

From Donovan Johnson, Sep 14 2008: (Start)
a(11) = 2^11 + 2^11 + 2^11 + 2^11 + 8^11 + 10^11 + 10^11 + 15^11 + 22^11 + 22^11 + 22^11 = 3^11 + 5^11 + 5^11 + 5^11 + 6^11 + 9^11 + 11^11 + 12^11 + 17^11 + 20^11 + 24^11.
a(12) = 2^12 + 2^12 + 2^12 + 2^12 + 2^12 + 2^12 + 2^12 + 9^12 + 9^12 + 9^12 + 15^12 + 19^12 = 3^12 + 5^12 + 5^12 + 10^12 + 10^12 + 10^12 + 10^12 + 12^12 + 12^12 + 17^12 + 17^12 + 18^12.
a(13) > 876*10^15. a(14) > 799*10^15. a(15) > 115*10^16. (End)

Examples

			a(3) = 251 because 251 = 1^3 + 5^3 + 5^3 = 2^3 + 3^3 + 6^3 and it is the smallest number that can be represented two ways as the sum of three third powers.
		

Crossrefs

a(2) = A048610(2), a(3) = A008917(1), a(4) = A185673(2). - Jonathan Sondow, Oct 24 2013

Formula

a(n) <= A230477(n) for n > 1, with equality at least for n = 2 and inequality at least for n = 3, 4, 5. - Jonathan Sondow, Oct 24 2013

Extensions

More terms from David Wasserman, Mar 09 2006
a(11)-a(12) from Donovan Johnson, Sep 14 2008
Definition shortened by Jonathan Sondow, Oct 24 2013

A234004 Smallest number which is the sum of two positive triangular numbers (A000217) in at least n ways.

Original entry on oeis.org

2, 16, 81, 471, 1056, 1381, 6906, 6906, 17956, 34531, 40056, 40056, 200281, 200281, 200281, 200281, 520731, 520731, 1001406, 1001406, 1482081, 1482081, 1482081, 1482081, 7410406, 7410406, 7410406, 7410406, 7410406, 7410406, 7410406, 7410406
Offset: 1

Views

Author

Keywords

Examples

			2 = 1+1; 16 = 1+15 = 6+10; 81 = 3+78 = 15+66 = 36+45.
		

Crossrefs

Programs

A334078 a(n) is the smallest positive integer that can be expressed as the difference of two positive squares in at least n ways.

Original entry on oeis.org

3, 15, 45, 96, 192, 240, 480, 480, 720, 960, 1440, 1440, 2880, 2880, 2880, 3360, 5040, 5040, 6720, 6720, 10080, 10080, 10080, 10080, 20160, 20160, 20160, 20160, 20160, 20160, 30240, 30240, 40320, 40320, 40320, 40320, 60480, 60480, 60480, 60480, 80640, 80640
Offset: 1

Views

Author

Ilya Gutkovskiy, Apr 13 2020

Keywords

Crossrefs

Showing 1-10 of 10 results.