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-3 of 3 results.

A025441 Number of partitions of n into 2 distinct nonzero squares.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Cf. A060306 gives records; A052199 gives where records occur.
Column k=2 of A341040.
Cf. A004439 (a(n)=0), A025302 (a(n)=1), A025303 (a(n)=2), A025304 (a(n)=3), A025305 (a(n)=4), A025306 (a(n)=5), A025307 (a(n)=6), A025308 (a(n)=7), A025309 (a(n)=8), A025310 (a(n)=9), A025311 (a(n)=10), A004431 (a(n)>0).

Programs

  • Haskell
    a025441 n = sum $ map (a010052 . (n -)) $
                          takeWhile (< n `div` 2) $ tail a000290_list
    -- Reinhard Zumkeller, Dec 20 2013
    
  • Mathematica
    Table[Count[PowersRepresentations[n, 2, 2], pr_ /; Unequal @@ pr && FreeQ[pr, 0]], {n, 0, 107}] (* Jean-François Alcover, Mar 01 2019 *)
  • PARI
    a(n)=if(n>4,sum(k=1,sqrtint((n-1)\2),issquare(n-k^2)),0) \\ Charles R Greathouse IV, Jun 10 2016
    
  • PARI
    a(n)=if(n<5,return(0)); 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-issquare(n/2) \\ Charles R Greathouse IV, Jun 10 2016
    
  • Python
    from math import prod
    from sympy import factorint
    def A025441(n):
        f = factorint(n).items()
        return -int(not (any((e-1 if p == 2 else e)&1 for p,e in f) or n&1)) + (((m:=prod(1 if p==2 else (e+1 if p&3==1 else (e+1)&1) for p, e in f))+((((~n & n-1).bit_length()&1)<<1)-1 if m&1 else 0))>>1) if n else 0 # Chai Wah Wu, Sep 08 2022

Formula

a(A025302(n)) = 1. - Reinhard Zumkeller, Dec 20 2013
a(n) = Sum_{ m: m^2|n } A157228(n/m^2). - Andrey Zabolotskiy, May 07 2018
a(n) = [x^n y^2] Product_{k>=1} (1 + y*x^(k^2)). - Ilya Gutkovskiy, Apr 22 2019
a(n) = Sum_{i=1..floor((n-1)/2)} c(i) * c(n-i), where c is the square characteristic (A010052). - Wesley Ivan Hurt, Nov 26 2020
a(n) = A000161(n) - A093709(n). - Andrey Zabolotskiy, Apr 12 2022

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

A300163 Records in the number of ways to express a number of the form n^2 + 1 as j^2 + k^2 with j > k > 1.

Original entry on oeis.org

1, 2, 3, 5, 7, 8, 11, 15, 17, 23, 31, 35, 39, 47, 63, 71, 95, 127, 143, 161, 191, 215, 255, 287, 319, 383, 575, 639, 767, 959, 1151
Offset: 1

Views

Author

Hugo Pfoertner, Feb 27 2018

Keywords

Examples

			a(6) = 8 because A300162(6) = A300161(6)^2 + 1 = 71825 is the smallest number expressible in 8 ways: 71825 = 265^2 + 40^2 = 260^2 + 65^2 = 257^2 + 76^2 = 247^2 + 104^2 = 236^2 + 127^2 = 215^2 + 160^2 = 208^2 + 169^2 = 191^2 + 188^2.
		

Crossrefs

Extensions

a(17) from Hugo Pfoertner, Mar 08 2018
a(18)-a(21) from Robert Price, Mar 10 2018
a(22)-a(31) from Giovanni Resta, Mar 13 2018
Showing 1-3 of 3 results.