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.

A337437 a(n) is the least prime of the form 2^j*3^k - 1, j > 0, k > 0, j + k = n. a(n) = 0 if no such prime exists.

Original entry on oeis.org

5, 11, 23, 47, 0, 191, 383, 1151, 0, 6911, 6143, 27647, 0, 73727, 497663, 294911, 0, 786431, 17915903, 10616831, 0, 18874367, 188286357653, 169869311, 0, 39182082047, 10319560703, 4076863487, 0, 7247757311, 32614907903, 495338913791, 0, 51539607551, 1174136684543
Offset: 2

Views

Author

Hugo Pfoertner, Aug 28 2020

Keywords

Crossrefs

Cf. A336773.

Programs

  • Maple
    f:= proc(n) local k, p;
       if n mod 4 = 2 and n > 2 then return 0 fi;
       for k from 1 to n-1 do
         p:= 2^(n-k)*3^k-1;
         if isprime(p) then return p fi
       od;
       0
    end proc:
    map(f, [$2..40]); # Robert Israel, Sep 01 2020
  • PARI
    for(n=2,36, my(pm=oo); for(j=1,n-1, my(k=n-j,p=2^j*3^k-1);if(isprime(p),pm=min(p,pm))); print1(if(pm==oo,0,pm),", "))

Formula

a(n) = 0 for n = 2 mod 4, n > 2.