OFFSET
1,1
MATHEMATICA
f[n_]:=Sum[Mod[Total[IntegerDigits[n, i]], i], {i, 2, n-1}]; kmax=97000; a={}; For[k=3, k<=kmax, k++, If[f[k]==f[k+1], AppendTo[a, k]]]; a (* Stefano Spezia, Sep 06 2022 *)
PROG
(PARI) f(n) = sum(b=2, n-1, sumdigits(n, b) % b); \\ A014841
isok(k) = f(k) == f(k+1);
(Python)
from sympy.ntheory import digits
from itertools import count, islice
def f(n): return sum(sum(digits(n, b)[1:])%b for b in range(2, n))
def agen(): # generator of terms
f0, f1 = f(3), f(4)
for k in count(3):
if f0 == f1: yield k
f0, f1, = f1, f(k+2)
print(list(islice(agen(), 4))) # Michael S. Branicky, Sep 06 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michel Marcus, Sep 06 2022
STATUS
approved