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.

A167506 Number of m >= 0, m <= n such that 2^(n-m)*3^m + 1 or 2^(n-m)*3^m - 1 is prime.

Original entry on oeis.org

2, 2, 3, 4, 5, 2, 6, 7, 6, 3, 5, 1, 10, 1, 3, 8, 10, 2, 7, 4, 3, 2, 9, 1, 5, 1, 5, 5, 6, 2, 13, 6, 3, 1, 9, 5, 10, 2, 5, 7, 13, 1, 11, 6, 4, 0, 12, 1, 8, 3, 7, 9, 11, 1, 7, 7, 4, 2, 11, 1, 11, 2, 9, 6, 6, 1, 13, 8, 8, 1, 9, 2, 13, 0, 5, 4, 12, 1, 11, 2, 10, 3, 13, 2, 8, 2, 4, 6, 9, 1, 6, 7, 4, 1, 8, 1, 9, 1
Offset: 1

Views

Author

M. F. Hasler, Nov 19 2009

Keywords

Comments

M. Underwood observed that for all primes p < 3187 we have a(p) > 1, and asks whether there is a prime such that a(p) = 0. (This is equivalent to A167504(p) = A167505(p) = 0.)

Crossrefs

Programs

  • Maple
    g:= proc(n,m) local t; t:= 2^(n-m)*3^m; isprime(t+1) or isprime(t-1) end proc:
    f:= proc(n) nops(select(m -> g(n,m), [$0..n])) end proc:
    map(f, [$1..100]); # Robert Israel, Mar 11 2025
  • PARI
    A167505(n)=sum( b=0,n, ispseudoprime(3^b<<(n-b)-1) || ispseudoprime(3^b<<(n-b)+1))

Formula

max { A167504(n), A167505(n) } <= a(n) <= A167504(n)+A167505(n).