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-9 of 9 results.

A058972 For a rational number p/q let f(p/q) = sum of aliquot divisors of p+q divided by number of divisors of p+q; sequence gives numbers k such that, starting at k/1 and iterating f, an integer is eventually reached.

Original entry on oeis.org

3, 9, 15, 24, 25, 29, 33, 35, 50, 51, 55, 57, 59, 63, 73, 79, 80, 81, 85, 87, 89, 90, 95, 99, 105, 119, 120, 121, 128, 131, 139, 143, 145, 169, 177, 179, 181, 183, 193, 195, 201, 203, 204, 211, 215, 217, 218, 219, 221, 225, 227, 233, 247, 248, 255, 273, 275, 288
Offset: 1

Views

Author

N. J. A. Sloane, Jan 14 2001

Keywords

Examples

			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.
		

Crossrefs

Programs

  • 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
    
  • 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 *)
  • 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

Extensions

Corrected and extended by Matthew Conroy, Apr 18 2001

A058977 For a rational number p/q let f(p/q) = sum of distinct prime factors (A008472) of p+q divided by number of distinct prime factors (A001221) of p+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

2, 3, 2, 5, 7, 7, 2, 3, 3, 11, 7, 13, 11, 4, 2, 17, 7, 19, 3, 5, 4, 23, 7, 5, 17, 3, 11, 29, 13, 31, 2, 7, 5, 6, 7, 37, 23, 8, 3, 41, 4, 43, 4, 4, 3, 47, 7, 7, 3, 10, 17, 53, 7, 8, 11, 11, 7, 59, 13, 61, 6, 5, 2, 9, 19, 67, 5, 13, 17, 71, 7, 73, 41, 4, 23, 9, 6, 79, 3, 3, 4, 83, 4, 11, 47
Offset: 1

Views

Author

N. J. A. Sloane, Jan 14 2001

Keywords

Comments

A247462 gives number of iterations needed to reach a(n). - Reinhard Zumkeller, Sep 17 2014

Examples

			f(5/1) = 5/2 and f(5/2) = 7, so a(5)=7.
		

Crossrefs

Programs

  • Haskell
    import Data.Ratio ((%), numerator, denominator)
    a058977 = numerator . until ((== 1) . denominator) f . f . fromIntegral
       where f x = a008472 z % a001221 z
                   where z = numerator x + denominator x
    -- Reinhard Zumkeller, Aug 29 2014
    
  • Mathematica
    nxt[n_]:=Module[{s=Numerator[n]+Denominator[n]},Total[Transpose[ FactorInteger[ s]][[1]]]/PrimeNu[s]]; Table[NestWhile[nxt,nxt[n],!IntegerQ[#]&],{n,90}] (* Harvey P. Dale, Mar 15 2013 *)
  • PARI
    f2(p,q) = my(f=factor(p+q)[,1]~); vecsum(f)/#f;
    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) = {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

Extensions

More terms from Matthew Conroy, Apr 18 2001

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

A058988 For a rational number p/q let f(p/q) = p*q divided by number of divisors of p+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

1, 1, 1, 2, 30, 3, 14, 12, 18, 5, 33, 6, 26, 21, 3, 8, 51, 9, 38, 5, 28, 11, 92, 8, 50, 0, 9, 14, 116, 15, 93, 8, 66, 17, 105, 18, 74, 0, 156, 20, 492, 21, 86, 22, 60, 23, 0, 16, 147, 0, 17, 26, 212, 27, 330, 14, 114, 29, 354, 30, 61, 186, 9, 16, 260, 33, 201, 17, 138, 35, 426
Offset: 1

Views

Author

N. J. A. Sloane, Jan 17 2001

Keywords

Crossrefs

Programs

  • Haskell
    import Data.Ratio ((%), numerator, denominator)
    a058988 n = numerator $ fst $
      until ((== 1) . denominator . fst) f $ f (fromIntegral n, []) where
      f (x, ys) = if y `elem` ys then (0, []) else (y, y:ys) where
       y = numerator x * denominator x % a000005 (numerator x + denominator x)
    -- Reinhard Zumkeller, Aug 29 2014
    
  • PARI
    f2(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)););}
    a(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);} \\ Michel Marcus, Feb 09 2022

Extensions

More terms from Naohiro Nomoto, Jul 20 2001

A059514 For a rational number p/q let f(p/q) = p*q divided by (the sum of digits of p and of q) minus 1; 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

1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 11, 4, 28, 42, 7315, 208, 136, 2, 19, 10, 7, 11, 69, 4, 2310, 28, 3, 42, 319, 10, 189885850, 96, 11, 323323, 205530, 4, 37, 228, 28, 10, 123, 7, 559, 11, 5, 69, 517, 4, 152152, 10, 187, 28, 424, 6, 11, 154, 0, 77140, 2478, 10, 0
Offset: 1

Views

Author

Floor van Lamoen, Jan 22 2001

Keywords

Comments

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

Examples

			14/1 -> 14/5 -> 70/9 -> 630/15 = 42 so a(14)=42.
57/1 -> 19/4 -> 76/13 -> 247/4 -> 247/4 -> ...  so a(57) = 0.
		

Crossrefs

Programs

  • Haskell
    import Data.Ratio ((%), numerator, denominator)
    a059514 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) - 1)
    -- Reinhard Zumkeller, Mar 11 2013

Extensions

Corrected and extended by Naohiro Nomoto, Jul 20 2001

A145833 The "Wild Numbers", from the novel of the same title (Version 2).

Original entry on oeis.org

11, 67, 4769, 67
Offset: 1

Views

Author

Aaron Swartz (me(AT)aaronsw.com), Oct 20 2008

Keywords

Comments

Apparently these are completely fictional and there is no mathematical explanation. However, see the pseudo-wild numbers in A058971, A058972, A058973, A058977, A058988, A059175. See also the Lagarias article.

References

  • P. Schogt, De Wilde Getallen, De Arbeiderspers, Amsterdam, 1998.
  • P. Schogt, The Wild Numbers, Four Walls Eight Windows Pub., New York, 2000.
  • D. F. Wallace, Rhetoric and the math melodrama, Science, 290 (Dec 22 2000), 2263-2267.
  • A number of other reviews of this book exist on the Web.

Crossrefs

A variant of A058883, which is the main entry for this sequence.

A058883 The "Wild Numbers", from the novel of the same title (Version 1).

Original entry on oeis.org

11, 67, 2, 4769, 67
Offset: 0

Views

Author

N. J. A. Sloane, Jan 08 2001

Keywords

Comments

Apparently these are completely fictional and there is no mathematical explanation. However, see the pseudo-wild numbers in A058971, A058972, A058973, A058977, A058988, A059175. See also the Lagarias article.

References

  • P. Schogt, De Wilde Getallen, De Arbeiderspers, Amsterdam, 1998.
  • P. Schogt, The Wild Numbers, Four Walls Eight Windows Pub., New York, 2000.
  • D. F. Wallace, Rhetoric and the math melodrama, Science, 290 (Dec 22 2000), 2263-2267.
  • A number of other reviews of this book exist on the Web.

Crossrefs

See A145833 for another version.

Extensions

Thanks to Enoch Haga for investigating these numbers (Jan 14 2001).
Offset changed to 0 by Sean A. Irvine, Sep 03 2022, because of the Wikipedia link.

A323356 For a rational number p/q let f(p/q) = (p+q) / (A000120(p) + A000120(q)); a(n) is obtained by iterating f, starting at n/1, until an integer is reached (and then a(n) = that integer), or if no integer is ever reached then a(n) = -1.

Original entry on oeis.org

1, 2, 2, 2, 2, 2, 2, -1, 7, -1, 3, 7, 7, -1, 7, -1, 6, -1, 5, 7, 7, -1, -1, -1, -1, 8, -1, -1, 6, 8, -1, 8, 11, 8, 9, 8, -1, 8, 8, 11, -1, 11, 11, 11, -1, 11, 8, -1, 8, 11, -1, -1, 11, 11, 8, 16, -1, 15, 10, 16, -1, -1, 15, 14, 22, 14, 17, 23, 11, 15, 11, 11, 8, 12, 11, 11, 16, 12, 11
Offset: 1

Views

Author

Ctibor O. Zizka, Jan 18 2019

Keywords

Examples

			13/1 -> 14/4=7/2 -> 9/4 -> 13/3 -> 16/5 -> 21/3 = 7 so a(13) = 7.
8/1 -> 9/2 -> 11/3 -> 14/5 -> 19/5 -> 24/5 -> 29/4 -> 33/5 -> 38/4=19/2 -> 21/4 -> 25/4 -> 29/4 and the 5-cycle repeats, so a(8) = -1.
		

Crossrefs

Programs

  • Mathematica
    Array[SelectFirst[Rest@ NestWhileList[(#1 + #2)/(DigitCount[#1, 2, 1] + DigitCount[#2, 2, 1]) & @@ {Numerator@ #, Denominator@ #} &, #, UnsameQ, All], IntegerQ] /. k_ /; MissingQ@ k -> -1 &, 79] (* Michael De Vlieger, Jan 18 2019 *)

A323596 Number of (positive) iterations of f to reach an integer when starting from n/1. If no integer is ever reached then a(n) = -1. f(p/q) = (p + q) / (A000120(p) + A000120(q)).

Original entry on oeis.org

1, 3, 3, 3, 1, 2, 1, -1, 4, -1, 1, 3, 5, -1, 2, -1, 1, -1, 1, 1, 4, -1, -1, -1, -1, 5, -1, -1, 1, 4, -1, 5, 16, 4, 1, 2, -1, 3, 1, 14, -1, 13, 13, 13, -1, 12, 1, -1, 6, 2, -1, -1, 11, 1, 5, 13, -1, 4, 1, 12, -1, -1, 3, 3, 1, 2, 1, 1, 16, 2, 8, 8, 4, 3, 7, 7, 9, 2, 14
Offset: 1

Views

Author

Ctibor O. Zizka, Jan 18 2019

Keywords

Examples

			8/1 -> 9/2 -> 11/3 -> 14/5 -> 19/5 -> 24/5 -> 29/4 -> 33/5 -> 38/4=19/2 -> 21/4 -> 25/4 -> 29/4 and the 5-cycle repeats, so a(8) = -1.
13/1 -> 14/4=7/2 -> 9/4 -> 13/3 -> 16/5 -> 21/3=7 so a(13) = 5.
		

Crossrefs

Programs

  • Mathematica
    Array[If[AnyTrue[#, IntegerQ], 1 + LengthWhile[#, ! IntegerQ@ # &], -1] &@ Rest@ NestWhileList[(#1 + #2)/(DigitCount[#1, 2, 1] + DigitCount[#2, 2, 1]) & @@ {Numerator@ #, Denominator@ #} &, #, UnsameQ, All] &, 79] (* Michael De Vlieger, Jan 18 2019 *)
Showing 1-9 of 9 results.