login
A079791
a(1) = 1, a(n) = a(n-1)/n if a(n-1) is divisible by n else a(n) is the concatenation of a(n-1) and n.
1
1, 12, 4, 1, 15, 156, 1567, 15678, 1742, 174210, 17421011, 1742101112, 174210111213, 17421011121314, 1742101112131415, 174210111213141516, 17421011121314151617, 1742101112131415161718, 174210111213141516171819
OFFSET
1,2
EXAMPLE
a(3) = 12/3 = 4 a(4) = 4/4 = 1, a(5) = 15.
MATHEMATICA
Transpose[NestList[{#[[1]]+1, If[Divisible[#[[2]], #[[1]]+1], #[[2]]/ (#[[1]]+ 1), FromDigits[Flatten[Join[IntegerDigits[#[[2]]], IntegerDigits[ #[[1]]+ 1]]]]]}&, {1, 1}, 20]][[2]] (* Harvey P. Dale, Apr 25 2012 *)
PROG
(PARI) f=1; for(i=1, 40, if(f%i==0, f=f/i, f=eval(concat(Str(f), i))); print1(f, ", ")) - Lambert Herrgesell (zero815(AT)googlemail.com), Mar 13 2006
CROSSREFS
Sequence in context: A261403 A010202 A079792 * A018812 A306375 A139358
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Feb 04 2003
EXTENSIONS
More terms from Lambert Herrgesell (zero815(AT)googlemail.com), Mar 13 2006
STATUS
approved