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.

A067526 Numbers n such that n - 2^k is a prime or 1 for all k satisfying 0 < k, 2^k < n.

This page as a plain text file.
%I A067526 #26 Dec 18 2023 17:03:13
%S A067526 3,4,5,7,9,15,21,45,75,105
%N A067526 Numbers n such that n - 2^k is a prime or 1 for all k satisfying 0 < k, 2^k < n.
%C A067526 Is the sequence finite?
%C A067526 Next term, if it exists, exceeds 5*10^9. - _Sean A. Irvine_, Dec 18 2023
%e A067526 45 belongs to this sequence as 45-2, 45-4, 45-8, 45-16, 45-32, i.e., 43, 41, 37, 29 and 13 are all primes.
%t A067526 f[n_] := Block[{k = 1}, While[2^k < n, k++ ]; k--; k]; Do[ a = Table[n - 2^k, {k, 1, f[n]} ]; If[ a[[ -1]] == 1, a = Drop[a, -1]]; If[ Union[ PrimeQ[a]] == {True}, Print[n]], {n, 5, 10^7, 2} ]
%o A067526 (Python)
%o A067526 from sympy import isprime
%o A067526 def ok(n):
%o A067526   k, pow2 = 1, 2
%o A067526   while pow2 < n - 1:
%o A067526     if not isprime(n-pow2): return False
%o A067526     pow2 *= 2
%o A067526   return (2 < n)
%o A067526 print([m for m in range(1, 200) if ok(m)]) # _Michael S. Branicky_, Mar 04 2021
%Y A067526 Cf. A039669 (n-2^k is prime).
%K A067526 nonn,hard,more
%O A067526 1,1
%A A067526 _Amarnath Murthy_, Feb 17 2002
%E A067526 Edited by _Robert G. Wilson v_, Feb 18 2002