cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A346778 #29 Aug 11 2022 08:55:20
%S A346778 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,
%T A346778 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,
%U A346778 1,17,1,18,18,1,1,4,6,8,10,1,1,4,6,1,8,19
%N 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.
%C A346778 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}.
%C A346778 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
%H A346778 Sean A. Irvine, <a href="/A346778/b346778.txt">Table of n, a(n) for n = 1..10000</a>
%H A346778 Sean A. Irvine, <a href="https://github.com/archmageirvine/joeis/blob/master/src/irvine/oeis/a346/A346778.java">Java program</a> (github)
%H A346778 Peter Munn, <a href="https://oeis.org/plot2a?name1=A346778&amp;name2=A000027&amp;tform1=untransformed&amp;tform2=untransformed&amp;shift=0&amp;radiop1=ratio&amp;drawlines=true">Plot of sequence terms as a proportion of n</a>
%t A346778 (* t is A088643 *)
%t A346778 t[n_, 1] := n;
%t A346778 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]]];
%t A346778 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]]]]];
%t A346778 Table[a[n], {n, 1, 400}] (* _Jean-François Alcover_, Aug 11 2022, after _M. F. Hasler_ *)
%o A346778 (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
%Y A346778 Cf. A049476, A049477, A049478, A088643.
%K A346778 nonn
%O A346778 1,5
%A A346778 _Sean A. Irvine_, Aug 03 2021
%E A346778 Definition corrected by _M. F. Hasler_, Aug 03 2021