The OEIS is supported by the many generous donors to the OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A350559 Numerators of the fractional, multiplicative Van Eck Sequence f(n): for n >= 2, if there exists an m < n such that f(m) = f(n), take the largest such m. If f(n)=1, set f(n+1) = 1/(n-m); otherwise, if f(n) != 1, set f(n+1) = f(n)+f(m)(n-m). If no m exists such that a(m)= f(n), then set f(n+1)=1. Start with f(1)=1 and f(2)=0. a(n) = numerator(f(n)). 1

%I #23 Feb 11 2022 17:06:11

%S 1,0,1,1,1,1,3,1,1,1,1,3,1,1,2,1,1,4,1,1,4,16,1,1,1,1,8,1,1,10,1,1,4,

%T 52,1,1,13,1,1,8,1,1,4,44,1,1,11,1,1,8,88,1,1,2,80,1,1,5,1,1,4,1,1,4,

%U 88,440,1,1,1,1,45,1,1,11,1,1,4,56,1,1,6,1

%N Numerators of the fractional, multiplicative Van Eck Sequence f(n): for n >= 2, if there exists an m < n such that f(m) = f(n), take the largest such m. If f(n)=1, set f(n+1) = 1/(n-m); otherwise, if f(n) != 1, set f(n+1) = f(n)+f(m)(n-m). If no m exists such that a(m)= f(n), then set f(n+1)=1. Start with f(1)=1 and f(2)=0. a(n) = numerator(f(n)).

%e f(n) = [ 1, 0, 1, 1/2, 1, 1/2, 3/2, 1, 1/3, 1, …]

%t f[1]=1; f[n_]:=0; f2[n_]:=0; a[n_]:=Block[{q=f2[x]},If[q!=0, If[x==1,s[n]=1/(n-1-q),s[n]=((n-1-q)*(x))+x], s[n]=1]]; s[1]=1; s[2]=0; x=0; Do[x=a[n]; f2[x]=f[x]; f[x]=n, {n, 3, 100000}]; data=Numerator/@Table[s[n], {n, 1, 100000}];

%o (Python)

%o from fractions import Fraction

%o from itertools import count, islice

%o def rfind(lst, item): # find item in list before last index

%o idx = len(lst) - 2

%o while lst[idx] != None and lst[idx] != item: idx -= 1

%o return idx

%o def agen(): # generator of terms

%o f = [None, Fraction(1, 1), Fraction(0, 1)]

%o yield from [1, 0]

%o for n in count(2):

%o m = rfind(f, f[n])

%o if m > 0: fp = Fraction(1, n-m) if f[n] == 1 else f[n] + f[m]*(n-m)

%o else: fp = Fraction(1, 1)

%o f.append(fp)

%o yield fp.numerator

%o print(list(islice(agen(), 82))) # _Michael S. Branicky_, Jan 16 2022

%o (PARI) findm(list, n) = {forstep (m=n-1, 1, -1, if (list[m] == list[n], return(m))); return(0);}

%o listf(nn) = {my(list = List([1, 0])); for (n=3, nn, my(m = findm(list, n-1)); if (m, if (list[m] == 1, listput(list, 1/(n-1-m)), listput(list, list[n-1]*(n-m))), listput(list, 1););); Vec(list);}

%o listnum(nn) = apply(numerator, listf(nn)); \\ _Michel Marcus_, Jan 17 2022

%Y Cf. A350228, A350560 (denominators).

%K nonn,frac

%O 1,7

%A _Jasmine Miller_, Jan 05 2022

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.

Last modified February 29 08:54 EST 2024. Contains 370418 sequences. (Running on oeis4.)