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!)
A194854 Starting from a(1)=1, describe previous terms and then add all the digits. 1

%I #16 Mar 30 2012 18:53:49

%S 1,2,5,11,13,18,28,30,32,34,40,42,44,46,54,56,58,60,62,64,66,68,70,79,

%T 90,92,94,96,98,100,103,106,100,94,87,89,91,84,86,88,81,83,85,87,89,

%U 82,84,86,88,81,83,85,87,89,91,93,95,97,99,101,104,107,110,113

%N Starting from a(1)=1, describe previous terms and then add all the digits.

%H Paolo P. Lava, <a href="/A194854/b194854.txt">Table of n, a(n) for n = 1..10000</a>

%H Paolo P. Lava, <a href="/A194854/a194854.pdf">Plot of the first 10000 terms of the sequence</a>

%e Start with 1. There is one 1: 11 and 1+1=2. The sequence is now 1,2. Therefore one 1 and one 2: 1112 and 1+1+1+2=5. The sequence is now 1,2,5. Again: 111215 and 1+1+1+2+1+5=11. And so on.

%p sd:=proc(j)

%p local c,d,h,k;

%p h:=j; c:=0;

%p if h>0 then

%p d:=floor(evalf(log10(h))+1);

%p for k from 1 to d do c:=c+h-10*trunc(h/10); h:=trunc(h/10); od;

%p fi;

%p c;

%p end:

%p P:=proc(i)

%p local a,b,f,n,p,s,v;

%p v:=array[10]; v[1]:=1; v[10]:=0; print(v[1]);

%p for n from 2 to 9 do v[n]:=0; od;

%p for n from 1 by 1 to i do

%p a:=0;

%p for p from 1 to 10 do

%p if sd(v[p])=0 then a:=a+sd(v[p]);

%p else a:=a+(p mod 10)+sd(v[p]);

%p fi;

%p od;

%p print(a); s:=floor(evalf(log10(a))+1);

%p for p from 1 to s do

%p f:=a-10*trunc(a/10); a:=trunc(a/10);

%p if f=0 then v[10]:=v[10]+1; else v[f]:=v[f]+1; fi;

%p od;

%p od;

%p end:

%p P(10000);

%Y Cf. A045918, A063850, A138484-A138493

%K nonn,base

%O 1,2

%A _Paolo P. Lava_, Sep 07 2011

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 25 03:15 EDT 2024. Contains 371964 sequences. (Running on oeis4.)