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.

A283929 Number of ways of writing n as a sum of a twin prime (A001097) and a squarefree semiprime (A006881).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 2, 0, 1, 0, 3, 1, 2, 1, 2, 1, 2, 1, 3, 2, 3, 2, 3, 0, 2, 2, 3, 2, 2, 1, 3, 3, 4, 3, 4, 2, 3, 3, 4, 4, 2, 1, 3, 3, 5, 4, 4, 2, 3, 3, 4, 4, 1, 2, 1, 5, 4, 5, 6, 2, 4, 5, 5, 4, 2, 3, 2, 5, 5, 6, 5, 2, 4, 5, 5, 6, 2, 3, 4, 4, 6, 5, 4, 3, 3, 5, 6, 8, 3, 7, 4, 9, 6, 6, 3, 3, 3, 5, 6, 7, 4, 5, 3, 5
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 18 2017

Keywords

Comments

Conjecture: a(n) > 0 for all n > 30.

Examples

			a(17) = 3 because we have [14, 3], [11, 6] and [10, 7].
		

Crossrefs

Programs

  • Maple
    N:= 200: # to get a(0) to a(N)
    V:= Vector(N):
    Primes:= select(isprime,[2,seq(i,i=3..N+2)]):
    PS:= convert(Primes,set);
    Twins:= PS intersect map(`-`,PS,2):
    Twins:= Twins union map(`+`,Twins,2):
    Twins:= sort(convert(Twins,list)):
    for i from 1 to nops(Twins) do
      for j from 1 to nops(Primes) while Twins[i]+2*Primes[j] <= N do
        for k from 1 to j-1 do
          v:= Twins[i]+Primes[k]*Primes[j];
          if v > N then break fi;
          V[v]:= V[v]+1;
    od od od:
    0, seq(V[i],i=1..N); # Robert Israel, Mar 29 2017
  • Mathematica
    nmax = 110; CoefficientList[Series[Sum[Boole[PrimeQ[k] && (PrimeQ[k - 2] || PrimeQ[k + 2])] x^k, {k, 1, nmax}] Sum[MoebiusMu[k]^2 Floor[2/PrimeOmega[k]] Floor[PrimeOmega[k]/2] x^k, {k, 2, nmax}], {x, 0, nmax}], x]
  • PARI
    concat([0, 0, 0, 0, 0, 0, 0, 0, 0], Vec(sum(k=1, 110, (isprime(k) && (isprime(k - 2) || isprime(k + 2)))* x^k) * sum(k=2, 110, moebius(k)^2 * floor(2/bigomega(k)) * floor(bigomega(k)/2) * x^k) + O(x^111))) \\ Indranil Ghosh, Mar 18 2017

Formula

G.f.: (Sum_{k>=1} x^A001097(k))*(Sum_{k>=1} x^A006881(k)).