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.

A372238 Least number m such that 9*k*m+1 is prime for k=1..n.

Original entry on oeis.org

2, 2, 4, 170, 9860, 23450, 56980, 56980, 6723767050, 48276858630, 77460393371130, 97581361797920, 97581361797920, 1269928100726715430
Offset: 1

Views

Author

Jean-Marc Rebert, Apr 23 2024

Keywords

Examples

			a(1) = 2, because 9*1*2 + 1 = 19 is prime and no lesser number has this property.
		

Crossrefs

Programs

  • Mathematica
    p[m_, n_] := AllTrue[Range[n], PrimeQ[9*#*m + 1] &];
    a[n_] := a[n] = Module[{m = 1}, While[! p[m, n], m++]; m]
    Table[a[n], {n, 1, 9}] (* Robert P. P. McKone, May 02 2024 *)
  • PARI
    is(n,m)=my(u=vector(n,k,9*k*m+1));for(i=1,n,if(!isprime(u[i]),return(0)));1
    a(n)=my(pas=1);if(n<15,if(n>2,pas=factorback(primes(primepi(n)));pas/=3;my(m=pas));forstep(m=pas,+oo,pas,if(is(n,m),return(m))))
    
  • PARI
    See PARI link

Formula

If A088250(n) is divisible by 9, then a(n) = A088250(n) / 9. - Jason Yuen, Apr 25 2024

Extensions

a(11)-a(13) from David A. Corneth, Apr 24 2024
a(14) from Jason Yuen, Apr 25 2024