

A200780


a(n) = number of i in the range 1 <= i <= n such that b(i)=b(n), where b is the sequence A181391 taken with offset 1.


1



1, 2, 1, 3, 1, 4, 2, 3, 2, 1, 5, 1, 6, 4, 2, 2, 1, 7, 3, 1, 8, 2, 5, 1, 9, 2, 2, 3, 3, 1, 10, 4, 4, 4, 1, 11, 5, 5, 6, 6, 1, 12, 5, 1, 13, 6, 1, 14, 7, 8, 3, 1, 15, 7, 2, 1, 16, 3, 1, 17, 9, 2, 1, 18, 4, 1, 19, 10, 2, 11, 7, 1, 20, 6, 2, 12, 7, 13, 8, 2, 1, 21, 3, 1, 22, 14, 3, 3, 1, 23, 8, 1, 24, 15, 4, 5, 4
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


COMMENTS



LINKS



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;


PROG

(C++) See Links section.


CROSSREFS



KEYWORD

nonn


AUTHOR



STATUS

approved



