OFFSET
1,2
COMMENTS
Digit 0 in n is erased, non-coprime digits of n are erased. If all digits are erased, we write 0 for the result.
The digit 1 is never erased, e.g. repunits are fixed points of this procedure. - Chai Wah Wu, Apr 02 2020
LINKS
Daniel Suteu, Table of n, a(n) for n = 1..10000
EXAMPLE
10 becomes 1 as we do not accept zeros in n, 22 becomes 0 as gcd(2,2) = 2, 25 becomes 25 as gcd(2,5) = 1, 1033 becomes 133 becomes 1, 1234567890 becomes 123456789 becomes 157. Note that numbers with even digits disappear immediately and we get 0.
PROG
(PARI) a(n) = my(D=digits(n)); D=select(d->d!=0, D); my(C=Set()); for(i=1, #D, for(j=i+1, #D, if(gcd(D[i], D[j]) != 1, C=concat(C, [D[i], D[j]])))); C=Set(C); fromdigits(select(d->!setsearch(C, d), D)); \\ Daniel Suteu, Oct 08 2019
(Python)
def A328131(n):
s, tlist = str(n), ('2468', '369', '468', '5', '689', '7', '8', '9')
dset = set('0'+''.join(t if t[0] in s and sum(s.count(d) for d in t) > 1 else '' for t in tlist))
return int('0'+''.join(d for d in s if d not in dset)) # Chai Wah Wu, Apr 02 2020
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ctibor O. Zizka, Oct 04 2019
STATUS
approved