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.

A157188 Number of ways to write prime(n) as p*q-(p+q) with primes p<=q.

This page as a plain text file.
%I A157188 #6 May 22 2025 21:00:39
%S A157188 0,2,1,1,2,0,1,1,2,1,1,0,1,1,1,0,3,0,0,4,0,1,1,0,0,1,1,2,0,0,0,2,1,1,
%T A157188 1,0,0,1,2,0,3,0,3,0,1,1,1,1,1,0,0,3,0,2,0,2,1,1,0,1,0,0,0,4,0,0,1,0,
%U A157188 2,0,0,4,0,0,1,2,0,0,0,0,4,0,4,0,0,1,0,0,1,1,1,3,0,1,1,3,0,1,1,0,0,0,1,1,0
%N A157188 Number of ways to write prime(n) as p*q-(p+q) with primes p<=q.
%C A157188 Records in this sequence are given in A157189, the corresponding primes in A157190.
%H A157188 C. Rivera (Ed.), <a href="http://www.primepuzzles.net/puzzles/puzz_482.htm">Puzzle 482: Two Bergot questions</a>, March 2009.
%e A157188 a(1)=0 since prime(1) = 2 cannot be written as pq-(p+q) for primes p,q.
%e A157188 a(2)=2 since prime(2) = 3 = 2*5-(2+5) = 3*3-(3+3) are the two possibilities.
%o A157188 (PARI) A157188(n)={ local(c=0,L=sqrtint(n=prime(n)+1)); fordiv( n,d, d>L&break; isprime(d+1) || next; isprime(n/d+1) & c++);c}
%Y A157188 Cf. A157187-A157190
%K A157188 nonn
%O A157188 1,2
%A A157188 _M. F. Hasler_, Mar 11 2009