The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A362746 a(1)=a(2)=1; a(n)=The count of all occurrences in the list so far where integer a(n-1) appears adjacent to integer a(n-2). 3
1, 1, 2, 1, 2, 2, 2, 3, 1, 1, 4, 1, 2, 3, 2, 3, 3, 2, 4, 1, 3, 2, 5, 1, 1, 6, 1, 2, 4, 2, 3, 6, 1, 3, 3, 4, 1, 4, 4, 2, 4, 4, 4, 5, 1, 2, 5, 2, 3, 7, 1, 1, 8, 1, 2, 6, 1, 4, 5, 2, 4, 5, 3, 1, 4, 6, 1, 5, 3, 2, 8, 1, 3, 5, 3, 4, 2, 6, 2, 3, 9, 1, 1, 10, 1, 2, 7 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
EXAMPLE
a(1) = 1.
a(2) = 1.
a(3) = 2. How many 1's so far are adjacent to a 1? = 2.
a(4) = 1. How many 2's so far are adjacent to a 1? = 1.
a(5) = 2. How many 1's so far are adjacent to a 2? = 2.
a(6) = 2. How many 2's so far are adjacent to a 1? = 2.
MATHEMATICA
K = {1, 1}; While[Length@K < 87, A = Position[K, Last@K]; c = 0; For[a = 1, a <= Length@A, a++, If[K[[A[[a]] - 1]] == {K[[Length@K - 1]]} || K[[A[[a]] + 1]] == {K[[Length@K - 1]]}, c++]]; AppendTo[K, c]]; Print[K] (* Samuel Harkness, May 08 2023 *)
PROG
(Python)
from itertools import islice
from collections import Counter
def agen(): # generator of terms
aprev, an, anext, c = 0, 1, 1, Counter({(1, 1)})
while True:
aprev, an, anext = an, anext, c[an, anext]
c[an, anext] += 1
if aprev != anext: c[anext, an] += 1
yield an
print(list(islice(agen(), 100))) # Michael S. Branicky, May 02 2023
CROSSREFS
Sequence in context: A318662 A073610 A285797 * A131840 A179752 A085693
KEYWORD
nonn,easy,look
AUTHOR
Gavin Lupo, May 01 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 June 11 03:41 EDT 2024. Contains 373288 sequences. (Running on oeis4.)