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.

A367687 a(n) is the first prime p such that n*p+1 is the product of n primes counted with multiplicity.

This page as a plain text file.
%I A367687 #16 Dec 01 2023 15:55:31
%S A367687 2,7,17,47,79,9479,41,5923,199,33461,2141,69173177,11579,7655281,
%T A367687 20753,64869017,233231,2622816297743,341477,14508897313,8138947,
%U A367687 24565981007,27445337,90698401133219401,313566167,2552728502809,229909997,23451738297083,948780491,20677177107714198558766009,3390080033
%N A367687 a(n) is the first prime p such that n*p+1 is the product of n primes counted with multiplicity.
%H A367687 Robert Israel, <a href="/A367687/b367687.txt">Table of n, a(n) for n = 1..500</a>
%F A367687 A001222(n*a(n)+1) = n.
%e A367687 a(3) = 17 because 17 is prime and 3 * 17 + 1 = 52 = 2^2 * 13 is the product of 3 primes, and no smaller prime works.
%p A367687 f:= proc(n)
%p A367687   uses priqueue;
%p A367687 local Q,t,q,i;
%p A367687   initialize(Q);
%p A367687   q:= 2;
%p A367687   while n mod q = 0 do q:= nextprime(q) od:
%p A367687   insert([-q^n,q,n],Q);
%p A367687   do
%p A367687     t:= extract(Q);
%p A367687     if -t[1]-1 mod n = 0 and isprime((-t[1]-1)/n) then return (-t[1]-1)/n fi;
%p A367687     q:= nextprime(t[2]);
%p A367687     while n mod q = 0 do q:= nextprime(q) od;
%p A367687     for i from 1 to t[3] do
%p A367687       insert([t[1]*(q/t[2])^i,q,i],Q);
%p A367687     od
%p A367687   od;
%p A367687 end proc:
%p A367687 map(f, [$1..40]);
%Y A367687 Cf. A001222, A072060.
%K A367687 nonn,look
%O A367687 1,1
%A A367687 _Zak Seidov_ and _Robert Israel_, Nov 26 2023