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.

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

A001983 Numbers that are the sum of 2 distinct squares: of form x^2 + y^2 with 0 <= x < y.

Original entry on oeis.org

1, 4, 5, 9, 10, 13, 16, 17, 20, 25, 26, 29, 34, 36, 37, 40, 41, 45, 49, 50, 52, 53, 58, 61, 64, 65, 68, 73, 74, 80, 81, 82, 85, 89, 90, 97, 100, 101, 104, 106, 109, 113, 116, 117, 121, 122, 125, 130, 136, 137, 144, 145, 146, 148, 149, 153, 157, 160, 164
Offset: 1

Views

Author

Keywords

Comments

This sequence lists the values of A000404(n)/2 when A000404(n) is an even number. In other words, sequence lists integers n that are the average of two nonzero squares. - Altug Alkan, May 26 2016

Crossrefs

Cf. A000404, subsequence of A001481, A004435 (complement), A025435, A004431.
Union of A000290 and A004431 excluding 0.

Programs

  • Haskell
    a001983 n = a001983_list !! (n-1)
    a001983_list = [x | x <- [0..], a025435 x > 0]
    -- Reinhard Zumkeller, Dec 20 2013
    
  • Mathematica
    upto=200;max=Floor[Sqrt[upto]];s=Total/@((Subsets[Range[0,max], {2}])^2);Union[Select[s,#<=upto&]]  (* Harvey P. Dale, Apr 01 2011 *)
    selQ[n_] := Select[ PowersRepresentations[n, 2, 2], 0 <= #[[1]] < #[[2]] &] != {}; Select[Range[200], selQ] (* Jean-François Alcover, Oct 03 2013 *)
  • PARI
    list(lim)=my(v=List()); for(x=0,sqrtint(lim\4), for(y=x+1, sqrtint(lim\1-x^2), listput(v, x^2+y^2))); Set(v) \\ Charles R Greathouse IV, Feb 07 2017

Formula

A025435(a(n)) > 0. - Reinhard Zumkeller, Dec 20 2013

A004435 Positive integers that are not the sum of 2 distinct square integers.

Original entry on oeis.org

2, 3, 6, 7, 8, 11, 12, 14, 15, 18, 19, 21, 22, 23, 24, 27, 28, 30, 31, 32, 33, 35, 38, 39, 42, 43, 44, 46, 47, 48, 51, 54, 55, 56, 57, 59, 60, 62, 63, 66, 67, 69, 70, 71, 72, 75, 76, 77, 78, 79, 83, 84, 86, 87, 88, 91
Offset: 1

Views

Author

Keywords

Comments

A025435(a(n)) = 0. - Reinhard Zumkeller, Dec 20 2013

Crossrefs

Cf. A001983 (complement).

Programs

  • Haskell
    a004435 n = a004435_list !! (n-1)
    a004435_list = [x | x <- [1..], a025435 x == 0]
    -- Reinhard Zumkeller, Dec 20 2013
  • Mathematica
    Select[Range[100], Reduce[0 <= i < j && # == i^2 + j^2, {i, j}, Integers] === False &] (* Jean-François Alcover, Aug 01 2018 *)

A259285 Expansion of psi(x^2) * f(x, x^7) in powers of x where psi(), f(,) are Ramanujan theta functions.

Original entry on oeis.org

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

Views

Author

Michael Somos, Jun 23 2015

Keywords

Comments

Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).

Examples

			G.f. = 1 + x + x^2 + x^3 + x^6 + 2*x^7 + x^9 + x^10 + 2*x^12 + 2*x^13 + ...
G.f. = q^13 + q^29 + q^45 + q^61 + q^109 + 2*q^125 + q^157 + q^173 + ...
		

Crossrefs

Programs

  • Mathematica
    a[ n_] := SeriesCoefficient[ QPochhammer[ -x^1, x^8] QPochhammer[ -x^2, x^8] QPochhammer[ -x^6, x^8] QPochhammer[ -x^7, x^8] QPochhammer[x^8]^2, {x, 0, n}];
    a[ n_] := SeriesCoefficient[ Product[ (1 + x^(8 k - 1)) (1 + x^(8 k - 2)) (1 + x^(8 k - 6)) (1 + x^(8 k - 7)) (1 - x^(8 k))^2, {k, Ceiling[n/8]}], {x, 0, n}];
  • PARI
    {a(n) = my(m, s, x, c); if( n<0, 0, s = sqrtint(m = 16*n + 13); for(u = (s+3)\-8, (s-3)\8, if( issquare( m - (8*u + 3)^2, &x) && (x%8==2 || x%8==6), c++))); c};
    
  • PARI
    {a(n) = if( n<0, 0, polcoeff( prod(k=1, n, (1 - x^k)^[ 2, -1, 0, 0, 1, 0, -1, -1, 2, -1, -1, 0, 1, 0, 0, -1][k%16 + 1], 1 + x * O(x^n)), n))};

Formula

Number of solutions to 16*n + 13 = (8*u + 3)^2 + (8*v + 2)^2 where u,v in Z.
Euler transform of period 16 sequence [ 1, 0, 0, -1, 0, 1, 1, -2, 1, 1, 0, -1, 0, 0, 1, -2, ...].
a(9*n + 2) = A259287(n). a(9*n + 5) = a(9*n + 8) = 0.
-2 * a(n) = A134343(4*n + 3). a(n) = A000161(16*n + 13) = A025426(16*n + 13) = A025435(16*n + 13) = A025441(16*n + 13).

A259287 Expansion of psi(x^2) * f(x^3, x^5) in powers of x where psi(), f(, ) are Ramanujan theta functions.

Original entry on oeis.org

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

Views

Author

Michael Somos, Jun 23 2015

Keywords

Comments

Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).

Examples

			G.f. = 1 + x^2 + x^3 + 2*x^5 + x^6 + x^7 + x^9 + x^11 + x^12 + x^14 + ...
G.f. = q^5 + q^37 + q^53 + 2*q^85 + q^101 + q^117 + q^149 + q^181 + q^197 + ...
		

Crossrefs

Programs

  • Mathematica
    a[ n_] := SeriesCoefficient[ QPochhammer[ -x^2, x^8] QPochhammer[ -x^3, x^8] QPochhammer[ -x^5, x^8] QPochhammer[ -x^6, x^8] QPochhammer[x^8]^2, {x, 0, n}];
    a[ n_] := SeriesCoefficient[ Product[(1 + x^(8 k - 2)) (1 + x^(8 k - 3)) (1 + x^(8 k - 5)) (1 + x^(8 k - 6)) (1 - x^(8 k))^2, {k, Ceiling[n/8]}], {x, 0, n}];
  • PARI
    {a(n) = my(m, s, x, c); if( n<0, 0, s = sqrtint(m = 16*n + 5); for(u = (s+1)\-8, (s-1)\8, if( issquare( m - (8*u + 1)^2, &x) && (x%8==2 || x%8==6), c++))); c};
    
  • PARI
    {a(n) = if( n<0, 0, polcoeff( prod(k=1, n, (1 - x^k)^[ 2, 0, -1, -1, 1, -1, 0, 0, 2, 0, 0, -1, 1, -1, -1, 0][k%16 + 1], 1 + x * O(x^n)), n))};

Formula

Number of solutions to 16*n + 5 = (8*u + 1)^2 + (8*v + 2)^2 where u,v in Z.
Euler transform of period 16 sequence [ 0, 1, 1, -1, 1, 0, 0, -2, 0, 0, 1, -1, 1, 1, 0, -2, ...].
a(9*n + 1) = a(9*n + 4) = 0. a(9*n + 7) = A259285(n).
-2 * a(n) = A134343(4*n + 1). a(n) = A000161(16*n + 5) = A025426(16*n + 5) = A025435(16*n + 5) = A025441(16*n + 5).

A317682 Number of partitions of n into a prime and two distinct squares.

Original entry on oeis.org

0, 0, 0, 1, 1, 0, 2, 2, 2, 1, 1, 2, 4, 1, 2, 3, 3, 2, 4, 2, 4, 3, 4, 4, 4, 1, 2, 6, 6, 3, 5, 3, 6, 5, 3, 2, 7, 3, 5, 7, 4, 4, 8, 5, 6, 5, 5, 7, 9, 3, 4, 6, 7, 6, 9, 5, 8, 9, 6, 4, 9, 3, 6, 11, 6, 5, 10, 7, 10, 8, 8, 8, 12, 5, 5, 8, 10, 9, 11, 6, 7
Offset: 0

Views

Author

R. J. Mathar, Michel Marcus, Aug 04 2018

Keywords

Comments

As in A025435, zero is a valid square here.

Examples

			a(12)=4 counts 12 = 11 + 0^2 + 1^2 = 3 + 0^2 + 3^2 = 7 + 1^2 + 2^2 = 2 + 1^2 + 3^2.
		

Crossrefs

Programs

  • Maple
    A317682 := proc(n)
        a := 0 ;
        p := 2;
        while p < n do
            a := a+A025435(n-p);
            p := nextprime(p) ;
        end do:
        a ;
    end proc:
  • Mathematica
    A025435[n_] := Length[ PowersRepresentations[n, 2, 2]] - Boole[ IntegerQ[ Sqrt[2n]]];
    a[n_] := Module[{s = 0, p}, For[p = 2, p <= n-1, p = NextPrime[p], s += A025435[n-p]]; s];
    a /@ Range[0, 100] (* Jean-François Alcover, Apr 07 2020 *)
  • PARI
    A317682(n,s=0)={forprime(p=2,n-1,s+=A025435(n-p));s} \\ M. F. Hasler, Aug 05 2018

Formula

a(n) = Sum_{primes p} A025435(n-p).

A347534 Number of partitions of n into at most 3 distinct squares.

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Sep 08 2021

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := IntegerPartitions[n, 3, Select[Range[n], IntegerQ@Sqrt[#]&]] // Select[#, Union[#] == Sort[#]&]& // Length;
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Sep 13 2021 *)

Formula

a(n) = Sum_{k=0..3} A341040(n,k). - Alois P. Heinz, Sep 08 2021

A369768 Numbers X such that X^2 + Y^2 = 3^(2*k) + 1 and X > Y > 0 and k is the ternary digit length of X-1.

Original entry on oeis.org

3, 9, 21, 27, 71, 81, 195, 233, 243, 711, 729, 1583, 1749, 2157, 2187, 6561, 14829, 15747, 19629, 19683, 57609, 59049, 141717, 154727, 175537, 177147, 385559, 394471, 414649, 422729, 446489, 462601, 468919, 482759, 488431, 504161, 515649, 524559, 529599, 530529
Offset: 1

Views

Author

A.H.M. Smeets, Jan 31 2024

Keywords

Comments

The number of terms for a given k is A025435(3^(2*k)+1).

Crossrefs

Cf. A369703 (base 2), this sequence (base 3), A369769 (base 5), A368418 (base 10).

A369769 Numbers X such that X^2 + Y^2 = 5^(2*k) + 1 and X > Y > 0 and k is the quintal digit length of X-1.

Original entry on oeis.org

5, 25, 115, 125, 551, 625, 2551, 2885, 3049, 3125, 15575, 15625, 72115, 78125, 303551, 390625, 1461799, 1790635, 1802885, 1847551, 1857449, 1946801, 1952875, 1953125, 8053505, 8468945, 9734425, 9765625, 36631645, 43890449, 45072115, 48828125, 215049449, 215418199
Offset: 1

Views

Author

A.H.M. Smeets, Jan 31 2024

Keywords

Comments

The number of terms for a given k is A025435(5^(2*k)+1).

Crossrefs

Cf. A025435.
Cf. A369703 (base 2), A369768 (base 3), this sequence (base 5), A368418 (base 10).

A357069 Number of partitions of n into at most 4 distinct positive squares.

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Oct 25 2022

Keywords

Crossrefs

Formula

a(n) = Sum_{k=0..4} A341040(n,k). - Alois P. Heinz, Oct 25 2022
Showing 1-10 of 10 results.