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.

A026728 a(n) = number of primes of the form k*(n-k) + 1.

This page as a plain text file.
%I A026728 #23 May 03 2025 04:04:45
%S A026728 0,1,1,1,2,0,3,2,1,1,4,1,6,1,1,2,8,1,5,3,1,4,7,1,7,1,4,5,8,0,10,6,2,2,
%T A026728 7,1,9,8,4,4,14,1,16,3,3,5,12,3,7,7,4,11,21,0,11,4,7,6,11,2,12,9,7,10,
%U A026728 7,1,22,7,7,5,17,3,23,10,2,9,19,2,19,8,5,8,23,1,16,6,4,11,14,4,16,12,9,5,12
%N A026728 a(n) = number of primes of the form k*(n-k) + 1.
%C A026728 Number of primes of form x*y+1 with x+y=n.
%C A026728 For n <= 10^7, a(n) = 0 only for n = 1, 6, 30 and 54. - _Robert Israel_, Oct 30 2024
%H A026728 Robert Israel, <a href="/A026728/b026728.txt">Table of n, a(n) for n = 1..10000</a>
%e A026728 a(7) = 3, 1*6 +1 = 7, 2*5 +1 = 11, 3*4 +1 = 13.
%e A026728 n=16: {m: m=x*y+1 and x+y=16} = {16,29,40,49,56,61,64,65} containing two primes: 29 and 61, therefore a(16)=2.
%e A026728 n = 7 is the only number which gives primes for all possible values of k.
%p A026728 f:= proc(n) local k;
%p A026728   nops(select(isprime,[seq(k*(n-k)+1, k=1..n/2)]))
%p A026728 end proc:
%p A026728 map(f, [$1..100]); # _Robert Israel_, Oct 30 2024
%t A026728 a[n_] := Select[(Times @@ # + 1&) /@ IntegerPartitions[n, {2}], PrimeQ] // Length;
%t A026728 Array[a, 95] (* _Jean-François Alcover_, Aug 02 2018 *)
%o A026728 (PARI) { a(n)=local(r);r=0;for(k=1,n\2,if(isprime(k*(n-k)+1),r++));r } \\ _Max Alekseyev_, Oct 04 2005
%Y A026728 Cf. A109904, A109905.
%K A026728 nonn
%O A026728 1,5
%A A026728 _Reinhard Zumkeller_, Jan 27 2004
%E A026728 More terms from _Max Alekseyev_, Oct 04 2005
%E A026728 Edited by _N. J. A. Sloane_, Aug 23 2008 at the suggestion of _R. J. Mathar_