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!)
A071059 Number of ways of pairing even numbers in the range 1 to n with odd numbers in the range n+1 to 2n such that each pair sums to a prime. 3
1, 1, 1, 1, 1, 2, 2, 6, 4, 7, 6, 11, 11, 53, 53, 181, 171, 939, 925, 4432, 4545, 15811, 15583, 67891, 68193, 434963, 388975, 2718150, 3113343, 21580655, 18425145, 92370364, 94887088, 564878656, 572364768, 4545704064, 4092294083, 36878092180, 36363930614 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,6
LINKS
FORMULA
a(2n) = A071058(2n).
EXAMPLE
a(6)=2 because there are two ways: 2+9, 4+7, 6+11 and 2+11, 4+9, 6+7.
MAPLE
f:= proc(n) local m;
m:= floor(n/2);
LinearAlgebra:-Permanent(Matrix(m, m,
(i, j) -> `if`(isprime((i+j-2)*2 + n + 3 + (n mod 2)), 1, 0)))
end proc:
f(1):= 1:
map(f, [$1..40]); # Robert Israel, Sep 21 2023
MATHEMATICA
a[n_] := a[n] = If[n == 1, 1, Module[{s1, s2, s3, s4, i, ik, km},
s1 = Select[Flatten[Outer[List, Range[2, n, 2], Range[2n-1, n+1, -2]], 1], PrimeQ[Total[#]]&];
s2 = SplitBy[s1, First];
km = Length[s2];
ik = Table[{i[k], 1, Length[s2[[k]]]}, {k, 1, km}];
s3 = Table[Table[s2[[k, i[k]]], {k, 1, km}], Evaluate[Sequence @@ ik]] // Flatten[#, km - 1]&;
s4 = Select[s3, Length[Union[Flatten[#]]] == 2km&];
s4 // Length]];
Table[Print[n, " ", a[n]]; a[n], {n, 1, 20}] (* Jean-François Alcover, Aug 10 2022 *)
PROG
(PARI) a(n)=matpermanent(matrix(n\2, n\2, i, j, isprime((i+j-2)*2+n+3+(n%2)))); \\ Martin Fuller, Sep 21 2023
CROSSREFS
The product of this sequence and A071058 gives A070897.
Sequence in context: A067804 A074911 A174222 * A256468 A061108 A284918
KEYWORD
nice,nonn
AUTHOR
T. D. Noe, May 25 2002
EXTENSIONS
More terms from David W. Wilson, May 27 2002
a(31)-a(37) from Donovan Johnson, Aug 12 2010
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 23 11:35 EDT 2024. Contains 371912 sequences. (Running on oeis4.)