login
Numbers that are the sum of 3 positive cubes in exactly 3 ways.
9

%I #31 Jul 31 2021 23:41:24

%S 5104,9729,12104,12221,12384,14175,17604,17928,19034,20691,21412,

%T 21888,24480,28792,29457,30528,31221,32850,34497,35216,36288,38259,

%U 39339,39376,40060,40097,40832,40851,41033,41040,41364,41966,42056,42687,43408,45144

%N Numbers that are the sum of 3 positive cubes in exactly 3 ways.

%H Donovan Johnson, <a href="/A025397/b025397.txt">Table of n, a(n) for n = 1..10000</a>

%F n such that A025456(n) = 3. - _Robert Israel_, Aug 28 2015

%p N:= 10^5: # to get all terms <= N

%p Reps:= Matrix(N,3,(i,j) -> {}):

%p for i from 1 to floor(N^(1/3)) do

%p Reps[i^3,1]:= {[i]}

%p od:

%p for j from 2 to 3 do

%p for i from 1 to floor(N^(1/3)) do

%p for x from i^3+1 to N do

%p Reps[x,j]:= Reps[x,j] union

%p map(t -> if t[-1] <= i then [op(t),i] fi, Reps[x-i^3,j-1]);

%p od

%p od

%p od:

%p select(t -> nops(Reps[t,3])=3, [$1..N]); # _Robert Israel_, Aug 28 2015

%t Reap[ For[ n = 1, n <= 50000, n++, pr = Select[ PowersRepresentations[n, 3, 3], Times @@ # != 0 &]; If[pr != {} && Length[pr] == 3, Print[n, pr]; Sow[n]]]][[2, 1]] (* _Jean-François Alcover_, Jul 31 2013 *)

%o (PARI) is(n)=k=ceil((n-2)^(1/3)); d=0; for(a=1, k, for(b=a, k, for(c=b, k, if(a^3+b^3+c^3==n, d++)))); d

%o n=3; while(n<50000, if(is(n)==3, print1(n, ", ")); n++) \\ _Derek Orr_, Aug 27 2015

%Y Cf. A008917, A025323, A025396, A025398, A025405, A025456, A343969, A344240, A344804.

%K nonn

%O 1,1

%A _David W. Wilson_