OFFSET
1,1
COMMENTS
a(n) is the first number k such that the remainder on division of k^i by its sum of digits is 1 for 1<=i<=n but not i=n+1.
EXAMPLE
a(4) = 121 because 121, 121^2 = 14641, 121^3 = 1771561, 121^4 = 214358881, and 121^5 = 25937424601 have sums of digits 4, 16, 28, 40, and 43 respectively, and 121 mod 4 = 1, 121^2 mod 16 = 1, 121^3 mod 28 = 1, 121^4 mod 40 = 1, but 121^4 mod 43 = 41 <> 1, and 121 is the first number that works.
MAPLE
sd:= n -> convert(convert(n, base, 10), `+`):
f:= proc(n) local d;
for d from 1 do
if n^d mod sd(n^d) <> 1 then return d-1 fi
od
end proc:
V:= Vector(6): count:= 0:
for n from 1 while count < 6 do
v:= f(n);
if v > 0 and V[v] = 0 then
count:= count+1; V[v]:= n
fi
od:
convert(V, list);
MATHEMATICA
quasiNivenQ[n_] := (s = Plus @@ IntegerDigits[n]) > 1 && Divisible[n - 1, s]; f[k_] := Module[{i = 0, m = k}, While[quasiNivenQ[m], m *= k; i++]; i]; seq[len_, nmax_] := Module[{s = Table[0, {len}], n = 2, c = 0, i}, While[c < len && n < nmax, i = f[n]; If[0 < i <= len && s[[i]] == 0, c++; s[[i]] = n]; n++]; s]; seq[6, 10^7] (* Amiram Eldar, Sep 07 2022 *)
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
Robert Israel, Sep 07 2022
EXTENSIONS
a(7) from Amiram Eldar, Sep 07 2022
a(8) and a(9) from Giorgos Kalogeropoulos, Sep 09 2022.
STATUS
approved