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.

A138854 Numbers which are the sum of three cubes of distinct primes.

Original entry on oeis.org

160, 378, 476, 495, 1366, 1464, 1483, 1682, 1701, 1799, 2232, 2330, 2349, 2548, 2567, 2665, 3536, 3555, 3653, 3871, 4948, 5046, 5065, 5264, 5283, 5381, 6252, 6271, 6369, 6587, 6894, 6992, 7011, 7118, 7137, 7210, 7229, 7235, 7327, 7453, 8198, 8217, 8315
Offset: 1

Views

Author

M. F. Hasler, Apr 13 2008

Keywords

Comments

This is a subsequence of A024975. The odd terms of this sequence are A138853, the even terms are 8+{ even terms of A120398 }. Thus primes in this sequence, A137365, are the same as primes in A138853.

Crossrefs

Cf. A024975 (a^3+b^3+c^3, a>b>c>0), A138853 (odd terms of this), A120398, A137365 (primes in A138853 / A138854).

Programs

  • Maple
    isA030078 := proc(n)
        local f ;
        if n < 8 then
            false;
        else
            f := ifactors(n)[2] ;
            if nops(f) = 1 and op(2,op(1,f)) = 3 then
                true;
            else
                false;
            end if;
        end if;
    end proc:
    isA138854 := proc(n)
        local i,j,p,q,r,rcub ;
        for i from 1 do
            p := ithprime(i) ;
            if p^3+(p+1)^3+(p+2)^3 > n then
                return false;
            end if;
            for j from i+1 do
                q := ithprime(j) ;
                rcub := n-q^3-p^3 ;
                if rcub <= q^3 then
                    break;
                fi ;
                if isA030078(rcub) then
                    return true;
                end if;
            end do:
        end do:
    end proc:
    for n from 5 do
        if isA138854(n) then
            print(n);
        end if;
    end do: # R. J. Mathar, Jun 09 2014
  • Mathematica
    f[upto_]:=Module[{maxp=PrimePi[Floor[Power[upto, (3)^-1]]]}, Select[Union[Total/@(Subsets[Prime[Range[maxp]],{3}]^3)],#<=upto&]]; f[9000]  (* Harvey P. Dale, Mar 21 2011 *)
  • PARI
    isA138854(n)={ if( n%2, isA138853(n), isA120398(n-8)) }
    for( n=1,10^4, isA138854(n) & print1(n", "))

Formula

A138854 = { p(i)^3+p(j)^3+p(k)^3 ; i>j>k>0 } = A138853 union { p(i)^3+p(j)^3+8 ; i>j>1}

A137365 Prime numbers n such that n = p1^3 + p2^3 + p3^3, a sum of cubes of 3 distinct prime numbers.

Original entry on oeis.org

1483, 5381, 6271, 7229, 9181, 11897, 13103, 13841, 14489, 17107, 20357, 25747, 26711, 27917, 30161, 30259, 31247, 32579, 36161, 36583, 36677, 36899, 36901, 42083, 48817, 54181, 55511, 55691, 56377, 56897, 57637, 59093, 64151, 66347
Offset: 1

Views

Author

Keywords

Comments

Numbers n may have multiple decompositions; for example, n=185527 and n=451837 have two, and n=8627527 and n=32816503 have three. The smallest n with more than one decomposition is n = 185527 = 13^3+43^3+47^3 = 19^3+31^3+53^3, the 94th in the sequence. - R. J. Mathar, May 01 2008
Primes in A138853 and A138854. - M. F. Hasler, Apr 13 2008
The least prime, p, which has n decompositions {with its primes} is 1483 = {3, 5, 11}; 185527 = {13, 43, 47} & {19, 31, 53}; 8627527 = {19, 151, 173}, {33, 139, 181} & {71, 73, 199} and 1122871751 = {113, 751, 887}, {131, 701, 919}, {151, 659, 941} & {29, 107, 1039}. - Robert G. Wilson v, May 04 2008
The number of terms < 10^n: 0, 0, 0, 5, 56, 327, 2172, 13417, 86264, 567211, ..., . - Robert G. Wilson v, May 04 2008
The number of decompositions < 10^n: 0, 0, 0, 5, 56, 330, 2201, 13609, 87200, 571770, ..., . - Robert G. Wilson v, May 04 2008

Examples

			1483=3^3+5^3+11^3, 5381=17^3+7^3+5^3, 6271=3^3+11^3+17^3, etc.
		

Crossrefs

Cf. A137366.
Cf. A024975 (a^3+b^3+c^3, a>b>c>0), A122723 (primes in A024975), A138853-A138854.

Programs

  • Maple
    # From R. J. Mathar: (Start)
    isA030078 := proc(n) local cbr; cbr := floor(root[3](n)) ; if cbr^3 = n and isprime(cbr) then true ; else false; fi ; end:
    isA137365 := proc(n) local p1,p2,p3,p3cub ; if isprime(n) then p1 := 2 ; while p1^3 <= n-16 do p2 := nextprime(p1) ; while p1^3+p2^3 <= n-8 do p3cub := n-p1^3-p2^3 ; if p3cub> p2^3 and isA030078(p3cub) then RETURN(true) ; fi ; p2 := nextprime(p2) ; od: p1 := nextprime(p1) ; od; RETURN(false) ; else RETURN(false) ; fi ; end:
    for i from 1 do if isA137365( ithprime(i)) then printf("%d\n",ithprime(i)) ; fi ; od:
    # (End)
  • Mathematica
    Array[r, 99]; Array[y, 99]; For[i = 0, i < 10^2, r[i] = y[i] = 0; i++ ]; z = 4^2; n = 0; For[i1 = 1, i1 < z, a = Prime[i1]; a2 = a^3; For[i2 = i1 + 1, i2 < z, b = Prime[i2]; b2 = b^3; For[i3 = i2 + 1, i3 < z, c = Prime[i3]; c2 = c^3; p = a2 + b2 + c2; If[PrimeQ[p], Print[a2, " + ", b2, " + ", c2, " = ", p]; n++; r[n] = p]; i3++ ]; i2++ ]; i1++ ]; Sort[Array[r, 88]] (* Vladimir Joseph Stephan Orlovsky *)
    lst = {}; Do[p = Prime[q]^3 + Prime[r]^3 + Prime[s]^3; If[PrimeQ@ p, AppendTo[lst, p]], {q, 13}, {r, q - 1}, {s, r - 1}]; Take[Sort@ lst, 36] (* Robert G. Wilson v, Apr 13 2008 *)
    nn=20; lim=Prime[nn]^3+3^3+5^3; Union[Select[Total[#^3]& /@ Subsets[Prime[Range[2,nn]], {3}], #Harvey P. Dale, Jan 15 2011 *)
  • PARI
    c=0; forprime(p=1,10^6, isA138853(p) & write("b137365.txt",c++," ",p)) \\ M. F. Hasler, Apr 13 2008

Formula

A137365 = A000040 intersect A138853 = A000040 intersect A138854. - M. F. Hasler, Apr 13 2008

Extensions

Corrected and extended by Zak Seidov, R. J. Mathar and Robert G. Wilson v, Apr 12 2008
Further edits by R. J. Mathar and N. J. A. Sloane, Jun 07 2008

A137632 Sums of 2 cubes of distinct odd primes.

Original entry on oeis.org

152, 370, 468, 1358, 1456, 1674, 2224, 2322, 2540, 3528, 4940, 5038, 5256, 6244, 6886, 6984, 7110, 7202, 8190, 9056, 11772, 12194, 12292, 12510, 13498, 14364, 17080, 19026, 24416, 24514, 24732, 25720, 26586, 29302, 29818, 29916, 30134
Offset: 1

Views

Author

M. F. Hasler, Apr 13 2008

Keywords

Examples

			3^3 + 5^3 = 152 = a(1).
3^3 + 7^3 = 370 = a(2).
5^3 + 7^3 = 468 = a(3).
		

Crossrefs

A subset of A120398 and A086119. Cf. A138853, A138854.

Programs

  • Maple
    A137632 := proc(amax) local a,p,q; a := {} ; p := 3 ; while p^3 < amax do q := nextprime(p) ; while p^3+q^3 < amax do a := a union {p^3+q^3} ; q := nextprime(q) ; od: p := nextprime(p) ; od: sort(convert(a,list)) ; end: A137632(80000) ; # R. J. Mathar, May 04 2008
  • Mathematica
    f[upto_]:=Module[{max=Ceiling[Power[upto-27, (3)^-1]],prs}, prs=Prime[Range[2,max]]; Select[Union[Total/@(Subsets[prs,{2}]^3)], #<=upto&]]; f[31000] (* Harvey P. Dale, Apr 20 2011 *)

Extensions

More terms from R. J. Mathar, Apr 13 2008, May 04 2008
Showing 1-3 of 3 results.