login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A022481 Describe previous term from the right (method B - initial term is 1). 11
1, 11, 12, 2111, 1321, 11213111, 1331112112, 211221133211, 12213212221221, 11221123112131112211, 122213311121123121122212, 211123122111312112211332112311 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

Method B = 'digit'-indication followed by 'frequency'.

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 1..24

EXAMPLE

E.g. the term after 1321 is obtained by saying "1 once, 2 once, 3 once, 1 once", which gives 11213111.

MATHEMATICA

A022481[1]:=1; A022481[n_]:=A022481[n]=FromDigits[Flatten[{First[#], Length[#]}&/@Split[Reverse[IntegerDigits[A022481[n-1]]]]]]; Map[A022481, Range[15]] (* Peter J. C. Moses, Apr 22 2013 *)

a[1]=1; a[n_]:=a[n]=FromDigits[Flatten[Replace[ Replace[ Replace[ Split[ Reverse[IntegerDigits[a[n-1]]]], {x_, y_}->{x, Length[{x, y}]}, {1}], {x_, y_, z_}->{x, Length[{x, y, z}]}, {1}], {x_}->{x, Length[{x}]}, {1}]]]; Array[a, 15] (* Ivan N. Ianakiev, Jun 22 2017 *)

NestList[FromDigits@ Flatten@ Reverse@ Map[{First@ #, Length@ #} &, Split@ IntegerDigits@ #] &, 1, 11] (* Michael De Vlieger, Jun 26 2017 *)

PROG

(Haskell)

import Data.List (group, transpose)

a022481 n = a022481_list !! (n-1)

a022481_list = 1 : f [1] :: [Integer] where

   f xs = (read $ concatMap show ys) : f ys where

          ys = concat $ transpose [map head zss, map length zss]

          zss = reverse $ group xs

-- Reinhard Zumkeller, Jan 26 2014

CROSSREFS

Cf. A022488, A022514, A022515, A022516, A022517, A022518, A022519, A022520.

Sequence in context: A121808 A160265 A007651 * A156338 A272817 A262282

Adjacent sequences:  A022478 A022479 A022480 * A022482 A022483 A022484

KEYWORD

nonn,base,easy,nice

AUTHOR

Clark Kimberling

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy .

Last modified July 25 04:27 EDT 2017. Contains 289779 sequences.