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!)
A342139 Number of partitions of [2n] into pairs whose sums or differences are primes. 2
1, 1, 3, 8, 28, 167, 810, 4664, 38344, 207255, 2059900, 19385131, 174417011, 1922011637, 21058799803, 208257199434, 2905150193223, 38462668421772, 481607876817202, 7526871509864950 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
EXAMPLE
a(2) = 3: {{1,4}, {2,3}}, {{1,3}, {2,4}}, {{1,2}, {3,4}}.
MAPLE
b:= proc(s) option remember; `if`(s={}, 1, (j-> add(`if`(i<j and
ormap(isprime, [j+i, j-i]), b(s minus {i, j}), 0), i=s))(max(s)))
end:
a:= n-> b({$1..2*n}):
seq(a(n), n=0..15);
MATHEMATICA
b[s_] := b[s] = If[s == {}, 1, With[{j = Max[s]}, Sum[If[i < j && AnyTrue[{j+i, j-i}, PrimeQ], b[s ~Complement~ {i, j}], 0], {i, s}]]];
a[n_] := b[Range[2n]];
a /@ Range[0, 15] (* Jean-François Alcover, Aug 25 2021, after Alois P. Heinz *)
CROSSREFS
Sequence in context: A000239 A268302 A345177 * A195687 A060707 A080874
KEYWORD
nonn,more
AUTHOR
Alois P. Heinz, Mar 01 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 26 21:53 EDT 2024. Contains 372004 sequences. (Running on oeis4.)