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!)
A346778 Least k >= 1 such that {b(1), b(2), ..., b(k)} = {n, n-1, ..., n-k+1} and b(k+1) = n-k where b(1..n) is row n of A088643, or k = 0 if no such k >= 1 exists. 5
0, 1, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1, 6, 12, 1, 1, 4, 6, 1, 8, 1, 1, 4, 1, 6, 22, 1, 9, 10, 1, 1, 4, 6, 1, 8, 1, 1, 4, 6, 1, 8, 1, 18, 9, 1, 9, 10, 16, 1, 18, 1, 1, 4, 1, 1, 4, 1, 6, 12, 11, 27, 14, 62, 1, 17, 1, 18, 18, 1, 1, 4, 6, 8, 10, 1, 1, 4, 6, 1, 8, 19 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,5
COMMENTS
Equivalently, least k such that {b(1), b(2), ..., b(k)} = {n, n-1, ..., n-k+1} and {b(1), b(2), ..., b(k), b(k+1)} = {n, n-1, ..., n-k+1, n-k}.
Since any row n of A088643 is a permutation of [1..n] having 1 as last term (conjectured), one always has a(n) <= n - 1. - M. F. Hasler, Aug 04 2021
LINKS
Sean A. Irvine, Java program (github)
MATHEMATICA
(* t is A088643 *)
t[n_, 1] := n;
t[n_, k_] := t[n, k] = For[m = n-1, m >= 1, m--, If[PrimeQ[m + t[n, k-1]] && FreeQ[Table[t[n, j], {j, 1, k-1}], m], Return[m]]];
a[n_] := If[n == 1, 0, Module[{r, g}, r = Table[t[n, k], {k, 1, n}]; For[g = 1, g <= n-1, g++, If[Union@r[[1 ;; g]] == Range[n-g+1, n] && r[[g+1]] == n-g, Return[g]]]]];
Table[a[n], {n, 1, 400}] (* Jean-François Alcover, Aug 11 2022, after M. F. Hasler *)
PROG
(PARI) apply( {A346778(n, r=A088643_row(n))=for(g=1, n-1, Set(r[1..g])==[n-g+1..n] && r[g+1]==n-g && return(g))}, [1..99]) \\ M. F. Hasler, Aug 04 2021
CROSSREFS
Sequence in context: A333807 A069289 A341309 * A097322 A177023 A214333
KEYWORD
nonn
AUTHOR
Sean A. Irvine, Aug 03 2021
EXTENSIONS
Definition corrected by M. F. Hasler, Aug 03 2021
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 24 22:17 EDT 2024. Contains 371964 sequences. (Running on oeis4.)