# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a333615 Showing 1-1 of 1 %I A333615 #6 May 16 2020 03:46:41 %S A333615 1,2,3,4,7,10,13,20,26,34,48,61,78,103,129,162,206,256,314,391,479, %T A333615 579,711,859,1028,1243,1485,1764,2107,2497,2941,3477,4092,4783,5610, %U A333615 6557,7615,8872,10303,11901,13781,15910,18292,21062,24196,27697,31726,36287 %N A333615 a(n) is the number of ways to express 2*n+1 as a sum of parts x such that x+2 is an odd prime. %e A333615 For n = 3, 2*n + 1 = 7. There are 4 partitions of 7 into parts with sizes 1, 3, 5, 9, 11 ... (the odd primes minus 2): %e A333615 7 = 5 + 1 + 1 %e A333615 7 = 3 + 3 + 1 %e A333615 7 = 3 + 1 + 1 + 1 + 1 %e A333615 7 = 1 + 1 + 1 + 1 + 1 + 1 + 1 %e A333615 So, a(3) = 4. %t A333615 a[n_] := Module[{p}, %t A333615 p = Table[Prime[i] - 2, {i, 2, PrimePi[2*n + 3]}]; %t A333615 Length[IntegerPartitions[2*n + 1, {0, Infinity}, p]]] %t A333615 Table[a[n], {n, 0, 60}] %o A333615 (PARI) %o A333615 \\ Slowish: %o A333615 partitions_into(n,parts,from=1) = if(!n,1, if(#parts==from, (0==(n%parts[from])), my(s=0); for(i=from,#parts,if(parts[i]<=n, s += partitions_into(n-parts[i],parts,i))); (s))); %o A333615 odd_primes_minus2_upto_n_reversed(n) = { my(lista=List([])); forprime(p=3,n+2,listput(lista,p-2)); Vecrev(Vec(lista)); }; %o A333615 A333615(n) = partitions_into(n+n+1, odd_primes_minus2_upto_n_reversed(n+n+1)); \\ _Antti Karttunen_, May 09 2020 %Y A333615 Cf. A069259 (partitions of 2*n, instead of 2*n+1). %Y A333615 Cf. A101776. %K A333615 nonn %O A333615 0,2 %A A333615 _Luc Rousseau_, Mar 29 2020 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE