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.

A084143 Number of partitions of n into a sum of two or more consecutive primes.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 2, 0, 0, 1, 0, 2, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 2, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 2, 0, 0, 1
Offset: 1

Views

Author

Eric W. Weisstein, May 15 2003

Keywords

Examples

			a(36)=2 because we have 36 = 17 + 19 = 5 + 7 + 11 + 13.
		

Crossrefs

Programs

  • Maple
    g:=sum(sum(product(x^ithprime(k),k=i..j),j=i+1..25),i=1..25): gser:=series(g,x=0,80): seq(coeff(gser,x,n),n=1..75); # Emeric Deutsch, Mar 30 2006
    # alternative, R. J. Mathar, Aug 19 2020
    A084143 := proc(n::integer)
        local a,k,i,spr ;
        a := 0 ;
        for k from 2 do
            if add(ithprime(i),i=1..k) > n then
                break;
            end if;
            for i from 1 do
                spr := add( ithprime(j),j=i..i+k-1) ;
                if spr > n then
                    break;
                end if;
                if spr = n then
                    a := a +1 ;
                end if;
            end do:
        end do:
        a ;
    end proc:
  • Mathematica
    max = 25; gf = Sum[ Sum[ Product[ x^Prime[k], {k, i, j}], {j, i+1, max}], {i, 1, max}]; Rest[ CoefficientList[gf, x]][[1 ;; 75]] (* Jean-François Alcover, Oct 23 2012, after Emeric Deutsch *)

Formula

G.f.: Sum_{i>=1} Sum_{j>=i+1} Product_{k=i..j} x^prime(k). - Emeric Deutsch, Mar 30 2006