|
|
A239281
|
|
a(1) = 0; for n>1, a(n) is one more than the value of the sequence at index the number of times a(n-1) has previously appeared in the sequence.
|
|
1
|
|
|
0, 1, 1, 2, 1, 2, 2, 2, 3, 1, 3, 2, 2, 3, 2, 3, 3, 2, 3, 3, 3, 3, 4, 1, 2, 4, 2, 2, 4, 2, 3, 2, 3, 4, 3, 3, 3, 4, 2, 4, 3, 3, 4, 3, 4, 3, 3, 4, 4, 2, 3, 4, 4, 3, 4, 3, 4, 4, 3, 5, 1, 3, 2, 4, 4, 4, 3, 3, 5, 2, 4, 4, 4, 4, 4, 5, 2, 3, 3, 3, 5, 3, 3, 4, 2, 4, 3, 3, 4, 5, 2, 4, 3, 5, 3, 4, 3, 4, 5, 3
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,4
|
|
COMMENTS
|
The same sequence is obtained by looking at the values following each occurrence of each positive integer; and that sequence is this sequence plus one.
Every positive integer occurs infinitely many times. - Ivan Neretin, May 02 2016
|
|
LINKS
|
|
|
MAPLE
|
a:= proc() local a, c, t;
c:= proc() 0 end; c(0):=1;
a:= proc(n) option remember;
if n=1 then 0
else t:= 1+a(c(a(n-1)));
c(t):= c(t)+1; t
fi
end
end():
|
|
MATHEMATICA
|
a[_] = 0; nmax = 120;
Do[a[i+1] = 1 + a[Sum[Boole[a[j] == a[i]], {j, 1, i}]], {i, 1, nmax-1}];
|
|
PROG
|
(PARI) al(n)={local(r=vector(n), i, j);
for(i=1, n-1, r[i+1]=1+r[sum(j=1, i, if(r[j]==r[i], 1, 0))]);
r}
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|