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.

A120450 Number of ways to express a prime p as 2*p1 + 3*p2, where p1, p2 are primes or 1.

This page as a plain text file.
%I A120450 #7 Dec 21 2022 20:12:17
%S A120450 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,
%T A120450 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,
%U A120450 9,10,11,8,7,10,8,7,10,7,11,9,8,10,10,10
%N A120450 Number of ways to express a prime p as 2*p1 + 3*p2, where p1, p2 are primes or 1.
%C A120450 It seems that every prime p > 3 can be expressed as 2*p1 + 3*p2, where p1, p2 are primes or 1. I have tested it for the first 1500 primes (up to 12553) and it is true.
%H A120450 Michael S. Branicky, <a href="/A120450/b120450.txt">Table of n, a(n) for n = 1..10000</a>
%e A120450 a(11)=2 because we can write prime(11)=31 as 2*5 + 3*7 OR 2*11 + 3*3.
%e A120450 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.
%o A120450 (Python)
%o A120450 from collections import Counter
%o A120450 from sympy import prime, primerange
%o A120450 def aupton(nn):
%o A120450     primes, c = list(primerange(2, prime(nn)+1)), Counter()
%o A120450     p2, p3 = [2] + [2*p for p in primes], [3] + [3*p for p in primes]
%o A120450     for p in p2:
%o A120450         if p > primes[-1]: break
%o A120450         for q in p3:
%o A120450             if p + q > primes[-1]: break
%o A120450             c[p+q] += 1
%o A120450     return [c[p] for p in primes]
%o A120450 print(aupton(83)) # _Michael S. Branicky_, Dec 21 2022
%K A120450 nonn
%O A120450 1,6
%A A120450 _Vassilis Papadimitriou_, Jul 20 2006
%E A120450 a(59) and beyond from _Michael S. Branicky_, Dec 21 2022