login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A063543 a(n) = n - product of nonzero digits of n. 6

%I

%S 0,0,0,0,0,0,0,0,0,9,10,10,10,10,10,10,10,10,10,18,19,18,17,16,15,14,

%T 13,12,11,27,28,26,24,22,20,18,16,14,12,36,37,34,31,28,25,22,19,16,13,

%U 45,46,42,38,34,30,26,22,18,14,54,55,50,45,40,35,30,25,20,15,63,64,58

%N a(n) = n - product of nonzero digits of n.

%H Harry J. Smith, <a href="/A063543/b063543.txt">Table of n, a(n) for n = 1..2000</a>

%H N. J. A. Sloane and Brady Haran, <a href="https://www.youtube.com/watch?v=o8c4uYnnNnc">Amazing Graphs II (including Star Wars)</a>, Numberphile video (2019).

%e a(20) = 20 - 2 = 18.

%p a:= n-> n-mul(i, i=subs(0=1, convert(n, base, 10))):

%p seq(a(n), n=1..80); # _Alois P. Heinz_, Aug 18 2019

%t Table[n - Times@@DeleteCases[IntegerDigits[n], 0], {n, 70}] (* _Alonso del Arte_, Dec 15 2013 *)

%o (PARI) ProdNzD(x)= { local(d,p); p=1; while (x>9, d=x-10*(x\10); if (d, p*=d); x\=10); return(p*x) }

%o { for (n=1, 2000, write("b063543.txt", n, " ", n - ProdNzD(n)) ) } \\ _Harry J. Smith_, Aug 25 2009

%o (PARI) a(n) = my(d=select(x->(x!=0), digits(n))); n - vecprod(d); \\ _Michel Marcus_, Jan 13 2020

%o (Python)

%o def a(n):

%o digits = map(int, str(n))

%o product = 1

%o for d in digits:

%o if d != 0:

%o product *= d

%o return n - product

%o [a(n) for n in range(20)]

%o # _Elisabeth Zemack_, Sep 16 2019; corrected by _Fabio Somenzi_, Jan 13 2020

%o (MAGMA) [n - &*[a: k in [1..#Intseq(n)] | a ne 0 where a is Intseq(n)[k]]: n in [1..100]]; // _Marius A. Burtea_, Sep 16 2019

%Y Cf. A063114.

%K nonn,base,easy,look

%O 1,10

%A _N. J. A. Sloane_, Aug 14 2001

%E More terms from Larry Reeves (larryr(AT)acm.org), Aug 14 2001

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 11 00:32 EDT 2020. Contains 336403 sequences. (Running on oeis4.)