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!)
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():
seq(a(n), n=1..120); # Alois P. Heinz, Mar 15 2014
MATHEMATICA
a[_] = 0; nmax = 120;
Do[a[i+1] = 1 + a[Sum[Boole[a[j] == a[i]], {j, 1, i}]], {i, 1, nmax-1}];
Table[a[n], {n, 1, nmax}] (* Jean-François Alcover, Apr 28 2022 *)
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
Sequence in context: A065531 A366574 A256558 * A024936 A144590 A057368
KEYWORD
nonn
AUTHOR
STATUS
approved

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 March 28 13:42 EDT 2024. Contains 371254 sequences. (Running on oeis4.)