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!)
A354830 a(n) is the number of permutations p of [n] such that gcd(i, p(i)) > 1 for 2 <= i <= n. 1
1, 1, 1, 1, 2, 2, 8, 8, 30, 72, 408, 408, 4104, 4104, 29640, 208704, 1437312, 1437312, 22653504, 22653504, 318695040, 2686493376, 27628410816, 27628410816, 575372874240, 1775480841216, 21115550048256, 132879856582656, 2321256928702464, 2321256928702464, 83095013944442880 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,5
LINKS
Carl Pomerance, Coprime permutations, arXiv:2203.03085 [math.NT], 2022. See TABLE 3.
FORMULA
a(p) = a(p-1) for primes p.
PROG
(Ruby)
def search(a, num, n)
if num == n + 1
@cnt += 1
else
(1..n).each{|i|
if a[i] == 0
if i == 1 || i.gcd(num) > 1
a[i] = num
search(a, num + 1, n)
a[i] = 0
end
end
}
end
end
def A(n)
a = [0] * (n + 1)
@cnt = 0
search(a, 1, n)
@cnt
end
def A354830(n)
(0..n).map{|i| A(i)}
end
p A354830(15)
(PARI) a(n) = { my (v=select(x -> (!isprime(x)) || (2*x<=n), [2..n])); matpermanent(matrix(#v, #v, i, j, gcd(v[i], v[j])>1)) } \\ Rémy Sigrist, Jun 07 2022
CROSSREFS
Cf. A320843.
Sequence in context: A120544 A155950 A162959 * A158302 A007083 A281019
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Jun 07 2022
EXTENSIONS
More terms from Rémy Sigrist, Jun 07 2022
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 July 20 09:46 EDT 2024. Contains 374445 sequences. (Running on oeis4.)