A181376 Total number of n-digit numbers requiring 2 positive cubes in their representation as a sum of cubes.
2, 7, 32, 161, 736, 3416, 15976, 74295, 345334, 1605089, 7455698, 34623338, 160759047, 746318897, 3464508951, 16081935250, 74648713406
Offset: 1
Examples
a(1) = 2 from 1+1=2, 1+8=9. a(2) = 7 from 8+8=16, 1+27=28, 35, 54, 65, 72, 91.
Links
- Eric W. Weisstein, MathWorld -- Waring's Problem.
Crossrefs
Cf. A003325.
Programs
-
Mathematica
Table[Length[c = Table[j^3, {j, (10^n - 1)^(1/3)}]; Select[Union[Flatten[Outer[Plus, c, c]]], IntervalMemberQ[Interval[{10^(n - 1), 10^n - 1}], #] &]], {n, 10}] (* Robert Price, Apr 18 2019 *)
-
PARI
a(n)=my(N=10^n, Nn=N/10, v=List(), x3, t); sum(x=sqrtnint(Nn\2,3), sqrtnint(N-1, 3), x3=x^3; sum(y=1, min(sqrtnint(N-x3, 3), x), t=x3+y^3; t>=Nn && !ispower(t, 3) && listput(v, t))); #vecsort(v, , 8) \\ Charles R Greathouse IV, Oct 16 2013
Extensions
a(6)-a(11) from Charles R Greathouse IV, Oct 16 2013
a(12) from Lars Blomberg, Jan 15 2014
a(13)-a(17) from Hiroaki Yamanouchi, Jul 13 2014
Comments