OFFSET
1,2
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
Jeffrey C. Lagarias, Wild and Wooley numbers, The American Mathematical Monthly, Vol. 113, No. 2 (2006), pp. 97-108; arXiv preprint, arXiv:math/0411141 [math.NT], 2004-2005.
EXAMPLE
(8, 1) -> (9, 2) -> (11, 3) -> (14, 5) -> (19, 5) -> (24, 5) -> (29, 4) -> (33, 5) -> (38, 4) -> (42, 4) -> (46, 4) -> (50, 5). 50/5 is an integer, so a(8) = 50/5 = 10.
MATHEMATICA
a[n_] := Divide@@ NestWhile[{Total[#], Total[DigitCount[#, 2, 1]]}&, {n, 1}, Last[#] == 1 || !Divisible@@# &]; Array[a, 100] (* Amiram Eldar, Jul 29 2025 *)
PROG
(PARI) f(v) = return([v[1]+v[2], hammingweight(v[1])+hammingweight(v[2])]);
a(n) = {my(nb = 0, v = [n, 1]); while (1, v = f(v); nb++; if (frac(q=v[1]/v[2]) == 0, return (q))); } \\ Michel Marcus, Jan 13 2019
(Python)
from itertools import count
def f(p, q): return (p+q, p.bit_count() + q.bit_count())
def a(n):
t = n, 1
return next(t[0]//t[1] for i in count(1) if (t:=f(*t))[0]%t[1] == 0)
print([a(n) for n in range(1, 91)]) # Michael S. Branicky, Dec 23 2025
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ctibor O. Zizka, Jan 12 2019
EXTENSIONS
Missing term a(87) inserted by Amiram Eldar, Jul 29 2025
STATUS
approved
