Describe and add

hv at crypt.org hv at crypt.org
Thu Aug 18 22:43:01 CEST 2005


"Eric Angelini" <keynews.tv at skynet.be> wrote:
:Could please someone compute and analyse this sequence?
:
:Start with a(1) = 1
:Describe a(1) --> = 11 (one "1")
:Add a(1) to it's description: 1 + 11 = 12
[...]
:a(1) = 1
:a(2) = 12
:a(3) = 1124
:a(4) = 212338
:a(5) = 11434656

Here's some perl code:
  perl -Mbigint -wle '$n=$a=1; while (1) { print "$n: $a"; ++$n; $a = desc($a) + $a } sub desc { my %a; ++$a{$_} for split //, shift; join "", map +($a{$_}, $_), sort { $a <=> $b } keys %a }'

Compute:
1: 1
2: 12
3: 1124
4: 212338
5: 11434656
6: 2124676182
7: 215338937900
8: 2011338654109729
9: 20314234480170281558
10: 20317265802504533296
11: 50431498946030705115
12: 50834622289546876944
13: 50937835732083050773
14: 50937875857418523592
15: 51038998088873897421
16: 51241110320289174260
17: 81755323561805346079
18: 101966556706331618898
19: 101968597938887792727
20: 102070720070404367576
[...]
25000: 209208887438850939711053
[...]
1718184: 18417097587111721307162018

:Questions:
:
:- has this seq. a fixed point (or loop)?
:- what about other beginnings?
:(start with a(1) = 0 for instance)

No: a(n+1) > a(n) is guaranteed by the definition.

See references to "self-describing" in OEIS for some sequences defined
along similar lines.

Hugo





More information about the SeqFan mailing list