OFFSET
1,2
COMMENTS
EXAMPLE
n = 13 is not a term since 31211101987654321 is not divisible by 13. (Note that the order of the digits of 13, 12 and 10 is reversed.)
See A061955 for further examples.
MATHEMATICA
k = 2; lst = {}; rid = 1; While[k < 1001, exp = Floor[ Log10[rid]] + 1 + If[Mod[k, 10] == 1, IntegerExponent[k - 1, 10], 0]; rid = rid + FromDigits@ Reverse@ IntegerDigits@ k*(10^exp); If[ Mod[rid, k] == 0, Print@ k; AppendTo[lst, k]]; k++]; lst (* and to test any single value n *) fQ[n_] := Mod[ FromDigits@ Reverse@ Flatten@ IntegerDigits@ Range@ n, n] == 0 (* Robert G. Wilson v, Sep 12 2011 *)
Select[Range[5*10^6], Divisible[FromDigits[Reverse[Flatten[ IntegerDigits/@ Range[ #]]]], #]&] (* Harvey P. Dale, Apr 10 2017 *)
PROG
(PARI) isok(n) = my(s = ""); forstep (k=n, 1, -1, sk = digits(k); forstep (j=#sk, 1, -1, s = concat(s, sk[j]))); (eval(s) % n) == 0; \\ Michel Marcus, Jan 28 2017
CROSSREFS
KEYWORD
nonn,base,more
AUTHOR
Larry Reeves (larryr(AT)acm.org), May 24 2001
EXTENSIONS
Edited and updated by Larry Reeves (larryr(AT)acm.org), Apr 12 2002
a(12)-a(14) from Lars Blomberg, Aug 19 2011
STATUS
approved