OFFSET
1,1
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
P. Schogt, The Wild Number Problem: math or fiction?, arXiv preprint arXiv:1211.6583 [math.HO], 2012. - From N. J. A. Sloane, Jan 03 2013
EXAMPLE
f(9/1) = 8/4 = 2, an integer, so 9 is in the sequence;
f(10/1) = 1/2 and f(1/2)=1/2, so 10 is not in the sequence.
MATHEMATICA
f[r_] := If[init == False && IntegerQ[r], r, init = False; p = Numerator[r]; q = Denominator[r]; d = Most[Divisors[p+q]]; Total[d]/(Length[d]+1)]; ok[n_] := IntegerQ[ init = True; FixedPoint[f, n/1]]; ok[1] = False; A058972 = Select[ Range[300], ok] (* Jean-François Alcover, Dec 21 2011 *)
PROG
(Haskell)
import Data.Ratio ((%), numerator, denominator)
a058972 n = a058972_list !! (n-1)
a058972_list = map numerator $ filter ((f [])) [1..] where
f ys q = denominator y == 1 || not (y `elem` ys) && f (y : ys) y
where y = a001065 q' % a000005 q'
q' = numerator q + denominator q
-- Reinhard Zumkeller, Jun 15 2013
(PARI) f2(p, q) = (sigma(p+q)-p-q)/numdiv(p+q);
f1(r) = f2(numerator(r), denominator(r));
loop(list) = {my(v=Vecrev(list)); for (i=2, #v, if (v[i] == v[1], return(1)); ); }
ff(n) = {my(ok=0, m=f2(n, 1), list=List()); while(denominator(m) != 1, m = f1(m); listput(list, m); if (loop(list), return (0)); ); return(m); }
isok(m) = ff(m) > 0; \\ Michel Marcus, Feb 09 2022
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
N. J. A. Sloane, Jan 14 2001
EXTENSIONS
Corrected and extended by Matthew Conroy, Apr 18 2001
STATUS
approved