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!)
A364604 Lexicographically earliest sequence, where after every appearance, a term is banned from re-appearing for twice as long as last time; first appearance bans it for 1 term. 3
1, 2, 1, 2, 3, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 4, 3, 5, 1, 2, 4, 6, 5, 7, 6, 3, 7, 8, 9, 4, 6, 5, 7, 8, 9, 1, 2, 7, 8, 6, 9, 10, 3, 8, 10, 9, 4, 7, 5, 10, 11, 12, 8, 11, 9, 10, 6, 11, 12, 13, 14, 12, 11, 13, 7, 10, 12, 13, 1, 2, 8, 9, 11, 13, 14, 3, 12, 14, 15, 4, 15, 5, 10, 13, 14, 15, 16 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
EXAMPLE
a(n) ban 1 2 3 4 5 6 ...
1 | | | | | |
2 x | | | | |
1 | x | | | |
2 x | | | | |
3 x x | | | |
1 | x x | | |
2 x | | | | |
3 x x | | | |
4 x x x | | |
5 x x x x | |
1 | x | | x |
2 x | | | | |
3 x x | | | |
4 x x x | | |
5 x x x x | |
6 x x x x x |
4 x x x | x x
3 x x | x | |
5 x x x x | |
1 | x x x x |
.
.
.
PROG
(PARI) A364604(N) = {my(a=vector(N), z=1); for(s=1, N, if(a[s], next); my(m=-1); for(i=s, N, if(!a[i], a[i]=z; i+=(1<<(m++)))); z++); a}
(Python)
def A364604(N):
a = [0]*N; z=s=0
while(s<N):
z+=1; m=0; i=s
while(i<N):
if not a[i]:
a[i]=z; i+=2**m; m+=1
i+=1
s+=1
return a
CROSSREFS
Sequence in context: A243613 A194844 A138528 * A037125 A194029 A194055
KEYWORD
nonn
AUTHOR
Rok Cestnik, Jul 29 2023
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 August 10 23:32 EDT 2024. Contains 375059 sequences. (Running on oeis4.)