login
Numbers whose sum and product of digits are cubes.
1

%I #30 Sep 08 2022 08:46:23

%S 0,1,8,10,80,100,107,170,206,260,305,350,404,440,503,530,602,620,701,

%T 710,800,999,1000,1007,1016,1025,1034,1043,1052,1061,1070,1106,1124,

%U 1142,1160,1205,1214,1241,1250,1304,1340,1403,1412,1421,1430,1502,1520,1601,1610,1700

%N Numbers whose sum and product of digits are cubes.

%C The first numbers in the sequence that are cubes themselves are 0,1,8,1000,8000.

%C a(22)=999 is the only term up to n=120 related to the cube 27 (the previous ones relate to 0,1,8).

%C Also, a(22)=999 is the first term that has more than one digit and consists of a single repeated digit; the next ones are 11111111 and 333333333.

%H Robert Israel, <a href="/A321881/b321881.txt">Table of n, a(n) for n = 1..10000</a>

%e 93111111111111111 (15 ones) is in the sequence since the sum and the product of the digits is 27 (a cube).

%e 333 is not in the sequence since the product of the digits is 27 but the sum is 9 (not a cube).

%p filter:= proc(n) local L;

%p L:= convert(n,base,10);

%p simplify(convert(L,`+`)^(1/3))::integer and

%p simplify(convert(L,`*`)^(1/3))::integer;

%p end proc:

%p select(filter, [$0..1000]); # _Robert Israel_, Jan 21 2019

%t cubeQ[n_] := IntegerQ[Surd[n, 3]]; aQ[n_] := cubeQ[Plus @@ IntegerDigits[n]] &&

%t cubeQ[Times @@ IntegerDigits[n]]; Select[Range[0, 3000], aQ] (* _Amiram Eldar_, Nov 20 2018 *)

%o (PARI) isok(n) = my(d=digits(n)); ispower(vecsum(d), 3) && ispower(vecprod(d), 3); \\ _Michel Marcus_, Nov 29 2018

%o (Magma) [n:n in [0..2000]| IsPower((&+Intseq(n)), 3) and IsPower((&*Intseq(n)), 3)] // _Marius A. Burtea_, Jan 21 2019

%Y Cf. A007953, A046031, A062398, A070276, A059094, A237767.

%K nonn,base

%O 1,3

%A _Enrique Navarrete_, Nov 20 2018