OFFSET
0,1
COMMENTS
If we start with n and repeatedly apply the map i -> a(i), we eventually get the cycle {613200, 622110}.
LINKS
James C. McMahon, Table of n, a(n) for n = 0..10000
M. E. Coppenbarger, Iterations of a modified Sisyphus function, Fib. Q., 56 (No. 2, 2018), 130-141.
EXAMPLE
11 has two digits, both congruent to 1 modulo 5, so a(11) = 202000.
a(20) = 210100.
a(30) = 210010.
a(2527200000) = 1060400.
MAPLE
a:= n-> (l-> parse(cat(nops(l), seq(add(`if`(irem(i, 5)=k
, 1, 0), i=l), k=0..4))))(convert(n, base, 10)):
seq(a(n), n=0..44); # Alois P. Heinz, Oct 23 2024
MATHEMATICA
fc[n_, m_]:=Count[Mod[IntegerDigits[n], 5], m]; a[n_]:=Module[{s={Length[IntegerDigits[n]]}}, Do[AppendTo[s, fc[n, k]], {k, 0, 4}]; FromDigits[s]]; Array[a, 45, 0] (* James C. McMahon, Sep 07 2025 *)
PROG
(Python) # based on Michael S. Branicky in A350709
def a(n, order=5):
d, m = list(map(int, str(n))), [0]*order
for di in d: m[di%order] += 1
return int(str(len(d)) + "".join(map(str, m)))
print([a(n) for n in range(37)])
(Python)
from collections import Counter
def A375208(n):
s = str(n)
c = Counter(int(d)%5 for d in s)
return int(str(len(s))+''.join(str(c[i]) for i in range(5))) # Chai Wah Wu, Nov 26 2024
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Matt Coppenbarger, Oct 16 2024
STATUS
approved
