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.

A252168 Smallest k > 0 such that |(2n-1) - 2^k| is prime, or -1 if no such k exists.

This page as a plain text file.
%I A252168 #39 Mar 25 2023 13:19:45
%S A252168 2,3,1,1,1,2,1,1,2,1,1,2,1,2,4,1,1,2,3,1,2,1,1,2,1,2,4,1,2,4,1,1,2,3,
%T A252168 1,2,1,1,2,3,1,2,1,2,4,1,2,4,3,1,2,1,1,2,1,1,2,1,2,4,3,4,4,47,1,2,1,2,
%U A252168 6,1,1,2,3,3,8,1,1,2,3,1,2,5,1,2,1,2,4
%N A252168 Smallest k > 0 such that |(2n-1) - 2^k| is prime, or -1 if no such k exists.
%C A252168 It is known that a(254602) = -1, because |509203-2^k| is always divisible by 3, 5, 7, 13, 17, or 241. a(1147) is the first unknown term.
%C A252168 a((A101036(n)+1)/2) = -1, so there are infinitely many n such that a(n) = -1.
%C A252168 a((A133122(n)+1)/2) = A096502((A133122(n)-1)/2).
%H A252168 Jinyuan Wang, <a href="/A252168/b252168.txt">Table of n, a(n) for n = 1..1146</a>
%e A252168 a(12) = 2 because 2*12-1 = 23 and that 23-2^1 = 21 is not prime but 23-2^2 = 19 is.
%e A252168 a(69) = 6 because 2*69-1 = 137, |137-2^k| is composite for k = 1, 2, 3, 4, 5 and prime for k = 6.
%e A252168 Even the smallest k can be also very large. For example, a(169) = 791.
%e A252168 a(1147) > 65536.
%t A252168 Table[k = 1; While[!PrimeQ[Abs[(2*n-1) - 2^k]], k++]; k, {n, 1, 1000}]
%o A252168 (PARI) A252168(n)={ my(k=1); n=2*n-1; while(!ispseudoprime(abs(n-2^k)), k++); k }
%Y A252168 Cf. A006285, A096502, A133122, A188903.
%Y A252168 Cf. A046067, A046069, A067760.
%K A252168 nonn,hard
%O A252168 1,1
%A A252168 _Eric Chen_, Dec 14 2014
%E A252168 a(19) corrected by _Jinyuan Wang_, Mar 25 2023