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.

A250204 SierpiƄski problem in base 6: Least k > 0 such that n*6^k+1 is prime, or 0 if no such k exists.

Original entry on oeis.org

1, 1, 1, 0, 1, 1, 1, 4, 0, 1, 1, 1, 1, 0, 2, 1, 1, 1, 0, 5, 1, 4, 1, 0, 1, 1, 1, 2, 0, 1, 2, 1, 1, 0, 1, 2, 1, 1, 0, 1, 5, 5, 2, 0, 1, 1, 1, 3, 0, 2, 1, 1, 7, 0, 1, 1, 2, 1, 0, 2, 1, 1, 1, 0, 2, 1, 8, 1, 0, 1, 2, 1, 1, 0, 7, 1, 1, 4, 0, 4, 1, 2, 1, 0, 2, 5, 1, 2, 0, 1, 1, 2, 3, 0, 1, 1, 9, 2, 0, 1, 1, 1, 1, 0, 1, 6, 1, 2, 0, 1, 3, 1, 4, 0, 1, 2, 23, 1, 0, 4
Offset: 1

Views

Author

Eric Chen, Mar 11 2015

Keywords

Comments

a(5k+4) = 0, since (5k+4)*6^n+1 is always divisible by 5, but there are infinitely many numbers not in the form 5k+4 such that a(n) = 0. For example, a(174308) = 0 since 174308*6^n+1 is always divisible by 7, 13, 31, 37, or 97 (See A123159). Conjecture: if n is not in the form 5k+4 and n < 174308, then a(n) > 0.
However, according to the Barnes link no primes n*6^k+1 are known for n = 1296, 7776 and 46656, so these may be counterexamples. - Robert Israel, Mar 17 2015

Crossrefs

Cf. A250205 (Least k > 0 such that n*6^k-1 is prime).

Programs

  • Maple
    N:= 1000: # to get a(1) to a(N), using k up to 10000
    a[1]:= 1:
    for n from 2 to N do
      if n mod 5 = 4 then a[n]:= 0
      else
        for k from 1 to 10000 do
        if isprime(n*6^k+1) then
           a[n]:= k;
           break
        fi
        od
      fi
    od:
    L:= [seq(a[n],n=1..N)]; # Robert Israel, Mar 17 2015
  • Mathematica
    (* m <= 10000 is sufficient up to n = 1000 *)
    a[n_] := For[k = 1, k <= 10000, k++, If[PrimeQ[n*6^k + 1], Return[k]]] /. Null -> 0; Table[a[n], {n, 1, 120}]
  • PARI
    a(n) = if(n%5==4, 0, for(k = 1, 10000, if(ispseudoprime(n*6^k+1), return(k))))