login
Smallest number m such that A247462(m) = n.
3

%I #7 Feb 09 2022 09:04:50

%S 1,5,164,501,7364,29121,515504,2445693,92781321

%N Smallest number m such that A247462(m) = n.

%F A247462(a(n)) = n and A247462(m) < n for m < a(n).

%e . n | a(n) | A058977 trajectory

%e . ---+---------+---------------------------------------------------------

%e . 2 | 5 | 1/a(2)-5/2-7

%e . 3 | 164 | 1/a(3)-19/3-13/2-4

%e . 4 | 501 | 1/a(4)-253/2-25/3-9/2-11

%e . 5 | 7364 | 1/a(5)-499/3-253/2-25/3-9/2-11

%e . 6 | 29121 | 1/a(6)-14563/2-979/3-493/2-19/3-13/2-4

%e . 7 | 515504 | 1/a(6)-34375/3-17191/2-535/3-271/2-23/3-15/2-17

%e . 8 | 2445693 | 1/a(8)-1222849/2-58241/3-14563/2-979/3-493/2-19/3-13/2-4

%o (Haskell)

%o import Data.List (elemIndex); import Data.Maybe (fromJust)

%o a247468 = (+ 1) . fromJust . (`elemIndex` a247462_list)

%o (PARI) f2(p, q) = my(f=factor(p+q)[, 1]~); vecsum(f)/#f;

%o f1(r) = f2(numerator(r), denominator(r));

%o loop(list) = {my(v=Vecrev(list)); for (i=2, #v, if (v[i] == v[1], return(1)); ); }

%o f(n) = {my(ok=0, m=f2(n, 1), list=List(), nb=1); while(denominator(m) != 1, m = f1(m); nb++; listput(list, m); if (loop(list), return (0)); ); return(nb); } \\ A247462

%o a(n) = my(k=1); while(f(k) != n, k++); k; \\ _Michel Marcus_, Feb 09 2022

%Y Cf. A247462, A058977.

%K nonn,more

%O 1,2

%A _Reinhard Zumkeller_, Sep 17 2014

%E a(9) from _Michel Marcus_, Feb 09 2022