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 51-60 of 65 results. Next

A317684 Number of partitions of n into a prime and two squares.

Original entry on oeis.org

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

Views

Author

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

Keywords

Comments

As in A000161, the squares may be zero and do not need to be distinct.

Examples

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

Crossrefs

Programs

  • Maple
    A317684 := proc(n)
        a := 0 ;
        p := 2;
        while p <= n do
            a := a+A000161(n-p);
            p := nextprime(p) ;
        end do:
        a ;
    end proc:

Formula

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

A356208 a(n) is the number of occurrences of n in A133388.

Original entry on oeis.org

2, 3, 4, 4, 5, 7, 6, 8, 8, 9, 9, 10, 10, 12, 13, 12, 12, 15, 14, 17, 16, 16, 17, 18, 19, 18, 19, 20, 18, 24, 20, 22, 25, 22, 27, 26, 23, 25, 25, 29, 26, 30, 27, 31, 32, 32, 24, 33, 33, 34, 32, 32, 35, 37, 36, 37, 38, 32, 35, 44, 36, 41, 41, 40, 42, 45, 39, 43, 42
Offset: 1

Views

Author

Hugo Pfoertner, Sep 07 2022

Keywords

Crossrefs

Programs

  • Python
    from sympy.solvers.diophantine.diophantine import diop_DN
    def A356208(n): return sum(1 for m in range(1,(n**2<<1)+1) if n==max((a for a, b in diop_DN(-1,m)),default=0)) # Chai Wah Wu, Sep 08 2022

A356209 a(n) is the position of the latest occurrence of n in A133388.

Original entry on oeis.org

2, 8, 18, 32, 41, 72, 98, 128, 162, 181, 242, 288, 313, 392, 421, 512, 514, 648, 722, 761, 882, 968, 1058, 1152, 1201, 1301, 1458, 1568, 1466, 1741, 1922, 2048, 2178, 2056, 2381, 2592, 2594, 2888, 2817, 3121, 3202, 3528, 3698, 3872, 3789, 4232, 4418, 4608, 4802, 4804, 5101
Offset: 1

Views

Author

Hugo Pfoertner, Sep 07 2022

Keywords

Crossrefs

Programs

  • Python
    from sympy.solvers.diophantine.diophantine import diop_DN
    def A356209(n):
        for m in range(n**2<<1,0,-1):
            if n==max((a for a, b in diop_DN(-1,m)),default=0):
                return m # Chai Wah Wu, Sep 08 2022

Formula

a(k) = 2*k^2 for k not in A009003.

A073092 Number of numbers of the form x^2 + y^2 (0 <= x <= y) less than or equal to n.

Original entry on oeis.org

1, 2, 3, 3, 4, 5, 5, 5, 6, 7, 8, 8, 8, 9, 9, 9, 10, 11, 12, 12, 13, 13, 13, 13, 13, 15, 16, 16, 16, 17, 17, 17, 18, 18, 19, 19, 20, 21, 21, 21, 22, 23, 23, 23, 23, 24, 24, 24, 24, 25, 27, 27, 28, 29, 29, 29, 29, 29, 30, 30, 30, 31, 31, 31, 32, 34, 34, 34, 35, 35, 35, 35, 36, 37, 38
Offset: 0

Views

Author

Benoit Cloitre, Aug 18 2002

Keywords

Examples

			0^2 + 0^2, 0^2 + 1^2, 1^2 + 1^2 are less than or equal to 2 hence a(2) = 3.
		

Crossrefs

Programs

  • Mathematica
    Accumulate @ Table[Length @ PowersRepresentations[n, 2, 2], {n, 0, 100}] (* Amiram Eldar, Mar 08 2020 *)
  • PARI
    a(n)=sum(x=0,n,sum(y=0,x,if((sign(x^2+y^2-n)+1)*sign(x^2+y^2-n),0,1)))
    
  • Python
    from itertools import count, islice
    from math import prod
    from sympy import factorint
    def A073092_gen(): # generator of terms
        yield (c:=1)
        for n in count(1):
            f = factorint(n)
            c += int(not any(e&1 for e in f.values())) + (((m:=prod(1 if p==2 else (e+1 if p&3==1 else (e+1)&1) for p, e in f.items()))+((((~n & n-1).bit_length()&1)<<1)-1 if m&1 else 0))>>1)
            yield c
    A073092_list = list(islice(A073092_gen(),30)) # Chai Wah Wu, Sep 08 2022

Formula

a(n) = Sum_{k=0..n} A000161(k).
a(n) is asymptotic to Pi*n/8.

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

Original entry on oeis.org

25, 50, 65, 85, 100, 125, 130, 145, 169, 170, 185, 200, 205, 221, 225, 250, 260, 265, 289, 290, 305, 338, 340, 365, 370, 377, 400, 410, 442, 445, 450, 481, 485, 493, 500, 505, 520, 530, 533, 545, 565, 578, 580, 585, 610, 629, 676, 680, 685, 689, 697, 730
Offset: 1

Views

Author

Hugo Pfoertner, Jul 09 2003

Keywords

Comments

Wells erroneously writes that this sequence begins as 50, 65, 85, 145, ... . - Stefano Spezia, Sep 07 2024

Examples

			a(3) = 65 because 65 = 8^2 + 1^2 = 7^2 + 4^2;
a(4) = 85 because 85 = 9^2 + 2^2 = 7^2 + 6^2.
		

References

  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See p. 125.

Crossrefs

Programs

  • Mathematica
    Select[Range[730], Length[PowersRepresentations[#,2,2]]==2 &] (* Stefano Spezia, Sep 07 2024 *)

Formula

n such that A000161(n) = 2.

A088918 Number of representations of n as sum of two squares of distinct primes.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Oct 23 2003

Keywords

Comments

a(n) <= A000161(n); a(A088909(n)) > 0;
a(A088919(n)) = n and a(k) <> n for k < A088919(n).

Examples

			a(410)=2, see A088919.
		

Crossrefs

Cf. A002654.

A116852 Number of partitions of n-th semiprime into 2 squares.

Original entry on oeis.org

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

Views

Author

Jonathan Vos Post, Mar 15 2006

Keywords

Comments

See also A000161 Number of partitions of n into 2 squares (when order does not matter and zero is allowed).
From Robert Israel, Jun 10 2020: (Start)
a(1)=1 if A001358(n) = p^2 where p is not in A002144.
a(n)=1 if A001358(n) = 2*p where p is in A002144.
a(n)=2 if A001358(n) = p*q where p and q are in A002144 (not necessarily distinct).
a(n)=0 otherwise. (End)

Examples

			a(1) = 1 because semiprime(1) = 4 = 0^2 + 2^2, the unique sum of squares.
a(2) = 0 because semiprime(2) = 6 has no decomposition into sum of 2 squares because it has a prime factor p == 3 (mod 4) with an odd power.
a(3) = 1 because semiprime(3) = 9 = 0^2 + 3^2, the unique sum of squares.
a(4) = 1 because semiprime(4) = 10 = 2*5 = 1^2 + 3^2.
a(9) = 2 because semiprime(9) = 25 = 0^2 + 5^2 = 3^2 + 4^2, two distinct ways.
a(23) = 2 because semiprime(23) = 65 = 5*13 = 1^2 + 8^2 = 4^2 + 7^2.
a(28) = 2 because semiprime(28) = 85 = 5*17 = 2^2 + 9^2 = 6^2 + 7^2.
a(49) = 2 because semiprime(49) = 145 = 5*29 = 1^2 + 12^2 = 8^2 + 9^2.
a(56) = 2 because semiprime(56) = 169 = 0^2 + 13^2 = 5^2 + 12^2.
a(60) = 2 because semiprime(60) = 185 = 5*37 = 4^2 + 13^2 = 8^2 + 11^2.
		

Crossrefs

Programs

  • Maple
    R:= NULL: count:= 0:
    for n from 4 while count < 100 do
      if numtheory:-bigomega(n) = 2 then
        count:= count+1;
        F:= ifactors(n)[2];
        if nops(F) = 1 then
          if F[1][1] mod 4 = 1 then v:= 2
          else v:= 1
          fi
        elif F[1][1]=2 and F[2][1] mod 4 = 1 then v:= 1
        elif F[1][1] mod 4 = 1 and F[2][1] mod 4 = 1 then v:= 2
        else v:= 0
        fi;
        R:= R, v;
      fi
    od:
    R; # Robert Israel, Jun 10 2020

Formula

a(n) = A000161(A001358(n)).

Extensions

More terms from Giovanni Resta, Jun 15 2016

A171099 a(n) = number of solutions (x,y) (with 0 <= x <= y) to x*(x+1)/2 + y*(y+1)/2 = n!.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 0, 1, 1, 1, 2, 0, 0, 1, 0, 2, 1, 2, 0, 0, 0, 2, 0, 0, 2, 0, 0, 8, 1, 2, 0, 0, 4, 4, 16, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 1, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 2, 0, 16, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 16, 2, 4, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

N. J. A. Sloane, Sep 24 2010, based on a posting by R. K. Guy to the Sequence Fans Mailing List, Sep 10 2010

Keywords

Examples

			Initial solutions: (x,y,n) = (0,1,0), (0,1,1), (1,1,2), (0,3,3), (2,2,3), (2,6,4), (0,15,5), (5,14,5), (45,89,7), (89,269,8), (210,825,9), (760,2610,10), (1770,2030,10), none for n = 11 or 12, one for n = 13 (71504,85680,13) (found by _Ed Pegg Jr_), etc.
		

Crossrefs

Cf. A000161, A152089 (n for which no solutions exist), A180590 (n for which solutions exist).

Formula

a(n) = A000161(8*n! + 2). - Max Alekseyev, Dec 12 2011

Extensions

Corrected and extended (with data from Georgi Guninski, at the suggestion of N. J. A. Sloane) by D. S. McNeil, Sep 26 2010

A173256 Partial sums of A001481.

Original entry on oeis.org

0, 1, 3, 7, 12, 20, 29, 39, 52, 68, 85, 103, 123, 148, 174, 203, 235, 269, 305, 342, 382, 423, 468, 517, 567, 619, 672, 730, 791, 855, 920, 988, 1060, 1133, 1207, 1287, 1368, 1450, 1535, 1624, 1714, 1811, 1909, 2009, 2110, 2214, 2320, 2429, 2542, 2658, 2775
Offset: 1

Views

Author

Jonathan Vos Post, Feb 14 2010

Keywords

Comments

The subsequence of primes in this sequence begins 3, 7, 29, 103, 269, 619, 1811, 3271.

Examples

			a(66) = 0 + 1 + 2 + 4 + 5 + 8 + 9 + 10 + 13 + 16 + 17 + 18 + 20 + 25 + 26 + 29 + 32 + 34 + 36 + 37 + 40 + 41 + 45 + 49 + 50 + 52 + 53 + 58 + 61 + 64 + 65 + 68 + 72 + 73 + 74 + 80 + 81 + 82 + 85 + 89 + 90 + 97 + 98 + 100 + 101 + 104 + 106 + 109 + 113 + 116 + 117 + 121 + 122 + 125 + 128 + 130 + 136 + 137 + 144 + 145 + 146 + 148 + 149 + 153 + 157 + 160 = 4876.
		

Crossrefs

Programs

  • Maple
    N:= 1000:
    A001481:= sort(convert({seq(seq(x^2+y^2, y=0..floor(sqrt(N-x^2))),x=0..floor(sqrt(N)))},list)):
    ListTools:-PartialSums(A001481); # Robert Israel, Mar 15 2016
  • Python
    from itertools import count, accumulate, islice
    from sympy import factorint
    def A173256_gen(): # generator of terms
        return accumulate(filter(lambda n:all(p & 3 != 3 or e & 1 == 0 for p, e in factorint(n).items()),count(0)))
    A173256_list = list(islice(A173256_gen(),30)) # Chai Wah Wu, Jun 27 2022

Formula

a(n) = Sum_{i=1..n} A001481(i) = Sum_{i=1..n} (numbers that are the sum of 2 nonnegative squares) = Sum_{i=1..n} (numbers n such that i = x^2 + y^2 has a solution in nonnegative integers x, y).

Extensions

a(21) corrected by Robert Israel, Mar 15 2016

A181570 Primes in A050798.

Original entry on oeis.org

7, 13, 17, 23, 31, 37, 41, 53, 67, 89, 97, 103, 109, 113, 127, 137, 149, 151, 163, 167, 179, 197, 211, 223, 227, 229, 241, 263, 269, 277, 281, 283, 311, 331, 347, 359, 367, 373, 383, 389, 397, 419, 431, 433, 439, 479, 491, 503, 509, 541, 547, 587, 601, 617, 619, 653, 673, 677, 683, 691, 709
Offset: 1

Views

Author

Jonathan Vos Post, Jan 29 2011

Keywords

Comments

Primes p such that p^2 + 1 is expressible as the sum of two nonzero squares in exactly two ways.

Crossrefs

Formula

A050798 INTERSECTION A000040. {p in A000040 such that A000161(p^2 + 1) = 2}.
Previous Showing 51-60 of 65 results. Next