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!)
A286449 Restricted growth sequence computed for A033879 (deficiency), or equally, for A033880 (abundance of n). 15

%I #13 May 13 2017 17:20:01

%S 1,1,2,1,3,4,5,1,6,2,7,8,9,3,5,1,10,11,12,13,7,14,15,16,17,7,18,4,19,

%T 16,20,1,12,18,15,21,22,10,15,23,24,16,25,3,9,26,27,28,29,30,20,5,31,

%U 16,32,33,34,35,36,37,38,19,15,1,27,16,39,7,25,8,40,41,42,34,35,9,36,16,43,44,29,32,45,46,47,24,48,8,49,50,40,10,36,51,40,52,53

%N Restricted growth sequence computed for A033879 (deficiency), or equally, for A033880 (abundance of n).

%H Antti Karttunen, <a href="/A286449/b286449.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Si#SIGMAN">Index entries for sequences related to sigma(n)</a>

%e We start by setting a(1) = 1 for A033879(1) = 1. Then after, whenever A033879(k) is equal to some A033879(m) with m < k, we set a(k) = a(m). Otherwise, (when the value is a new one, not encountered before), we allot for a(k) the least natural number not present among a(1) .. a(k-1).

%e For n=2, as A033879(2) = 1, which was already present at A033879(1), we set a(2) = a(1) = 1.

%e For n=3, as A033879(3) = 2, which is a new value not encountered before, we set a(3) = 1 + max(a(1),a(2)) = 2.

%e For n=4, as A033879(4) = 1, which was already present at n = 2 and n = 1, we set a(4) = a(1) = 1.

%e For n=5, as A033879(5) = 4, which is a new value not encountered before, we set a(5) = 1 + max(a(1),a(2),a(3),a(4)) = 3.

%e For n=12, as A033879(12) = -4, which is a new value not encountered before, we set a(12) = 1 + max(a(1),...,a(11)) = 8. Note that the sign matters here, -4 is not equal to +4 which was encountered already at n=5.

%o (PARI)

%o rgs_transform(invec) = { my(occurrences = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(occurrences,invec[i]), my(pp = mapget(occurrences, invec[i])); outvec[i] = outvec[pp] , mapput(occurrences,invec[i],i); outvec[i] = u; u++ )); outvec; };

%o write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }

%o A033879(n) = ((2*n)-sigma(n));

%o write_to_bfile(1,rgs_transform(vector(10000,n,A033879(n))),"b286449.txt");

%Y Cf. A000203, A033879, A033880, A286448, A286450, A286603.

%K nonn

%O 1,3

%A _Antti Karttunen_, May 13 2017

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 23 07:42 EDT 2024. Contains 371905 sequences. (Running on oeis4.)