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.

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.

This page as a plain text file.
%I A071059 #24 Sep 21 2023 14:16:38
%S A071059 1,1,1,1,1,2,2,6,4,7,6,11,11,53,53,181,171,939,925,4432,4545,15811,
%T A071059 15583,67891,68193,434963,388975,2718150,3113343,21580655,18425145,
%U A071059 92370364,94887088,564878656,572364768,4545704064,4092294083,36878092180,36363930614
%N 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.
%H A071059 Martin Fuller, <a href="/A071059/b071059.txt">Table of n, a(n) for n = 1..70</a>
%F A071059 a(2n) = A071058(2n).
%e A071059 a(6)=2 because there are two ways: 2+9, 4+7, 6+11 and 2+11, 4+9, 6+7.
%p A071059 f:= proc(n) local m;
%p A071059   m:= floor(n/2);
%p A071059  LinearAlgebra:-Permanent(Matrix(m,m,
%p A071059     (i,j) -> `if`(isprime((i+j-2)*2 + n + 3 + (n mod 2)),1,0)))
%p A071059 end proc:
%p A071059 f(1):= 1:
%p A071059 map(f, [$1..40]); # _Robert Israel_, Sep 21 2023
%t A071059 a[n_] := a[n] = If[n == 1, 1, Module[{s1, s2, s3, s4, i, ik, km},
%t A071059 s1 = Select[Flatten[Outer[List, Range[2, n, 2], Range[2n-1, n+1, -2]], 1], PrimeQ[Total[#]]&];
%t A071059 s2 = SplitBy[s1, First];
%t A071059 km = Length[s2];
%t A071059 ik = Table[{i[k], 1, Length[s2[[k]]]}, {k, 1, km}];
%t A071059 s3 = Table[Table[s2[[k, i[k]]], {k, 1, km}], Evaluate[Sequence @@ ik]] // Flatten[#, km - 1]&;
%t A071059 s4 = Select[s3, Length[Union[Flatten[#]]] == 2km&];
%t A071059 s4 // Length]];
%t A071059 Table[Print[n, " ", a[n]]; a[n], {n, 1, 20}] (* _Jean-François Alcover_, Aug 10 2022 *)
%o A071059 (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
%Y A071059 The product of this sequence and A071058 gives A070897.
%K A071059 nice,nonn
%O A071059 1,6
%A A071059 _T. D. Noe_, May 25 2002
%E A071059 More terms from _David W. Wilson_, May 27 2002
%E A071059 a(31)-a(37) from _Donovan Johnson_, Aug 12 2010