login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A327891 Table of A(n,k) read by antidiagonals, where A(n,1)=n-1; A(n,k) is the number of occurrences of A(n,k-1) in the row up to k-1. 1

%I

%S 0,1,1,1,1,2,2,2,1,3,1,1,1,1,4,3,3,2,1,1,5,1,1,2,2,1,1,6,4,4,3,1,2,1,

%T 1,7,1,1,1,3,1,2,1,1,8,5,5,3,2,3,1,2,1,1,9,1,1,2,2,1,3,1,2,1,1,10,6,6,

%U 4,3,4,1,3,1,2,1,1,11,1,1,1,3,2,4,1

%N Table of A(n,k) read by antidiagonals, where A(n,1)=n-1; A(n,k) is the number of occurrences of A(n,k-1) in the row up to k-1.

%C The terms of each row are quasi-periodic. Starting with n=3, the period starts at k=((n-1)^2)-1. The period is 2*(n-1) long, and we can find its terms with a simple mod function.

%C The second row is A158416.

%e Table begins:

%e 0, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, ...

%e 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, ...

%e 2, 1, 1, 2, 2, 3, 1, 3, 2, 4, 1, 4, 2, 5, 1, 5, ...

%e 3, 1, 1, 2, 1, 3, 2, 2, 3, 3, 4, 1, 4, 2, 4, 3, ...

%e 4, 1, 1, 2, 1, 3, 1, 4, 2, 2, 3, 2, 4, 3, 3, 4, ...

%e 5, 1, 1, 2, 1, 3, 1, 4, 1, 5, 2, 2, 3, 2, 4, 2, ...

%e 6, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 2, 2, 3, 2, ...

%e 7, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 2, 2, ...

%e 8, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, ...

%o (VBA/Excel)

%o Sub A327891()

%o For m = 2 To 40

%o For i = 2 To 40

%o Cells(m, 1) = m - 2

%o Cells(m, 2) = 1

%o k = Cells(m, i)

%o For j = i - 1 To 1 Step -1

%o If k = Cells(m, j) Then

%o Cells(m, i + 1) = 1 + Cells(m, j + 1)

%o Exit For

%o Else

%o Cells(m, i + 1) = 1

%o End If

%o Next j

%o Next i

%o Next m

%o S = 1

%o For m = 3 To 40

%o For k = m - 2 To 1 Step -1

%o n = m - k

%o Cells(1, S) = Cells(n, k)

%o S = S + 1

%o Next k

%o Next m

%o End Sub

%Y The second row is A158416.

%K nonn,tabl

%O 1,6

%A _Ali Sada_, Oct 02 2019

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 22 07:26 EDT 2021. Contains 343163 sequences. (Running on oeis4.)