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!)
A059707 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 multiply them; repeat. 4
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 11, 2, 13, 4, 15, 6, 17, 8, 19, 20, 2, 22, 6, 24, 0, 26, 4, 28, 8, 0, 31, 6, 33, 2, 35, 8, 37, 24, 39, 40, 4, 42, 2, 44, 20, 46, 28, 48, 8, 0, 51, 0, 53, 20, 55, 0, 57, 40, 59, 60, 6, 62, 8, 64, 0, 66, 42, 68, 20, 0, 71, 4, 73, 28, 75, 42 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
a(A059708(n)) = A059708(n). - Reinhard Zumkeller, Jun 15 2012
LINKS
EXAMPLE
89 -> 8*9 = 72 -> 7*2 = 14 -> 1*4 = 4, stop, so a(89) = 4.
33278 -> 28*337 = 9436 -> 46*93 = 4278 -> 42*78 -> 2996 -> 26*99 = 2574 -> 24*57 = 1368 -> 68*13 = 884, stop, so a(33278) = 884.
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, 76}] (* Jean-François Alcover, May 16 2013 *)
sp[n_]:=Module[{idn=IntegerDigits[n], e, o}, e=Select[idn, EvenQ]; o= Select[ idn, OddQ]; If[Min[Length[o], Length[e]]>0, FromDigits[o] FromDigits[e], n]]; Table[FixedPoint[sp, i], {i, 0, 80}] (* Harvey P. Dale, Jun 05 2014 *)
PROG
(Haskell)
import Data.List (unfoldr)
a059707 n = if u == n || v == n then n else a059707 (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, Jun 15 2012
CROSSREFS
Sequence in context: A257294 A330970 A139281 * A256754 A265525 A355223
KEYWORD
nonn,base,easy,nice,look
AUTHOR
N. J. A. Sloane, Feb 07 2001
EXTENSIONS
a(50) corrected by Reinhard Zumkeller, Jun 15 2012
STATUS
approved

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 28 12:29 EDT 2024. Contains 372085 sequences. (Running on oeis4.)