|
|
A333523
|
|
Number of iterations of Reverse And Add needed to reach a number divisible by n (or 0 if such a number is never reached).
|
|
1
|
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 61, 1, 3, 8, 34, 22, 8, 17, 2, 8, 119, 14, 1, 17, 7, 110, 7, 12, 33, 34, 158, 28, 12, 1, 60, 11, 12, 50, 79, 7, 129, 64, 13, 42, 1, 4, 89, 131, 8, 14, 81, 30, 19, 125, 12, 1, 88, 13, 33, 67, 232, 26, 27, 24, 123, 59, 1, 24, 59, 36, 206, 148, 12, 217, 90, 97
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,10
|
|
COMMENTS
|
If n is a palindrome > 0, a(n) = 1. See A002113.
a(n) > 0 for n < 10000.
|
|
LINKS
|
|
|
EXAMPLE
|
a(12) = 3, because 12 takes 3 iterations (12 -> 33 -> 66 -> 132) to become 132, which is divisible by 12.
|
|
PROG
|
(PARI) radd(n) = fromdigits(Vecrev(digits(n)))+n; \\ A056964
a(n) = {my(i=1, k=n, x); while((x=radd(n)) % k, i++; n=x); i; } \\ Michel Marcus, Apr 11 2020
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|