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.

A356421 Positive integers k such that k + p is a power of 2, where p is the least prime greater than k.

This page as a plain text file.
%I A356421 #28 Sep 11 2022 10:31:08
%S A356421 3,15,61,255,2043,4093,32765,65535,262141,8388599,33554397,134217699,
%T A356421 268435453,1073741821,17179869159,137438953463,274877906937,
%U A356421 1099511627761,8796093022179,17592186044409,70368744177649,140737488355323,281474976710635,562949953421243
%N A356421 Positive integers k such that k + p is a power of 2, where p is the least prime greater than k.
%C A356421 The corresponding sequence of primes is the intersection of A014210 and A356434 without the initial 2.
%e A356421 3 + 5 = 8;
%e A356421 15 + 17 = 32;
%e A356421 61 + 67 = 128.
%o A356421 (Python)
%o A356421 from itertools import islice
%o A356421 from sympy import nextprime
%o A356421 def A356421_gen():
%o A356421     m = 1
%o A356421     while True:
%o A356421         n = m+1<<1
%o A356421         k = m
%o A356421         p = nextprime(k)
%o A356421         while k+p>n:
%o A356421             k -=1
%o A356421             p = nextprime(k)
%o A356421         if k+p==n:
%o A356421             yield k
%o A356421         m = n-1
%o A356421 A356421_list = list(islice(A356421_gen(),30)) # _Chai Wah Wu_, Sep 11 2022
%Y A356421 Cf. A000040, A000079, A014210, A356434.
%K A356421 nonn
%O A356421 1,1
%A A356421 _Ali Sada_, Aug 06 2022
%E A356421 Terms from _Tom Duff_ via Seqfan.