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.

A085317 Primes which are the sum of three nonzero squares.

Original entry on oeis.org

3, 11, 17, 19, 29, 41, 43, 53, 59, 61, 67, 73, 83, 89, 97, 101, 107, 109, 113, 131, 137, 139, 149, 157, 163, 173, 179, 181, 193, 197, 211, 227, 229, 233, 241, 251, 257, 269, 277, 281, 283, 293, 307, 313, 317, 331, 337, 347, 349, 353, 373, 379, 389, 397, 401
Offset: 1

Views

Author

Labos Elemer, Jul 01 2003

Keywords

Comments

This sequence consists of the primes p (not 5, 13, or 37) such that p == 1, 3 or 5 (mod 8). The density of these primes is 0.75. - T. D. Noe, May 21 2004
Primes of the form a^2 + b^2 + c^2 with 1 <= a <= b <= c. - Zak Seidov, Nov 08 2013

Examples

			101 is a term since 101 = 64 + 36 + 1 = 8^2 + 6^2 + 1^2.
		

Crossrefs

Cf. A000408.
Cf. A094712 (primes that are not the sum of three positive squares).
Cf. A094713 (number of ways that prime(n) can be represented as a^2+b^2+c^2 with a >= b >= c > 0).

Programs

  • Mathematica
    lst={}; lim=32; Do[n=a^2+b^2+c^2; If[nHarvey P. Dale, Jun 18 2022 *)

A094713 Number of ways that prime(n) can be represented as a^2+b^2+c^2 with c >= b >= a > 0.

Original entry on oeis.org

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

Views

Author

T. D. Noe, May 21 2004

Keywords

Examples

			a(13) = 2 because prime(13) = 41 = 1+4+36 = 9+16+16.
		

Crossrefs

Cf. A085317 (primes that are the sum of three positive squares), A094712 (primes that are not the sum of three positive squares), A094714 (least prime having exactly n representations as the sum of three positive squares).

Programs

  • Mathematica
    lim=25; pLst=Table[0, {PrimePi[lim^2]}]; Do[n=a^2+b^2+c^2; If[n?(Min[#]>0&)],{n,110}]  (* _Harvey P. Dale, Feb 17 2011 *)

A164098 Numbers of the form m * (k_1^2 + k_2^2 + ... + k_m^2).

Original entry on oeis.org

1, 4, 9, 10, 16, 18, 20, 25, 26, 27, 28, 33, 34, 36, 40, 42, 48, 49, 50, 51, 52, 54, 55, 57, 58, 60, 63, 64, 65, 66, 68, 70, 72, 74, 76, 78, 80, 81, 82, 84, 85, 87, 88, 90, 91, 92, 95, 99, 100, 102, 104, 105, 106, 108, 110, 112, 114, 115, 116, 120, 121, 122, 123, 124, 125
Offset: 1

Views

Author

Jonas Wallgren, Aug 10 2009, Aug 17 2009

Keywords

Comments

From Franklin T. Adams-Watters, Aug 29 2009: (Start)
The k_i must all be positive integers.
Note that every integer > 33 is the sum of 5 positive squares, and for n > 5, every integer > n+13 is the sum of n positive squares. (End)
The complement of this sequence includes: A000040, A037074, A143206, 2 * A002145, and 3 * A094712. - Robert Israel, Jan 27 2025

Examples

			34 = 2*(4^2 + 1^2), 42 = 3*(3^2 + 2^2 + 1^2), thus 34 and 42 are in the sequence.
		

Crossrefs

Programs

  • Maple
    g:= proc(y,m)
      # can we write y as sum of m positive squares?
       option remember;
       local x;
       if y < m then return false fi;
       if m = 1 then return issqr(y) fi;
       if issqr(y-m+1) then return true fi;
       for x from 1 while x^2 + m-1 < y do
         if procname(y-x^2,m-1) then return true fi
       od;
       false
    end proc:
    filter:= proc(n)
      ormap(t -> g(n/t, t), numtheory:-divisors(n))
    end proc:
    select(filter, [$1..1000]); # Robert Israel, Jan 26 2025
  • PARI
    issumsqs(n,k) = if(n<=0||k<=0,return(k==0&&n==0)); forstep(j=sqrtint(n),max(sqrtint(n\k),1),-1,if(issumsqs(n-j^2,k-1),return(1)));0
    isa(n)=local(ds);ds=divisors(n);for(k=1,(#ds+1)\2,if(issumsqs(n\ds[k],ds[k]),return(1)));0
    for(n=1,200,if(isa(n),print1(n","))) \\ Franklin T. Adams-Watters, Aug 29 2009

Extensions

More terms from Franklin T. Adams-Watters, Aug 29 2009
Showing 1-3 of 3 results.