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

A182479 Primes of the form p^2 + q^2 + r^2, where p,q,r are distinct primes.

Original entry on oeis.org

83, 179, 227, 347, 419, 467, 491, 563, 587, 659, 827, 971, 1019, 1091, 1259, 1427, 1499, 1667, 1811, 1907, 1979, 2027, 2243, 2267, 2339, 2531, 2579, 2699, 2819, 2843, 2939, 3347, 3539, 3659, 3779, 3851, 4019, 4091, 4259, 4451, 4523, 4547, 4691, 4787, 5099
Offset: 1

Views

Author

Alex Ratushnyak, May 01 2012

Keywords

Comments

All terms are congruent to 5 modulo 6. Smallest of primes p, q, r is always 3. - Zak Seidov, Jun 03 2014
The number of such representations of a prime of that form is A263723. - Jonathan Sondow and Robert G. Wilson v, Nov 02 2015

Examples

			5099 = 3^2 + 7^2 + 71^2.
		

Crossrefs

Cf. A137364 (the same with repetitions). - Zak Seidov, Jun 03 2014

Programs

  • Mathematica
    mx = 20; ps = Prime[Range[2, mx + 1]]; t = Table[ps[[i]]^2 + ps[[j]]^2 + ps[[k]]^2, {i, mx}, {j, i + 1, mx}, {k, j + 1, mx}]; Select[Union[Flatten[t]], # <= 34 + ps[[-1]]^2 && PrimeQ[#] &] (* T. D. Noe, May 01 2012 *)
  • PARI
    list(lim)=my(v=List(),t);lim\=1;forprime(p=7,sqrt(lim), forprime(q=5,min(sqrtint(lim-p^2-9),p-1), t=p^2+q^2;forprime(r=3,min(sqrtint(lim-t),q-1), if(isprime(t+r^2), listput(v,t+r^2))))); vecsort(Vec(v),,8)
    \\ Charles R Greathouse IV, May 01 2012

A353249 Primes that are the sum of the cubes of four primes, not necessarily distinct.

Original entry on oeis.org

89, 149, 367, 383, 503, 601, 1709, 2221, 2357, 4001, 4937, 5171, 6599, 6883, 7019, 7237, 7243, 7583, 9091, 10177, 11261, 11807, 14747, 15923, 16693, 17431, 24413, 24767, 25673, 26539, 27059, 30169, 32587, 34739, 43517, 48731, 51031, 51347, 53201, 53323, 53699, 54133, 59617
Offset: 1

Views

Author

Michel Marcus, Apr 08 2022

Keywords

Examples

			89 is a term because 2^3 + 3^3 + 3^3 + 3^3 = 89.
15923 is a term because 2^3 + 13^3 + 19^3 + 19^3 = 15923.
		

Crossrefs

Primes in A346917.
Cf. A123597.

Programs

  • Maple
    q:= proc(n, t) option remember; `if`(n=0, is(t=0), t>0 and
          ormap(p-> isprime(p) and q(n-p^3, t-1), [$2..iroot(n, 3)]))
        end:
    select(x-> isprime(x) and q(x, 4), [$1..60000])[];  # Alois P. Heinz, Apr 08 2022
  • Mathematica
    seq[max_] := Module[{s = Select[Range[Floor@Surd[max, 3]], PrimeQ]}, Select[Union[Plus @@@ (Tuples[s, 4]^3)], # <= max && PrimeQ[#] &]]; seq[60000] (* Amiram Eldar, Apr 08 2022 *)
  • PARI
    isok(p) = {if (isprime(p) && (p > 24), my(P=primes(primepi(sqrtn(p-24, 3)+1))); for (i=1, #P, for (j=i, #P, for (k=j, #P, for (n=k, #P, if (P[i]^3 + P[j]^3 + P[k]^3 + P[n]^3 == p, return (1)););););););}
Showing 1-2 of 2 results.