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

A059708 Numbers k such that all digits have same parity.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 15, 17, 19, 20, 22, 24, 26, 28, 31, 33, 35, 37, 39, 40, 42, 44, 46, 48, 51, 53, 55, 57, 59, 60, 62, 64, 66, 68, 71, 73, 75, 77, 79, 80, 82, 84, 86, 88, 91, 93, 95, 97, 99, 111, 113, 115, 117, 119, 131, 133, 135, 137, 139
Offset: 1

Views

Author

N. J. A. Sloane, Feb 07 2001

Keywords

Comments

A059717(a(n)) = a(n). - Reinhard Zumkeller, Jul 05 2011
A059707(a(n)) = a(n). - Reinhard Zumkeller, Jun 15 2012

Crossrefs

Union of A014261 and A014263.

Programs

A139281 If all digits are the same mod 3, stop; otherwise write down the number formed by the 1 mod 3 digits and the number formed by the 2 mod 3 digits and the number formed by the 3 mod 3 digits and multiply them; repeat.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 11, 2, 3, 14, 5, 6, 17, 8, 9, 0, 2, 22, 6, 8, 25, 2, 14, 28, 8, 30, 3, 6, 33, 2, 5, 36, 2, 8, 39, 0, 41, 8, 2, 44, 0, 8, 47, 6, 36, 0, 5, 52, 5, 0, 55, 30, 5, 58, 0, 60, 6, 2, 63, 8, 30, 66, 8, 6, 69, 0, 71, 14, 2, 74, 5, 8, 77, 30, 63, 0, 8, 82, 8, 6, 85, 6, 30
Offset: 0

Views

Author

Jonathan Vos Post, Jun 06 2008

Keywords

Comments

Modulo 3 analog of A059707. The 1 mod 3 digits = {1,4,7}, 2 mod 3 digits = {2,5,8}, 3 mod 3 digits = {0, 3, 6, 9}. The fixed points begin: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 14, 17, 22, 25, 28, 30, 33, 36, 39, 41, 44, 47, 52, 55, 58.

Examples

			a(57) = 5 because 5 and 7 are different mod 3, so 5*7 = 35; 3 and 5 are different mod 3, so 3*5 = 15; 1 and 5 are different mod 3, so 1*5 = 5, which is a fixed point.
		

Crossrefs

Extensions

a(52) corrected and sequence extended by Sean A. Irvine, Sep 03 2009

A059717 Start with decimal expansion of n; if all digits have the same parity, stop; otherwise write down the number formed by the even digits and the number formed by the odd digits and add them; repeat.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 3, 13, 5, 15, 7, 17, 9, 19, 20, 3, 22, 5, 24, 7, 26, 9, 28, 11, 3, 31, 5, 33, 7, 35, 9, 37, 11, 39, 40, 5, 42, 7, 44, 9, 46, 11, 48, 13, 5, 51, 7, 53, 9, 55, 11, 57, 13, 59, 60, 7, 62, 9, 64, 11, 66, 13, 68, 15, 7, 71, 9, 73, 11, 75
Offset: 0

Views

Author

N. J. A. Sloane, Feb 08 2001

Keywords

Comments

a(A011557(n)) = 1; a(A059708(n)) = A059708(n). [Reinhard Zumkeller, Jul 05 2011]

Examples

			For example, 59708 -> (0)8 + 597 = 605 -> 60 + 5 = 65 -> 6 + 5 = 11, stop, so a(59708) = 11.
		

Crossrefs

Programs

  • Haskell
    import Data.List (unfoldr)
    a059717 n = if u == n || v == n then n else a059717 (u + v) where
       (u,v) = foldl (\(x,y) d -> if odd d then (10*x+d,y) else (x,10*y+d))
            (0,0) $ reverse $ unfoldr
            (\z -> if z == 0 then Nothing else Just $ swap $ divMod z 10) n
    -- Reinhard Zumkeller, Nov 16 2011 (corrected), Jul 05 2011
  • Mathematica
    f[n_] := (id = IntegerDigits[n]; oddDigits = Select[id, OddQ]; evenDigits = Select[id, EvenQ]; Which[ oddDigits == {}, FromDigits[ evenDigits ], evenDigits == {}, FromDigits[ oddDigits ], True, FromDigits[ evenDigits ] + FromDigits[ oddDigits ]]); a[n_] := FixedPoint[f, n]; Table[a[n], {n, 0, 75}] (* Jean-François Alcover, May 31 2013 *)
Showing 1-3 of 3 results.