A350313
The Redstone permutation: a(1) = 2, a(2) = 1, otherwise the smallest number not occurring earlier which is strongly prime to n.
Original entry on oeis.org
2, 1, 4, 5, 3, 7, 8, 9, 10, 11, 6, 13, 14, 15, 16, 17, 12, 19, 20, 21, 22, 23, 18, 25, 26, 27, 28, 29, 24, 31, 32, 33, 34, 35, 36, 37, 30, 39, 40, 41, 38, 43, 44, 45, 46, 47, 42, 49, 50, 51, 52, 53, 48, 55, 56, 57, 58, 59, 54, 61, 62, 63, 64, 65, 66, 67, 60, 69, 70
Offset: 1
Catch-up points and initial segments:
[ 2] 2, 1,
[ 5] 4, 5, 3,
[11] 7, 8, 9, 10, 11, 6,
[17] 13, 14, 15, 16, 17, 12,
[23] 19, 20, 21, 22, 23, 18,
[29] 25, 26, 27, 28, 29, 24,
[37] 31, 32, 33, 34, 35, 36, 37, 30,
[41] 39, 40, 41, 38,
[47] 43, 44, 45, 46, 47, 42,
[53] 49, 50, 51, 52, 53, 48,
...
-
s = {2, 1}, c[] = 0; Array[Set[c[s[[#]]], #] &, Length[s]]; j = Last[s]; u = 3; s~Join~Reap[Monitor[Do[If[j == u, While[c[u] > 0, u++]]; k = u; While[Nand[c[k] == 0, CoprimeQ[i, k], ! Divisible[i - 1, k]], k++]; Sow[k]; Set[c[k], i]; j = k, {i, Length[s] + 1, 69}], i]][[-1, -1]] (* _Michael De Vlieger, Dec 24 2021 *)
-
def generatePermutation(N, condition):
a = {1:2, 2:1}; n = Integer(2)
notYetOccured = [Integer(i) for i in range(3, N + 1)]
while notYetOccured != []:
n += 1
found = False
for r in notYetOccured:
if condition(r, n):
a[n] = r
notYetOccured.remove(r)
found = True
break
if not found: break
return [a[i] for i in range(1, n)]
def isPrimeTo(m, n): return gcd(m, n) == 1
def isStrongPrimeTo(m, n): return isPrimeTo(m, n) and not m.divides(n - 1)
print(generatePermutation(70, isStrongPrimeTo))
A370383
Number of permutations of [n] having no substring [k,k+1,k+2,k+3,k+4].
Original entry on oeis.org
1, 1, 2, 6, 24, 119, 717, 5026, 40242, 362376, 3625081, 39885851, 478714416, 6224078292, 87145277160, 1307271652917, 20917481850667, 355612235468396, 6401234296266540, 121626707638142280, 2432586885636105251, 51085230669413519349, 1123891538655073251190
Offset: 0
A370384
Number of permutations of [n] having no substring [k,k+1,k+2,k+3,k+4,k+5].
Original entry on oeis.org
1, 1, 2, 6, 24, 120, 719, 5037, 40306, 362802, 3628296, 39913080, 478970641, 6226733531, 87175347936, 1307641346772, 20922387099240, 355682119243320, 6402298503373917, 121643960874649867, 2432883613692550316, 51090627024035616300, 1123995015882951892680
Offset: 0
A383380
Expansion of e.g.f. exp(-2*x) / (1-x)^4.
Original entry on oeis.org
1, 2, 8, 40, 248, 1808, 15136, 142784, 1496960, 17254144, 216740864, 2945973248, 43065951232, 673626675200, 11224114860032, 198447384666112, 3710328985124864, 73136238041563136, 1515739708283944960, 32947698735175172096, 749499782353468522496, 17806903161183314378752
Offset: 0
A180185
Triangle read by rows: T(n,k) is the number of permutations of [n] having no 3-sequences and having k successions (0 <= k <= floor(n/2)); a succession of a permutation p is a position i such that p(i +1) - p(i) = 1.
Original entry on oeis.org
1, 1, 1, 1, 3, 2, 11, 9, 1, 53, 44, 9, 309, 265, 66, 3, 2119, 1854, 530, 44, 16687, 14833, 4635, 530, 11, 148329, 133496, 44499, 6180, 265, 1468457, 1334961, 467236, 74165, 4635, 53, 16019531, 14684570, 5339844, 934472, 74165, 1854, 190899411
Offset: 0
T(6,3)=3 because we have 125634, 341256, and 563412.
Triangle starts:
1;
1;
1, 1;
3, 2;
11, 9, 1;
53, 44, 9;
309, 265, 66, 3;
2119, 1854, 530, 44;
-
d[0] := 1: for n to 51 do d[n] := n*d[n-1]+(-1)^n end do: a := proc (n, k) if n = 0 and k = 0 then 1 elif k <= (1/2)*n then binomial(n-k, k)*d[n+1-k]/(n-k) else 0 end if end proc: for n from 0 to 12 do seq(a(n, k), k = 0 .. (1/2)*n) end do; # yields sequence in triangular form
-
d[0] = 1; d[n_] := d[n] = n d[n - 1] + (-1)^n;
T[n_, k_] := If[n == 0 && k == 0, 1, If[k <= n/2, Binomial[n - k, k] d[n + 1 - k]/(n - k), 0]];
Table[T[n, k], {n, 0, 20}, {k, 0, Quotient[n, 2]}] // Flatten (* Jean-François Alcover, May 23 2020 *)
-
d(n) = if(n<2, !n , round(n!/exp(1)));
for(n=0, 20, for(k=0, (n\2), print1(binomial(n - k, k)*(d(n - k) + d(n - k - 1)),", ");); print();) \\ Indranil Ghosh, Apr 12 2017
A195326
Numerators of fractions leading to e - 1/e (A174548).
Original entry on oeis.org
0, 2, 2, 7, 7, 47, 47, 5923, 5923, 426457, 426457, 15636757, 15636757, 7318002277, 7318002277, 1536780478171, 1536780478171, 603180793741, 603180793741, 142957467201379447, 142957467201379447
Offset: 0
a(0) = 1 - 1;
a(1) = 2 - 0;
a(2) = 5/2 - 1/2.
-
taylExp1 := proc(n)
add(1/j!,j=0..n) ;
end proc:
A000255 := proc(n)
if n <=1 then
1;
else
n*procname(n-1)+(n-1)*procname(n-2) ;
end if;
end proc:
A001048 := proc(n)
n!+(n-1)! ;
end proc:
A195326 := proc(n)
if n = 0 then
0;
elif n =1 then
2;
else
taylExp1(n) -A000255(n-2)/A001048(n-1);
end if;
numer(%);
end proc:
seq(A195326(n),n=0..20) ; # R. J. Mathar, Oct 14 2011
Material meant to be placed in other sequences removed by
R. J. Mathar, Oct 14 2011
A218538
Triangle read by rows: T(n,k) is the number of permutations of{1,2,...,n} avoiding [x,x+1] having genus k (see first comment for definition of genus).
Original entry on oeis.org
1, 1, 0, 3, 0, 0, 7, 4, 0, 0, 19, 29, 5, 0, 0, 53, 180, 76, 0, 0, 0, 153, 1004, 901, 61, 0, 0, 0, 453, 5035, 8884, 2315, 0, 0, 0, 0, 1367, 23653, 74177, 46285, 2847, 0, 0, 0, 0, 4191, 106414, 546626, 667640, 143586, 0, 0, 0, 0, 0, 13015, 463740, 3658723, 7777935, 3896494, 209624, 0
Offset: 1
Triangle starts:
[ 1] 1,
[ 2] 1, 0,
[ 3] 3, 0, 0,
[ 4] 7, 4, 0, 0,
[ 5] 19, 29, 5, 0, 0,
[ 6] 53, 180, 76, 0, 0, 0,
[ 7] 153, 1004, 901, 61, 0, 0, 0,
[ 8] 453, 5035, 8884, 2315, 0, 0, 0, 0,
[ 9] 1367, 23653, 74177, 46285, 2847, 0, 0, 0, 0,
[10] 4191, 106414, 546626, 667640, 143586, 0, 0, 0, 0, 0,
[11] 13015, 463740, 3658723, 7777935, 3896494, 209624, 0, 0, 0, 0, 0,
[12] 40857, 1972339, 22712736, 77535694, 74678363, 13959422, 0, 0, ...,
[13] 129441, 8228981, 132804891, 685673340, 1131199122, 485204757, 23767241, 0, ...,
...
Cf.
A177267 (genus of all permutations).
Cf.
A178514 (genus of derangements),
A178515 (genus of involutions),
A178516 (genus of up-down permutations),
A178517 (genus of non-derangement permutations),
A178518 (permutations of [n] having genus 0 and p(1)=k),
A185209 (genus of connected permutations).
A247490
Square array read by antidiagonals: A(k, n) = (-1)^(n+1)* hypergeom([k, -n+1], [], 1) for n>0 and A(k,0) = 0 (n>=0, k>=1).
Original entry on oeis.org
0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 2, 3, 2, 0, 1, 3, 7, 11, 9, 0, 1, 4, 13, 32, 53, 44, 0, 1, 5, 21, 71, 181, 309, 265, 0, 1, 6, 31, 134, 465, 1214, 2119, 1854, 0, 1, 7, 43, 227, 1001, 3539, 9403, 16687, 14833, 0, 1, 8, 57, 356, 1909, 8544, 30637, 82508, 148329, 133496
Offset: 0
k\n
[1], 0, 1, 0, 1, 2, 9, 44, 265, 1854, ... A000166
[2], 0, 1, 1, 3, 11, 53, 309, 2119, 16687, ... A000255
[3], 0, 1, 2, 7, 32, 181, 1214, 9403, 82508, ... A000153
[4], 0, 1, 3, 13, 71, 465, 3539, 30637, 296967, ... A000261
[5], 0, 1, 4, 21, 134, 1001, 8544, 81901, 870274, ... A001909
[6], 0, 1, 5, 31, 227, 1909, 18089, 190435, 2203319, ... A001910
[7], 0, 1, 6, 43, 356, 3333, 34754, 398959, 4996032, ... A176732
[8], 0, 1, 7, 57, 527, 5441, 61959, 770713, 10391023, ... A176733
The referenced sequences may have a different offset or other small deviations.
-
A := (k,n) -> `if`(n<2,n,hypergeom([k,-n+1],[],1)*(-1)^(n+1));
seq(print(seq(round(evalf(A(k,n),100)), n=0..8)), k=1..8);
-
from mpmath import mp, hyp2f0
mp.dps = 25; mp.pretty = True
def A247490(k, n):
if n < 2: return n
if k == 1 and n == 2: return 0 # (failed to converge)
return int((-1)^(n+1)*hyp2f0(k, -n+1, 1))
for k in (1..8): print([k], [A247490(k, n) for n in (0..8)])
A271698
Triangle read by rows, T(n,k) = Sum_{j=0..n} C(-j,-n)*E1(j,k), E1 the Eulerian numbers A173018, for n>=0 and 0<=k<=n.
Original entry on oeis.org
1, 1, 0, 0, 1, 0, 0, 2, 1, 0, 0, 2, 8, 1, 0, 0, 2, 28, 22, 1, 0, 0, 2, 72, 182, 52, 1, 0, 0, 2, 164, 974, 864, 114, 1, 0, 0, 2, 352, 4174, 8444, 3474, 240, 1, 0, 0, 2, 732, 15782, 61464, 57194, 12660, 494, 1, 0, 0, 2, 1496, 55286, 373940, 660842, 332528, 43358, 1004, 1, 0
Offset: 0
Triangle starts:
1,
1, 0,
0, 1, 0,
0, 2, 1, 0,
0, 2, 8, 1, 0,
0, 2, 28, 22, 1, 0,
0, 2, 72, 182, 52, 1, 0,
0, 2, 164, 974, 864, 114, 1, 0
-
A271698 := (n,k) -> add(binomial(-j,-n)*combinat:-eulerian1(j,k), j=0..n):
seq(seq(A271698(n, k), k=0..n), n=0..10);
-
<
A316666
Number of simple relaxed compacted binary trees of right height at most one with no sequences on level 1 and no final sequences on level 0.
Original entry on oeis.org
1, 0, 1, 3, 15, 87, 597, 4701, 41787, 413691, 4512993, 53779833, 695000919, 9680369943, 144560191149, 2303928046437, 39031251610227, 700394126116851, 13270625547477177, 264748979672169681, 5547121478845459983, 121784530649198053263, 2795749225338111831429, 66981491857058929294653
Offset: 0
- G. C. Greubel, Table of n, a(n) for n = 0..448
- Antoine Genitrini, Bernhard Gittenberger, Manuel Kauers and Michael Wallner, Asymptotic Enumeration of Compacted Binary Trees, arXiv:1703.10031 [math.CO], 2017.
- Michael Wallner, A bijection of plane increasing trees with relaxed binary trees of right height at most one, arXiv:1706.07163 [math.CO], 2017.
-
m:=25; R:=PowerSeriesRing(Rationals(), m); b:=Coefficients(R!( (3*Exp(-x) + x-2)/(1-x)^2 )); [Factorial(n-1)*b[n]: n in [1..m]]; // G. C. Greubel, Dec 12 2018
-
aseq := n-> 3*round((n+2)*n!/exp(1))-(n+2)*n!: bseq := n-> (n+2)*n!- 2* round((n+2)*n!/exp(1)): s := (a,b,n)-> a*aseq(n) + b*bseq( n): seq(s(1,0,n),n = 0..20); # Gary Detlefs, Dec 11 2018
-
terms = 24;
CoefficientList[(3E^-z+z-2)/(1-z)^2 + O[z]^terms, z] Range[0, terms-1]! (* Jean-François Alcover, Sep 14 2018 *)
-
Vec(serlaplace((3*exp(-x + O(x^25)) + x - 2)/(1 - x)^2)) \\ Andrew Howroyd, Jul 10 2018
Comments