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

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

A093195 Least number which is the sum of two distinct nonzero squares in exactly n ways.

Original entry on oeis.org

5, 65, 325, 1105, 8125, 5525, 105625, 27625, 71825, 138125, 126953125, 160225, 1221025, 3453125, 1795625, 801125, 446265625, 2082925, 41259765625, 4005625, 44890625, 30525625, 30994415283203125, 5928325, 303460625, 53955078125, 35409725, 100140625
Offset: 1

Views

Author

Lekraj Beedassy, Apr 22 2004

Keywords

Comments

An algorithm to compute the n-th term of this sequence: Write each of 2n and 2n+1 as products of their divisors in all possible ways and in decreasing order. For each product, equate each divisor in the product to (a1+1)(a2+1)...(ar+1), so that a1 >= a2 >= a3 >= ... >= ar, and solve for the ai. Evaluate A002144(1)^a1 * A002144(2)^a2 * ... * A002144(r)^ar for each set of values determined above, then the smaller of these products is the least integer to have precisely n partitions into a sum of two distinct positive squares. [Ant King, Dec 14 2009; May 26 2010]

Crossrefs

Cf. A002144, A018782, A054994, A025302-A025311 (first entries). See A016032, A000446 and A124980 for other versions.

Programs

  • PARI
    b(k)=my(c=0);for(i=1,sqrtint((k-1)\2),if(issquare(k-i^2),c+=1));c \\ A025441
    for(n=1,10,k=1;while(k,if(b(k)==n,print1(k,", ");break);k+=1)) \\ Derek Orr, Mar 20 2019

Formula

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

Extensions

More terms from Ant King, Dec 14 2009 and Feb 07 2010

A018782 Smallest k such that circle x^2 + y^2 = k passes through exactly 4n integer points.

Original entry on oeis.org

1, 5, 25, 65, 625, 325, 15625, 1105, 4225, 8125, 9765625, 5525, 244140625, 203125, 105625, 27625, 152587890625, 71825, 3814697265625, 138125, 2640625, 126953125, 2384185791015625, 160225, 17850625, 3173828125, 1221025, 3453125
Offset: 1

Views

Author

Keywords

Comments

a(n) is least term of A054994 with exactly n divisors. - Ray Chandler, Jan 05 2012
From Jianing Song, Apr 24 2021: (Start)
a(n) is the smallest k such that A004018(k) = 4n.
Also a(n) is the smallest index of n in A002654.
a(n) is the smallest term in A004613 that has exactly n divisors.
This is a subsequence of A054994. (End)

Examples

			4225 = 5^2 * 13^2 is the smallest number all of whose prime factors are congruent to 1 modulo 4 with exactly 9 divisors, so a(9) = 4225. - _Jianing Song_, Apr 24 2021
		

Crossrefs

Programs

  • Mathematica
    (* This program is not convenient to compute huge terms - A054994 is assumed to be computed with maxTerm = 10^16 *) a[n_] := Catch[ For[k = 1, k <= Length[A054994], k++, If[DivisorSigma[0, A054994[[k]]] == n, Throw[A054994[[k]]]]]]; Table[a[n], {n, 1, 28}] (* Jean-François Alcover, Jan 21 2013, after Ray Chandler *)
  • PARI
    primelist(d,r,l) = my(v=vector(l), i=0); if(l>0, forprime(p=2, oo, if(Mod(p,d)==r, i++; v[i]=p; if(i==l, break())))); v
    prodR(n, maxf)=my(dfs=divisors(n), a=[], r); for(i=2, #dfs, if( dfs[i]<=maxf, if(dfs[i]==n, a=concat(a, [[n]]), r=prodR(n/dfs[i], min(dfs[i], maxf)); for(j=1, #r, a=concat(a, [concat(dfs[i], r[j])]))))); a
    A018782(n)=my(pf=prodR(n, n), a=1, b, v=primelist(4, 1, bigomega(n))); for(i=1, #pf, b=prod(j=1, length(pf[i]), v[j]^(pf[i][j]-1)); if(bJianing Song, Apr 25 2021, following R. J. Mathar's program for A005179.

Formula

A000446(n) = min(a(2n-1), a(2n)) for n > 1.
A124980(n) = min(a(2n-1), a(2n)).
A016032(n) = min(2*a(2n-1), a(2n), a(2n+1)).
A093195(n) = min(a(2n), a(2n+1)).
From Jianing Song, Apr 24 2021: (Start)
If the factorization of n into primes is n = Product_{i=1..r} p_i with p_1 >= p_2 >= ... >= p_r, then a(n) <= (q_1)^((p_1)-1) * (q_2)^((p_2)-1) * ... * (q_r)^((p_r)-1), where q_1 < q_2 < ... < q_r are the first r primes congruent to 1 modulo 4. The smallest n such that the equality does not hold is n = 16.
a(n) <= 5^(n-1) for all n, where the equality holds if and only if n = 1 or n is a prime.
a(p*q) = 5^(p-1) * 13^(q-1) for primes p >= q. (End)

A287166 Smallest number with exactly n representations as a sum of 7 nonzero squares or 0 if no such number exists.

Original entry on oeis.org

7, 22, 31, 37, 45, 67, 55, 61, 69, 70, 79, 82, 94, 108, 85, 93, 103, 106, 111, 132, 109, 126, 139, 117, 147, 146, 130, 145, 144, 133, 153, 167, 141, 154, 160, 172, 159, 166, 187, 157, 177, 174, 175, 0, 178, 165
Offset: 1

Views

Author

Ilya Gutkovskiy, May 20 2017

Keywords

Examples

			a(1) = 7 because 7 is the smallest number with exactly 1 representation as a sum of 7 nonzero squares: 7 = 1^2 + 1^2 + 1^2 + 1^2 + 1^2 + 1^2 + 1^2;
a(2) = 22 because 22 is the smallest number with exactly 2 representations as a sum of 7 nonzero squares: 22 = 1^2 + 1^2 + 1^2 + 1^2 + 1^2 + 1^2 + 4^2 = 1^2 + 1^2 + 2^2 + 2^2 + 2^2 + 2^2 + 2^2, etc.
		

Crossrefs

Formula

A025431(a(n)) = n for a(n) > 0.

A048610 Smallest number that is the sum of two positive squares in >= n ways.

Original entry on oeis.org

2, 50, 325, 1105, 5525, 5525, 27625, 27625, 71825, 138125, 160225, 160225, 801125, 801125, 801125, 801125, 2082925, 2082925, 4005625, 4005625, 5928325, 5928325, 5928325, 5928325, 29641625, 29641625, 29641625, 29641625, 29641625, 29641625
Offset: 1

Views

Author

Keywords

Examples

			2 = 1^2 + 1^2; 50 = 1^2 + 7^2 = 5^2 + 5^2; 325 = 1^2 + 18^2 = 6^2 + 17^2 = 10^2 + 15^2.
		

References

  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 50, p. 19, Ellipses, Paris 2008.
  • J. Meeus, Problem 1375, J. Rec. Math., 18 (No. 1, 1985), p. 70.
  • Problem 590, J. Rec. Math., 11 (No. 2, 1978), p. 137.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    (* Assuming a(n) multiple of 1105, from 1105 on, to speed up computation *) twoSquaresR[n_] := twoSquaresR[n] = With[{r = Reduce[0 < x <= y && n == x^2 + y^2, {x, y}, Integers]}, If[r === False, 0, Length[{x, y} /. {ToRules[r]}]]]; a[n_] := a[n] = For[an = a[n - 1], True, an = If[an < 1105, an + 1, an + 1105], If[ twoSquaresR[an] >= n, Return[an]]];a[1] = 2; Table[ Print[a[n]]; a[n], {n, 1, 30}] (* Jean-François Alcover, Jun 22 2012 *)
    nn = 10^6; t2 = Table[0, {nn}]; n2 = Floor[Sqrt[nn]]; Do[r = a^2 + b^2; If[r <= nn, t2[[r]]++], {a, n2}, {b, a, n2}]; t = {}; n = 1; While[a = Position[t2, ?(# >= n &), 1, 1]; a != {}, AppendTo[t, a[[1, 1]]]; n++]; t (* _T. D. Noe, Jun 22 2012 *)

A214511 Least number having n orderless representations as p^2 + q^2, where p and q are primes.

Original entry on oeis.org

8, 338, 2210, 10370, 202130, 229970, 197210, 81770, 18423410, 16046810, 12625730, 21899930, 9549410, 370247930, 416392730, 579994610, 338609570, 2155919090, 601741010, 254885930, 10083683090, 4690939370, 29207671610, 30431277890, 22264417370, 23231920010
Offset: 1

Views

Author

T. D. Noe, Jul 26 2012

Keywords

Comments

A045698(a(n)) = n and A045698(m) < n for m < a(n). - Reinhard Zumkeller, Jul 29 2012
a(53) = 3374376505370. a(52) and terms following a(53) are greater than 4*10^13. - Giovanni Resta, Jul 02 2018

Examples

			a(2) = 338 because 338 = 7^2 + 17^2 = 13^2 + 13^2 and 338 is the least number with this property.
		

Crossrefs

Cf. A016032 (p and q integers).

Programs

  • Haskell
    import Data.List (elemIndex)
    import Data.Maybe (fromJust)
    a214511 = (+ 1) . fromJust . (`elemIndex` a045698_list)
    -- Reinhard Zumkeller, Jul 29 2012
  • Mathematica
    nn = 10^6; ps = Prime[Range[PrimePi[Sqrt[nn]]]]; t = Flatten[Table[ps[[i]]^2 + ps[[j]]^2, {i, Length[ps]}, {j, i, Length[ps]}]]; t = Select[t, # <= nn &]; t2 = Sort[Tally[t]]; u = Union[Transpose[t2][[2]]]; d = Complement[Range[u[[-1]]], u]; If[d == {}, nLim = u[[-1]], nLim = d[[1]]-1]; t3 = Table[Select[t2, #[[2]] == n &, 1][[1]], {n, nLim}]; Transpose[t3][[1]]

Extensions

a(21)-a(26) from Donovan Johnson, Jul 29 2012

A000446 Smallest number that is the sum of 2 squares (allowing zeros) in exactly n ways.

Original entry on oeis.org

0, 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
Offset: 1

Views

Author

Keywords

Comments

Could start with a(0) = 3: the smallest nonnegative integer that can be written as sum of two squares in 0 ways. - M. F. Hasler, Jul 05 2024

Examples

			a(1) = 0 because 0 is the smallest integer which is uniquely a unique sum of two squares, namely 0^2 + 0^2.
a(2) = 25 from 25 = 5^2 + 0^2 = 3^2 + 4^2.
a(3) = 325 from 325 = 1^2 + 18^2 = 6^2 + 17^2 = 10^2 + 15^2.
a(4) = 1105 from 1105 = 4^2 + 33^2 = 9^2 + 32^2 = 12^2 + 31^2 = 23^2 + 24^2.
		

Crossrefs

Cf. A000448 (similar, but "in at least n ways").
See A016032, A093195 and A124980 for other versions.

Programs

Formula

An algorithm to compute the n-th term of this sequence for n>1: Write each of 2n and 2n-1 as products of their divisors, in decreasing order and in all possible ways. Equate each divisor in the product to (a1+1)(a2+1)...(ar+1), so that a1>=a2>=a3>=...>=ar, and solve for the ai. Evaluate A002144(1)^a1 x A002144(2)^a2 x ... x A002144(r)^ar for each set of values determined above, then the smaller of these products is the least integer to have precisely n partitions into a sum of two squares. [Ant King, Oct 07 2010]
a(n) = min(A018782(2n-1), A018782(2n)) for n > 1.
a(n) = A124980(n) for n > 1. - M. F. Hasler, Jul 07 2024

Extensions

Better description and more terms from David W. Wilson, Aug 15 1996
Definition improved by several correspondents, Nov 12 2007

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

A273238 Least number k such that k^3 is the sum of two nonzero squares in exactly n ways.

Original entry on oeis.org

2, 5, 25, 50, 125, 625, 1250, 65, 15625, 31250, 78125, 390625, 781250, 325, 9765625, 19531250, 48828125, 244140625, 488281250, 1625, 6103515625, 12207031250, 30517578125, 4225, 8450, 8125, 3814697265625, 7629394531250, 19073486328125, 95367431640625
Offset: 1

Views

Author

Altug Alkan, May 18 2016

Keywords

Examples

			a(1) = 2 because 2^3 = 2^2 + 2^2.
a(2) = 5 because 5^3 = 5^2 + 10^2 = 2^2 + 11^2.
a(3) = 25 because 25^3 = 35^2 + 120^2 = 44^2 + 117^2 = 75^2 + 100^2.
		

Crossrefs

Programs

  • Mathematica
    Function[t, FirstPosition[t, #] & /@ Range@ 8]@ Map[Length@ Select[ PowersRepresentations[#^3, 2, 2], ! MemberQ[#, 0] &] &, Range[2 10^3]] // Flatten (* Michael De Vlieger, May 18 2016 *)
    (* code for first 100 terms *) nR[n_] := (SquaresR[2, n] + Plus @@ Pick[{-4, 4}, IntegerQ /@ Sqrt[{n, n/2}]])/8; c[w_] := Floor[1/2 Times @@ (3 w + 1)]; q[1] = 2; q[n_] := Min[Reap[Do[ x = Times @@ (Take[{5, 13, 17, 29}, Length[e]]^e); If[c[e] == n && nR[x^3] == n, Sow[x]]; If[c[e] + 1 == n && nR[8 x^3] == n, Sow[2 x]], {e, Join[Transpose[{ Range@ 80}], Join @@ (IntegerPartitions[#, 4] & /@ Range[21]) ]}]][[2, 1]]]; Array[q, 100] (* Giovanni Resta, May 18 2016 *)
  • PARI
    A025426(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
    a(n)=my(k=1); while(A025426(k++^3)!=n, ); k
    first(n)=my(v=vector(n),t,k); while(1, t=A025426(k++^3); if(t>0 && t<=n && v[t]==0, v[t]=k; if(factorback(v), return(v)))) \\ Charles R Greathouse IV, May 18 2016

Extensions

a(10)-a(30) from Giovanni Resta, May 18 2016

A274567 Least number k such that k^2-1 is the sum of two nonzero squares in exactly n ways.

Original entry on oeis.org

3, 81, 51, 291, 1251, 339, 62499, 1971, 5201, 5001, 175781251, 7299
Offset: 1

Views

Author

Altug Alkan, Jun 28 2016

Keywords

Comments

a(11) > 25*10^5 if it exists. - Chai Wah Wu, Jul 23 2020
From David A. Corneth, Jul 23 2020: (Start)
a(13) <= 17578125001, a(17) <= 610351562499. (End)

Examples

			a(2) = 81 because 81^2 - 1 = 28^2 + 76^2 = 44^2 + 68^2.
		

Crossrefs

Extensions

a(10) from Chai Wah Wu, Jul 22 2020
Showing 1-10 of 22 results. Next