A038369
Numbers k such that k = (product of digits of k) * (sum of digits of k).
Original entry on oeis.org
144 belongs to the sequence because 1*4*4=16, 1+4+4=9 -> 16*9=144
- Alan Beardon, S.P numbers, The Mathematical Gazette, 83(496), 25-32 (1999).
- Alan Beardon, Sums and Products of Digits and SP Numbers, NRICH, University of Cambridge, 1998.
- Alan Beardon, Recent Developments on S.P. Numbers, NRICH, University of Cambridge, 1998-2011.
- E. Bussmann, S.P numbers in bases other than 10, The Mathematical Gazette, 85(503), 245-248 (2001).
- K. McLean, There are only three S.P numbers!, The Mathematical Gazette, 83(496), 32-38 (1999).
- S. Parameswaran, Numbers and their digits - a structural pattern, Note 81.24, The Mathematical Gazette, 81(491), 263-263 (1997).
- Eric Weisstein's World of Mathematics, Sum-Product Number.
- Eric Weisstein's World of Mathematics, Digit.
-
pdsdQ[n_]:=Module[{idn=IntegerDigits[n]},(Total[idn]Times@@idn)==n]; Select[Range[0,150],pdsdQ] (* Harvey P. Dale, Apr 23 2011 *)
-
is(n)=my(d=digits(n)); factorback(d)*vecsum(d)==n \\ Charles R Greathouse IV, Feb 06 2017
A062237
Numbers k which are (sum of digits of k) concatenated with (product of digits of k).
Original entry on oeis.org
0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 119, 1236, 19135, 19144, 261296, 3634992, 43139968
Offset: 1
1236 has sum of digits 12 and product of digits 36.
-
sdpdQ[n_]:=Module[{idn=IntegerDigits[n],s,p},s=Total[idn];p=Times@@idn;n==FromDigits[Join[IntegerDigits[s],IntegerDigits[p]]]]; Select[Range[44*10^6],sdpdQ] (* Harvey P. Dale, Nov 23 2024 *)
-
from math import prod
from sympy.utilities.iterables import multiset_permutations as mp
from itertools import count, islice, combinations_with_replacement as mc
def c(s):
d = list(map(int, s))
return sorted(s) == sorted(str(sum(d)) + str(prod(d)))
def ok(s):
d = list(map(int, s))
return s[0] != '0' and "".join(s) == str(sum(d)) + str(prod(d))
def nd(d): yield from ("".join(m) for m in mc("0123456789", d))
def b(): yield from (s for d in count(1) for s in nd(d) if c(s))
def a(): yield from (int("".join(p)) for s in b() for p in mp(s) if ok(p))
print(list(islice(a(), 16))) # Michael S. Branicky, Jun 30 2022
More terms from
David W. Wilson, Apr 28 2005; he reports on May 03 2005 that there are no further terms.
A066282
Numbers k such that k = (product of nonzero digits of k) * (sum of digits of k).
Original entry on oeis.org
0, 1, 135, 144, 1088
Offset: 1
(1+0+8+8) * (1*8*8) = 17*64 = 1088, so 1088 belongs to the sequence.
-
function a066282(a,b: integer); var n,k,j,p,d: integer; s: string; begin for n := a to b do s := itoa(n); k := 0; p := 1; for j := 0 to length(s) - 1 do d := atoi(s[j..j]); k := k + d; if d > 0 then p := p*d; end; end; if n = p*k then write(n,","); end; end; end; a066282(0,25000).
-
Do[ d = Sort[ IntegerDigits[n]]; While[ First[d] == 0, d = Drop[d, 1]]; If[n == Apply[ Plus, d] Apply[ Times, d], Print[n]], {n, 0, 5*10^7} ]
-
a066282(a,b) = local(n,k,q,p,d); for(n=a,b,k=0; p=1; q=n; while(q>0,d=divrem(q,10); q=d[1]; k=k+d[2]; p=p*max(1,d[2])); if(n==p*k,print1(n,", ")))
a066282(0,25000)
A023651
Numbers k such that (product of digits of k) * (sum of digits of k) = 2k.
Original entry on oeis.org
0, 2, 15, 24, 1575, 39366
Offset: 1
-
Do[ If[ 2n == Apply[ Times, IntegerDigits[n]] Apply[ Plus, IntegerDigits[n]], Print[n]], {n, 0, 10^7} ]
-
isok(n) = if(n, factorback(digits(n)), 0) * sumdigits(n) == 2*n \\ Mohammed Yaseen, Jul 22 2022
-
from math import prod
def s(n): return sum(map(int, str(n)))
def p(n): return prod(map(int, str(n)))
for n in range(0, 10**6):
if p(n)*s(n)==2*n:
print(n) # Mohammed Yaseen, Jul 22 2022
A366832
Numbers k such that k = (product of nonzero digits) * (sum of digits) for the digits of k in base 9.
Original entry on oeis.org
1, 12, 1536, 172032, 430080, 4014080
Offset: 1
430080 = 724856_9, (7+2+4+8+5+6)*(7*2*4*8*5*6) = 32*13440 = 430080.
-
Select[Range[5*10^6],Total[IntegerDigits[#,9]]*Fold[Times,1,IntegerDigits[#,9]]==#&] (* James C. McMahon, Jan 30 2024 *)
-
isok(k, b) = my(d=select(x->(x>0), digits(k,b))); vecprod(d)*vecsum(d) == k;
for (k=1, 10^7, if (isok(k, 9), print1(k, ", ")))
A367070
Numbers k such that k = (product of nonzero digits) * (sum of digits) for the digits of k in base 7.
Original entry on oeis.org
1, 16, 128, 250, 480, 864, 21600, 62208, 73728
Offset: 1
21600 = 116655_7, (1+1+6+6+5+5)*(1*1*6*6*5*5) = 24*900 = 21600.
-
Select[Range[7^7], #1 == Times @@ DeleteCases[#2, 0]*Total[#2] & @@ {#, IntegerDigits[#, 7]} &] (* Michael De Vlieger, Mar 25 2024 *)
-
isok(k, b) = my(d=select(x->(x>0), digits(k,b))); vecprod(d)*vecsum(d) == k;
for (k=1, 10^5, if (isok(k, 7), print1(k, ", ")))
A370251
Base-12 numbers k such that k = (product of nonzero digits of k) * (sum of digits of k) (written in base 10).
Original entry on oeis.org
1, 176, 231, 495, 7040
Offset: 1
231 = 173_12, (1*7*3)*(1+7+3) = 21*11 = 231.
-
Select[Range[5*10^4], Total[IntegerDigits[#, 12]]*Fold[Times, 1, Select[IntegerDigits[#, 12],#>0&]]==#&] (* James C. McMahon, Feb 14 2024 *)
-
isok(k, b) = my(d=select(x->(x>0), digits(k, b))); vecprod(d)*vecsum(d) == k;
for (k=0, 10^10, if (isok(k, 12), print1(k, ", ")))
A371337
Numbers k>0 such that k = (sum of digits of k^2) + (product of nonzero digits of k^2).
Original entry on oeis.org
127, 1467, 3052, 5860, 653230, 3483702, 43352128, 783820873, 8092385362, 622196951140, 1061882796441600145, 178949702436677222562
Offset: 1
1467^2 = 2152089, (2+1+5+2+8+9) + (2*1*5*2*8*9) = 27 + 1440 = 1467.
-
SplusP(k,r) = my(d=select(x->(x>0),digits(k^r))); vecsum(d) + vecprod(d) == k;
resuSplusP(p,r)=for(k=1,10^p,if(SplusP(k,r) ==1,print1(k,",")))
A371338
Numbers k>0 such that k = |(product of nonzero digits of k^2) - (sum of digits of k^2)|.
Original entry on oeis.org
161, 198, 1701, 604755, 629810, 4354506, 100018736, 411505847, 14869757951891, 2239397044538572646, 40766979086355529727820, 6289762487609138872319999999757
Offset: 1
1701^2 = 2893401, |(2*8*9*3*4*1) - (2+8+9+3+4+1)| = 1728 - 27 = 1701.
-
SmP(k,r)=my(d=select(x->(x>0),digits(k^r))); abs(vecsum(d)- vecprod(d)) == k;
resuSmP(p,r)={for(k=1,10^p,if(SmP(k,r)==1, print1(k,";")))}
Showing 1-9 of 9 results.
Comments