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!)
A354856 a(1) = 1, a(n) = the number of times a(n-1) appears among the first n-2 terms. 0
1, 0, 0, 1, 1, 2, 0, 2, 1, 3, 0, 3, 1, 4, 0, 4, 1, 5, 0, 5, 1, 6, 0, 6, 1, 7, 0, 7, 1, 8, 0, 8, 1, 9, 0, 9, 1, 10, 0, 10, 1, 11, 0, 11, 1, 12, 0, 12, 1, 13, 0, 13, 1, 14, 0, 14, 1, 15, 0, 15, 1, 16, 0, 16, 1, 17, 0, 17, 1, 18, 0, 18, 1, 19, 0, 19, 1, 20, 0, 20 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,6
LINKS
FORMULA
a(4n+1..4n+4) = 1, n+1, 0, n+1 for n >= 1. - Michael S. Branicky, Jun 12 2022
EXAMPLE
a(10) = 3 because a(9) = 1 and 3 other 1s appear before that.
PROG
(Python)
from collections import Counter
from itertools import count, islice
def agen(): # generator of terms
anprev, an, inventory = None, 1, Counter()
for n in count(2):
yield an
anprev, an = an, inventory[an]
inventory[anprev] += 1
print(list(islice(agen(), 80))) # Michael S. Branicky, Jun 09 2022
(PARI) lista(nn) = my(va=vector(nn)); va[1] = 1; for (n=2, nn, my(vb = vector(n-2, k, va[k])); va[n] = #select(x->(x==va[n-1]), vb); ); va; \\ Michel Marcus, Jun 13 2022
CROSSREFS
Sequence in context: A355739 A324285 A138036 * A055136 A074397 A345039
KEYWORD
nonn
AUTHOR
Eric Fox, Jun 09 2022
EXTENSIONS
a(54) and beyond from Michael S. Branicky, Jun 12 2022
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 April 30 05:47 EDT 2024. Contains 372119 sequences. (Running on oeis4.)