login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A059175 For a rational number p/q let f(p/q) = p*q divided by the sum of digits of p and q; a(n) is obtained by iterating f, starting at n/1, until an integer is reached, or if no integer is ever reached then a(n) = 0. 8

%I #21 Feb 09 2022 09:04:41

%S 0,66,66,462,180,66,31395,714,72,9,5,15,3,36,42,39,2,9,45,462,12,12,

%T 90,3703207920,1692600,84,234,27,3043425,74613,6,7930296,264,4290,510,

%U 315,315,73302369360,1155,3,8,239872017,6,4386,1989,18,17740866,499954980

%N For a rational number p/q let f(p/q) = p*q divided by the sum of digits of p and q; a(n) is obtained by iterating f, starting at n/1, until an integer is reached, or if no integer is ever reached then a(n) = 0.

%H Reinhard Zumkeller, <a href="/A059175/b059175.txt">Table of n, a(n) for n = 0..10000</a>

%H P. Schogt, <a href="http://arxiv.org/abs/1211.6583">The Wild Number Problem: math or fiction?</a>, arXiv preprint arXiv:1211.6583 [math.HO], 2012. - From _N. J. A. Sloane_, Jan 03 2013

%F a(A214866(n)) = 0. - _Reinhard Zumkeller_, Mar 11 2013

%e 3/1 -> 3/4 -> 12/7 -> 84/10=42/5 -> 210/11 -> 2310/5 = 462 so a(3)=462.

%e 84/1 -> 84/13 -> 273/4 -> 273/4 -> ... so a(84) = 0.

%t f[Rational[p_, q_]] := p*q/(Total[ IntegerDigits[p]] + Total[ IntegerDigits[q]]); f[n_Integer] := n/(1 + Total[ IntegerDigits[n]]); a[n_] := If[ IntegerQ[ r = NestWhile[f, n, Not[#1 == #2 || #1 != #2 && IntegerQ[#2]]&, 2]], r, 0]; Table[a[n], {n, 0, 50}] (* _Jean-François Alcover_, Apr 03 2013 *)

%o (Haskell)

%o import Data.Ratio ((%), numerator, denominator)

%o a059175 n = f [n % 1] where

%o f xs@(x:_) | denominator y == 1 = numerator y

%o | y `elem` xs = 0

%o | otherwise = f (y : xs)

%o where y = (numerator x * denominator x) %

%o (a007953 (numerator x) + a007953 (denominator x))

%o -- _Reinhard Zumkeller_, Mar 11 2013

%o (PARI) f2(p,q) = p*q/(sumdigits(p)+sumdigits(q));

%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 a(n) = {if (n==0, return(0)); 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);} \\ _Michel Marcus_, Feb 09 2022

%Y Cf. A007953, A058971, A214866.

%K base,easy,nonn,nice

%O 0,2

%A _Floor van Lamoen_, Jan 15 2001

%E Corrected and extended by _Naohiro Nomoto_, Jul 20 2001

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)