cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

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.

Original entry on oeis.org

0, 66, 66, 462, 180, 66, 31395, 714, 72, 9, 5, 15, 3, 36, 42, 39, 2, 9, 45, 462, 12, 12, 90, 3703207920, 1692600, 84, 234, 27, 3043425, 74613, 6, 7930296, 264, 4290, 510, 315, 315, 73302369360, 1155, 3, 8, 239872017, 6, 4386, 1989, 18, 17740866, 499954980
Offset: 0

Views

Author

Floor van Lamoen, Jan 15 2001

Keywords

Examples

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

Crossrefs

Programs

  • Haskell
    import Data.Ratio ((%), numerator, denominator)
    a059175 n = f [n % 1] where
       f xs@(x:_) | denominator y == 1 = numerator y
                  | y `elem` xs        = 0
                  | otherwise          = f (y : xs)
                  where y = (numerator x * denominator x) %
                            (a007953 (numerator x) + a007953 (denominator x))
    -- Reinhard Zumkeller, Mar 11 2013
    
  • Mathematica
    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 *)
  • PARI
    f2(p,q) = p*q/(sumdigits(p)+sumdigits(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)););}
    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

Formula

a(A214866(n)) = 0. - Reinhard Zumkeller, Mar 11 2013

Extensions

Corrected and extended by Naohiro Nomoto, Jul 20 2001

A216183 Numbers m such that A059514(m) = 0.

Original entry on oeis.org

57, 61, 76, 89, 123, 134, 141, 147, 148, 170, 189, 196, 211, 214, 235, 246, 255, 268, 282, 294, 305, 314, 327, 329, 350, 352, 365, 369, 376, 381, 417, 419, 422, 427, 428, 436, 469, 471, 475, 479, 497, 502, 508, 525, 527, 528, 530, 543, 556, 595, 628, 633
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 11 2013

Keywords

Comments

A059514(a(n)) = 0.

Crossrefs

Cf. A214866.

Programs

  • Haskell
    import Data.List (elemIndices)
    a216183 n = a216183_list !! (n-1)
    a216183_list = map (+ 1) $ elemIndices 0 a059514_list
Showing 1-2 of 2 results.