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.
%I A167506 #15 Mar 11 2025 11:12:11 %S A167506 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, %T A167506 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, %U A167506 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 %N A167506 Number of m >= 0, m <= n such that 2^(n-m)*3^m + 1 or 2^(n-m)*3^m - 1 is prime. %C A167506 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.) %H A167506 Robert Israel, <a href="/A167506/b167506.txt">Table of n, a(n) for n = 1..2000</a> %H A167506 Mark Underwood, <a href="http://groups.yahoo.com/group/primenumbers/message/21119">2^a*3^b one away from a prime</a>. Post to primenumbers group, Nov. 19, 2009. %H A167506 Mark Underwood and Jens Kruse Andersen, <a href="/A167504/a167504.txt">2^a*3^b one away from a prime</a>, digest of 3 messages in primenumbers Yahoo group, Nov 19, 2009. %F A167506 max { A167504(n), A167505(n) } <= a(n) <= A167504(n)+A167505(n). %p A167506 g:= proc(n,m) local t; t:= 2^(n-m)*3^m; isprime(t+1) or isprime(t-1) end proc: %p A167506 f:= proc(n) nops(select(m -> g(n,m), [$0..n])) end proc: %p A167506 map(f, [$1..100]); # _Robert Israel_, Mar 11 2025 %o A167506 (PARI) A167505(n)=sum( b=0,n, ispseudoprime(3^b<<(n-b)-1) || ispseudoprime(3^b<<(n-b)+1)) %Y A167506 Cf. A167504, A167505. %K A167506 nonn %O A167506 1,1 %A A167506 _M. F. Hasler_, Nov 19 2009