cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A286449 #16 May 31 2024 20:42:09
%S A286449 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 A286449 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 A286449 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 A286449 Restricted growth sequence computed for A033879 (deficiency), or equally, for A033880 (abundance of n).
%H A286449 Antti Karttunen, <a href="/A286449/b286449.txt">Table of n, a(n) for n = 1..10000</a>
%H A286449 <a href="/index/Si#SIGMAN">Index entries for sequences related to sigma(n)</a>
%e A286449 We start by setting a(1) = 1 for A033879(1) = 1. Then, 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 A286449 For n=2, as A033879(2) = 1, which was already present at A033879(1), we set a(2) = a(1) = 1.
%e A286449 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 A286449 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 A286449 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 A286449 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 A286449 (PARI)
%o A286449 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 A286449 write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
%o A286449 A033879(n) = ((2*n)-sigma(n));
%o A286449 write_to_bfile(1,rgs_transform(vector(10000,n,A033879(n))),"b286449.txt");
%Y A286449 Cf. A000203, A033879, A033880, A286448, A286450, A286603.
%K A286449 nonn
%O A286449 1,3
%A A286449 _Antti Karttunen_, May 13 2017