OFFSET
1,2
COMMENTS
Equivalently, this is the ORDINAL transform of Van Eck's sequence A181391. - N. J. A. Sloane, Apr 09 2020
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
Rémy Sigrist, C++ program for A200780
MAPLE
# The ORDINAL transform of a sequence a[0], a[1], a[2], ... is the sequence b[0], b[1], b[2], ... where b[n] is the number of times a[n] has occurred in [a[0], ..., a[n]].
ORDINAL:=proc(a) local b, t1, tlist, clist, n, t, nt;
if whattype(a) <> list then RETURN([]); fi:
t1:=nops(a);
tlist:=[];
clist:=Array(1..t1, 0);
b:=[]; nt:=0;
for n from 1 to t1 do t:=a[n];
if member(t, tlist, 'p') then clist[p] := clist[p]+1; b:=[op(b), clist[p]];
else nt:=nt+1; tlist:=[op(tlist), t]; clist[nt]:=1; b:=[op(b), 1]; fi;
od: b; end: # N. J. A. Sloane, Apr 09 2020
See also A200779.
PROG
(C++) See Links section.
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Nov 22 2011
STATUS
approved