login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A077608 Number of compositions of n into twin primes (i.e., primes that are members of a twin prime pair, like 3, 5, 7, 11, 13, but not 2 or 23). 7

%I

%S 1,0,0,1,0,1,1,1,2,1,3,4,3,7,7,8,14,15,21,28,33,47,58,75,103,125,167,

%T 220,275,370,474,610,806,1028,1347,1752,2253,2954,3812,4944,6451,8329,

%U 10841,14077,18226,23720,30745,39903,51857,67214,87313,113340,147017,190974

%N Number of compositions of n into twin primes (i.e., primes that are members of a twin prime pair, like 3, 5, 7, 11, 13, but not 2 or 23).

%H Iain Fox, <a href="/A077608/b077608.txt">Table of n, a(n) for n = 0..8834</a> (first 1001 terms from Alois P. Heinz)

%H P. Flajolet, <a href="http://algo.inria.fr/flajolet/">Publications</a>

%F G.f.: 1/(1 - Sum_{k>=1} x^A001097(k)). - _Andrew Howroyd_, Dec 28 2017

%e a(15) = 8 since 15 = 11+7 = 7+11 = 5+13 = 13+5 = 3+5+7 = 3+7+5 = 5+3+7 = 5+7+3 = 7+3+5 = 7+5+3 and 3,5,7,11 belong to twin pairs.

%p A077608 := proc(n) coeff(series(1/(1-add(z^numtheory[ithprime](j)* subs([true=1,false=0],evalb(isprime(ithprime(j)-2) or isprime(ithprime(j)+2))),j=2..n+2)),z=0,n+1),z,n): end;

%t a[n_] := Coefficient[Series[ 1/(1 - Sum[z^Prime[j]*Boole[ PrimeQ[Prime[j] - 2] || PrimeQ[ Prime[j] + 2]], {j, 2, n + 2}]), {z, 0, n + 1}], z, n]; Table[a[n], {n, 0, 53}] (* _Jean-Fran├žois Alcover_, Nov 09 2012, after Maple *)

%o (PARI)

%o ok(n)={isprime(n) && (isprime(n-2) || isprime(n+2))}

%o {my(n=60); Vec(1/(1-sum(k=1, n, if(ok(k), x^k, 0))) + O(x*x^n))} \\ _Andrew Howroyd_, Dec 28 2017

%Y Cf. A001097, A002124, A023360.

%K nonn

%O 0,9

%A _Philippe Flajolet_, Nov 11 2002

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 19 14:52 EST 2018. Contains 317352 sequences. (Running on oeis4.)