login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A358067
a(n) is the smallest m such that A144261(m) = n.
1
1, 15, 14, 33, 22, 17, 73, 49, 13, 11, 529, 31, 397, 293, 241, 199, 1633, 53, 3727, 761, 331, 491, 4343, 431, 1943, 887, 383, 3659, 3809, 377, 15863, 9419, 2713, 2993, 26753, 1583, 30311, 5297, 8971, 2753, 5363, 983, 11603, 4919, 18314, 14657, 59303, 1499, 99179
OFFSET
1,2
COMMENTS
In other words, a(n) is the smallest element m of the set of the integers k that satisfy {A144261(k) = n and n * k is a Niven number} (see Example section).
Same question as in A144261: does a(n) exist for all n?
EXAMPLE
A144261(15) = A144261(25) = A144261(35) = A144261(51) = ... = 2 because 15, 25, 35, 51, ... are not Niven numbers and 2 is the smallest integer such that 2*15=30, 2*25=50, 2*35=70, 2*51=102, ..., are Niven (or Harshad) numbers. Since 15 is the least integer that, when multiplied by 2, yields a Niven number (2*15), a(2) = 15.
MATHEMATICA
f[n_] := Module[{k = 1, p}, While[! Divisible[p = k*n, Plus @@ IntegerDigits[p]], k++]; k]; seq[len_, nmax_] := Module[{s = Table[0, {len}], c = 0, n = 1, i}, While[c < len && n < nmax, i = f[n]; If[i <= len && s[[i]] == 0, c++; s[[i]] = n]; n++]; s]; seq[50, 10^6] (* Amiram Eldar, Oct 29 2022 *)
PROG
(PARI) f(n) = my(k=1); while ((k*n) % sumdigits(k*n), k++); k; \\ A144261
a(n) = my(k=1); while (f(k) != n, k++); k; \\ Michel Marcus, Oct 31 2022
(Python)
from itertools import count
def A358067(n): return next(filter(lambda m:n==next(filter(lambda k:not (r:=k*m) % sum(int(d) for d in str(r)), count(1))), count(1))) # Chai Wah Wu, Nov 04 2022
CROSSREFS
Cf. A005349 (Niven numbers), A144261.
Sequence in context: A087979 A291490 A373161 * A048294 A248391 A201345
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Oct 29 2022
EXTENSIONS
More terms from Amiram Eldar, Oct 29 2022
STATUS
approved