A120450 Number of ways to express a prime p as 2*p1 + 3*p2, where p1, p2 are primes or 1.
0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 4, 3, 3, 3, 5, 4, 4, 4, 4, 4, 4, 6, 3, 5, 4, 4, 4, 6, 5, 5, 5, 5, 7, 5, 6, 6, 6, 6, 7, 5, 6, 7, 6, 7, 9, 8, 8, 6, 7, 7, 8, 7, 9, 6, 10, 8, 6, 9, 7, 9, 8, 10, 9, 10, 9, 10, 11, 8, 7, 10, 8, 7, 10, 7, 11, 9, 8, 10, 10, 10
Offset: 1
Keywords
Examples
a(11)=2 because we can write prime(11)=31 as 2*5 + 3*7 OR 2*11 + 3*3. a(12)=3 because we can write prime(12)=37 as 2*2 + 3*11 OR 2*11 + 3*5 OR 2*17 + 3*1.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
Programs
-
Python
from collections import Counter from sympy import prime, primerange def aupton(nn): primes, c = list(primerange(2, prime(nn)+1)), Counter() p2, p3 = [2] + [2*p for p in primes], [3] + [3*p for p in primes] for p in p2: if p > primes[-1]: break for q in p3: if p + q > primes[-1]: break c[p+q] += 1 return [c[p] for p in primes] print(aupton(83)) # Michael S. Branicky, Dec 21 2022
Extensions
a(59) and beyond from Michael S. Branicky, Dec 21 2022
Comments