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.

A074720 Least k such that floor(3^n/2^k) is prime.

Original entry on oeis.org

2, 1, 4, 5, 6, 1, 11, 6, 7, 4, 5, 1, 9, 6, 8, 21, 8, 4, 25, 12, 20, 13, 30, 17, 6, 13, 10, 13, 19, 5, 12, 34, 33, 37, 16, 39, 35, 13, 38, 30, 28, 20, 53, 16, 60, 24, 40, 43, 34, 19, 23, 32, 63, 59, 19, 22, 27, 56, 86, 14, 29, 5, 53, 13, 15, 63, 19, 7, 88, 1, 87, 46, 22, 51, 25, 30
Offset: 2

Views

Author

Benoit Cloitre, Sep 04 2002

Keywords

Comments

From Robert Israel, Jan 04 2017: (Start)
a(n) <= A056576(n) - 1.
a(n) = 1 for n in A028491. (End)

Programs

  • Maple
    f:= proc(n) local t, k;
       t:= 3^n;
       for k from 1 do t:= t/2; if isprime(floor(t)) then return k fi od:
    end proc:
    map(f, [$2..100]); # Robert Israel, Jan 04 2017
  • Mathematica
    lk[n_]:=Module[{k=1,n3=3^n},While[!PrimeQ[Floor[n3/2^k]],k++];k]; Array[lk,80,2] (* Harvey P. Dale, Feb 24 2013 *)
  • PARI
    a(n)=if(n<0,0,k=1; while(isprime(floor(3^n/2^k)) == 0,k++); k)