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.

Showing 1-3 of 3 results.

A291563 Number of partitions of 2n into two prime parts or two nonprime parts.

Original entry on oeis.org

1, 1, 1, 2, 4, 3, 4, 6, 6, 6, 8, 9, 9, 9, 11, 9, 13, 15, 10, 14, 16, 14, 16, 19, 18, 17, 21, 18, 20, 25, 18, 24, 27, 19, 26, 28, 25, 27, 32, 26, 28, 35, 29, 29, 39, 30, 32, 38, 30, 37, 41, 35, 37, 42, 38, 41, 47, 40, 40, 54, 38, 42, 53, 39, 48, 52, 46, 46
Offset: 1

Views

Author

Wesley Ivan Hurt, Oct 20 2017

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> n-add(`if`(isprime(n+i) xor isprime(n-i), 1, 0), i=1..n-1):
    seq(a(n), n=1..80);  # Alois P. Heinz, Mar 05 2021
  • Mathematica
    Table[Sum[KroneckerDelta[(PrimePi[k] - PrimePi[k - 1]), (PrimePi[2 n - k] - PrimePi[2 n - 1 - k])], {k, n}], {n, 80}]

Formula

a(n) = Sum_{i=1..n} [A010051(i) = A010051(2n-i)], where [] is the Iverson bracket.
a(n) = n - A291564(n).

A342155 Number of partitions of [2n] into pairs such that either their sum or their absolute difference is a prime (but not both).

Original entry on oeis.org

1, 1, 2, 3, 7, 26, 55, 282, 1520, 2685, 27005, 171474, 768123, 5936728, 43976303, 207493790, 2570789335, 21669733984, 136340261314, 1639978185920
Offset: 0

Views

Author

Alois P. Heinz, Mar 02 2021

Keywords

Examples

			a(4) = 7:
  {{1,8}, {2,7}, {3,5}, {4,6}},
  {{1,8}, {2,7}, {3,4}, {5,6}},
  {{1,8}, {2,4}, {3,6}, {5,7}},
  {{1,8}, {2,3}, {4,6}, {5,7}},
  {{1,8}, {2,4}, {3,5}, {6,7}},
  {{1,3}, {2,4}, {5,7}, {6,8}},
  {{1,2}, {3,4}, {5,7}, {6,8}}.
		

Crossrefs

Programs

  • Maple
    b:= proc(s) option remember; `if`(s={}, 1, (j-> add(`if`(i 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 && (PrimeQ[j + i] ~Xor~ PrimeQ[j - i]), 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 *)

A306878 Number of 0 < k < n such that n-k and n+k are both nonprimes.

Original entry on oeis.org

0, 0, 0, 0, 2, 1, 2, 3, 3, 3, 5, 5, 6, 6, 7, 6, 9, 10, 8, 10, 11, 10, 12, 13, 13, 13, 15, 14, 16, 18, 15, 18, 20, 16, 20, 21, 20, 21, 24, 21, 23, 26, 24, 24, 29, 25, 27, 30, 26, 30, 32, 29, 31, 33, 31, 33, 36, 33, 34, 41, 34, 36, 42, 35, 40, 42, 40, 40, 43, 42, 44, 48, 44, 44
Offset: 1

Views

Author

Gionata Neri, Mar 14 2019

Keywords

Crossrefs

Programs

  • PARI
    a(n)=my(s); for(c=1, n-1, s+=(bigomega(n-c)-1)*(bigomega(n+c)-1)!=0); s

Formula

a(n) = n - 1 - A061357(n) - A291564(n).
Showing 1-3 of 3 results.