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.

A376675 a(n) is the least prime p such that p + 7*k*(k+1) is prime for 0 <= k <= n-1 but not for k=n.

This page as a plain text file.
%I A376675 #16 Oct 04 2024 07:39:18
%S A376675 2,3,59,5,89,599,3329,617,269,21107,9833477,19497833669,215830859597,
%T A376675 111338387,251704297005767,17
%N A376675 a(n) is the least prime p such that p + 7*k*(k+1) is prime for 0 <= k <= n-1 but not for k=n.
%p A376675 f:= proc(p) local k;
%p A376675   for k from 1 while isprime(p+k*(k+1)*7) do od:
%p A376675   k
%p A376675 end proc:
%p A376675 A:= Vector(12): count:= 0:
%p A376675 for i from 1 while count < 12 do
%p A376675   v:= f(ithprime(i));
%p A376675   if A[v] = 0 then count:= count+1; A[v]:= ithprime(i) fi
%p A376675 od:
%p A376675 convert(A,list);
%t A376675 Table[p=1;m=7;Monitor[Parallelize[While[True,If[And[MemberQ[PrimeQ[Table[p+m*k*(k+1),{k,0,n-1}]],False]==False,PrimeQ[p+m*n*(n+1)]==False],Break[]];p++];p],p],{n,1,10}]
%o A376675 (PARI) isok(p, n) = for (k=0, n-1, if (! isprime(p + 7*k*(k+1)), return(0))); return (!isprime(p + 7*n*(n+1)));
%o A376675 a(n) = my(p=2); while (!isok(p, n), p=nextprime(p+1)); p;
%o A376675 (Perl) use ntheory qw(:all); sub a { my $n = $_[0]; my $lo = 2; my $hi = 2*$lo; while (1) { my @terms = grep { !is_prime($_ + 7*$n*($n+1)) } sieve_prime_cluster($lo, $hi, map { 7*$_*($_+1) } 1 .. $n-1); return $terms[0] if @terms; $lo = $hi+1; $hi = 2*$lo; } }; $| = 1; for my $n (1..100) { print a($n), ", " }; # _Daniel Suteu_, Oct 04 2024
%Y A376675 Cf. A164926, A370387, A371024.
%K A376675 nonn,more
%O A376675 1,1
%A A376675 _J.W.L. (Jan) Eerland_, Oct 01 2024
%E A376675 a(11)-a(12) from _Hugo Pfoertner_, Oct 01 2024
%E A376675 a(13)-a(14) from _Hugo Pfoertner_, Oct 03 2024
%E A376675 a(15)-a(16) from _Daniel Suteu_, Oct 04 2024