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.

A113040 Number of solutions to +-p(1)+-p(2)+-...+-p(2n)=1 where p(i) is the i-th prime.

Original entry on oeis.org

1, 1, 3, 6, 16, 45, 138, 439, 1417, 4698, 16021, 55146, 190274, 671224, 2404289, 8535117, 30635869, 110496946, 401422210, 1467402238, 5393176633, 19883249002, 73856531314, 273602448261, 1017563027699, 3803902663467, 14266523388813, 53564969402478
Offset: 1

Views

Author

Floor van Lamoen, Oct 12 2005

Keywords

Comments

+-p(1)+-p(2)+-...+-p(2n+1)=1 has no solutions because the l.h.s. is even.

Examples

			2 + 3 + 5 - 7 + 11 - 13 = - 2 + 3 + 5 - 7 - 11 + 13 = - 2 + 3 - 5 + 7 + 11 - 13 = 1 so a(3) = 3.
		

Crossrefs

Bisection (even part) of A306443.

Programs

  • Maple
    A113040:=proc(n) local i,j,p,t; t:= NULL; for j from 2 to 2*n by 2 do p:=1; for i to j do p:=p*(x^(-ithprime(i))+x^(ithprime(i))); od; t:=t,coeff(p,x,1); od; t; end;
    # second Maple program:
    sp:= proc(n) sp(n):= `if`(n=0, 0, ithprime(n)+sp(n-1)) end:
    b := proc(n,i) option remember; `if`(n>sp(i), 0, `if`(i=0, 1,
            b(n+ithprime(i), i-1)+ b(abs(n-ithprime(i)), i-1)))
         end:
    a:= n-> b(1, 2*n):
    seq(a(n), n=1..40);  # Alois P. Heinz, Aug 05 2012
  • Mathematica
    sp[n_] := If[n == 0, 0, Prime[n]+sp[n-1]]; b[n_, i_] := b[n, i] =If[n > sp[i], 0, If[i == 0, 1, b[n+Prime[i], i-1] + b[Abs[n-Prime[i]], i-1]]]; a[n_] := b[1, 2*n]; Table[a[n], {n, 1, 40}] (* Jean-François Alcover, Nov 11 2015, after Alois P. Heinz *)

Formula

a(n) = A022895(2n) + A261061(n). - M. F. Hasler, Aug 09 2015
Conjecture: limit_{n->infinity} a(n)^(1/n) = 4. - Vaclav Kotesovec, Jun 05 2019
a(n) = [x^1] Product_{k=1..2*n} (x^prime(k) + 1/x^prime(k)). - Ilya Gutkovskiy, Jan 25 2024