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.

A352296 Smallest number that can be expressed as the sum of two primes in exactly n ways or -1 if no such number exists.

This page as a plain text file.
%I A352296 #11 Mar 20 2022 12:15:17
%S A352296 1,4,10,22,34,48,60,78,84,90,114,144,120,168,180,234,246,288,240,210,
%T A352296 324,300,360,474,330,528,576,390,462,480,420,570,510,672,792,756,876,
%U A352296 714,798,690,1038,630,1008,930,780,960,870,924,900,1134,1434,840,990,1302
%N A352296 Smallest number that can be expressed as the sum of two primes in exactly n ways or -1 if no such number exists.
%C A352296 Conjecture: a(n) != -1 for all n.
%C A352296 If n > 0 and a(n) != -1, then a(n) is even.
%C A352296 a(0) = A014092(1)
%C A352296 a(1) = A067187(1)
%C A352296 a(2) = A067188(1)
%C A352296 a(3) = A067189(1)
%C A352296 a(4) = A067190(1)
%C A352296 a(5) = A067191(1)
%C A352296 a(6) = A066722(1)
%C A352296 a(7) = A352229(1)
%C A352296 a(8) = A352230(1)
%C A352296 a(9) = A352231(1)
%C A352296 a(10) = A352233(1)
%t A352296 f[n_] := Count[IntegerPartitions[n, {2}], _?(And @@ PrimeQ[#] &)]; seq[max_] :=  Module[{s = Table[0, {max}], n = 1, c = 0, k}, While[c < max, k = f[n]; If[k < max && s[[k + 1]] == 0, c++; s[[k + 1]] = n]; n++]; s]; seq[50] (* _Amiram Eldar_, Mar 11 2022 *)
%o A352296 (Python)
%o A352296 from itertools import count
%o A352296 from sympy import nextprime
%o A352296 def A352296(n):
%o A352296     if n == 0:
%o A352296         return 1
%o A352296     pset, plist, pmax = {2}, [2], 4
%o A352296     for m in count(2):
%o A352296         if m > pmax:
%o A352296             plist.append(nextprime(plist[-1]))
%o A352296             pset.add(plist[-1])
%o A352296             pmax = plist[-1]+2
%o A352296         c = 0
%o A352296         for p in plist:
%o A352296             if 2*p > m:
%o A352296                 break
%o A352296             if m - p in pset:
%o A352296                 c += 1
%o A352296         if c == n:
%o A352296             return m
%Y A352296 Cf. A014092, A067187, A067188, A067189, A067190, A067191, A066722, A352229, A352230, A352231, A352233.
%Y A352296 Essentially the same as A023036 and A001172.
%K A352296 nonn
%O A352296 0,2
%A A352296 _Chai Wah Wu_, Mar 11 2022