login
A375208
Modified Sisyphus function of order 5: a(n) is the concatenation of the number of digits in n with the number of digits of n congruent to k modulo 5 for each k from 0 to 4 in turn.
3
110000, 101000, 100100, 100010, 100001, 110000, 101000, 100100, 100010, 100001, 211000, 202000, 201100, 201010, 201001, 211000, 202000, 201100, 201010, 201001, 210100, 201100, 200200, 200110, 200101, 210100, 201100, 200200, 200110, 200101, 210010, 201010, 200110, 200020, 200011, 210010, 201010, 200110, 200020, 200011, 210001, 201001, 200101, 200011, 200002
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
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
Cf. A073053 (Sisyphus), A171797, A171798, A350709, A352751.
Sequence in context: A111888 A183770 A023349 * A368020 A138722 A122240
KEYWORD
nonn,base,easy
AUTHOR
Matt Coppenbarger, Oct 16 2024
STATUS
approved