A258865 Numbers that are a sum of the cubes of three primes.
24, 43, 62, 81, 141, 160, 179, 258, 277, 359, 375, 378, 397, 476, 495, 593, 694, 713, 811, 1029, 1347, 1366, 1385, 1464, 1483, 1581, 1682, 1701, 1799, 2017, 2213, 2232, 2251, 2330, 2349, 2447, 2548, 2567, 2665, 2670, 2689, 2787, 2883, 3005, 3536, 3555
Offset: 1
Keywords
Examples
2^3+2^3+2^3=24. 2^3+2^3+3^3=43. 2^3+3^3+3^3=62. 3^3+3^3+3^3=81.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Programs
-
Haskell
import Data.Set (singleton, deleteFindMin, fromList) import qualified Data.Set as Set (union) import qualified Data.List.Ordered as List (union) a258865 n = a258865_list !! (n-1) a258865_list = tail $ f (singleton 1) 1 [] [] a030078_list where f s z vs qcs pcs'@(pc:pcs) | m < z = m : f s' z vs qcs pcs' | otherwise = f (Set.union s $ fromList $ map (+ pc) ws) pc ws (pc:qcs) pcs where ws = List.union vs $ map (+ pc) (pc : qcs) (m, s') = deleteFindMin s -- Reinhard Zumkeller, Jun 13 2015
-
Maple
A258865 := proc(lim) local a,p,q,r ; a := {} ; p := 2 ; while p^3 < lim do q := p ; while p^3 +q^3< lim do r := q ; while p^3+q^3+r^3 <= lim do a := a union {p^3+q^3+r^3} ; r := nextprime(r) ; end do: q := nextprime(q) ; end do: p := nextprime(p) ; end do ; a ; end proc: A258865(30000) ;
-
Mathematica
lim = 15; Take[Sort@ DeleteDuplicates[Total /@ (Tuples[Prime@ Range@ lim, 3]^3)], 3 lim] (* Michael De Vlieger, Jun 12 2015 *)
-
PARI
list(lim)=my(v=List(), P=apply(p->p^3,primes(sqrtnint(lim\=1,3)))); foreach(P,p, foreach(P,q, my(s=p+q,t); for(i=1,#P, t=s+P[i]; if(t>lim,break); listput(v,t)))); Set(v) \\ Charles R Greathouse IV, Aug 09 2021
Formula
By a counting argument a(n) >> n log^3 n and hence the sequence is of density 0. - Charles R Greathouse IV, Aug 09 2021
Comments