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.

A109926 Least k such that k-2^r is prime for n values of r. Index of the first occurrence of n in A109925.

This page as a plain text file.
%I A109926 #16 Feb 23 2025 11:15:37
%S A109926 1,3,4,15,21,45,75,465,1095,2145,4935,14955,80685,229845,1295325,
%T A109926 1575285,9700575,20435415,15054105,53999715,2282745465
%N A109926 Least k such that k-2^r is prime for n values of r. Index of the first occurrence of n in A109925.
%C A109926 It appears that 3 and 5 divide a(n) for n>4. Note that a(18)<a(17). - _T. D. Noe_, Jul 19 2005
%C A109926 Conjecture: a(n)==0 (mod 3) for n > 2. Then n-2^k is not == 0 (mod 3) and a prime is more probable. - _Robert G. Wilson v_, Jul 21 2005
%C A109926 Conjecture: a(n+15)==0 (mod 30) for n > 4. - _Robert G. Wilson v_, Jul 21 2005
%C A109926 a(n) > 10^10 for n >= 21. - _Donovan Johnson_, Jan 21 2009
%e A109926 a(4) = 21, 21-2 =19, 21-4 = 17, 21-8 = 13, 21-16 = 5, 21 is the smallest number that gives four such primes.
%t A109926 t=Table[cnt=0; r=1; While[r<n, If[PrimeQ[n-r], cnt++ ]; r=2r]; cnt, {n, 250000}]; Table[First[Flatten[Position[t, n]]], {n, 13}] (Noe)
%t A109926 f[n_] := Count[ PrimeQ[n - 2^Range[0, Floor[ Log[2, n]]]], True]; t = Table[0, {30}]; Do[ a = f[n]; If[ t[[a+1]] == 0, t[[a+1]] = n], {n, 4*10^8}]; t (* _Robert G. Wilson v_ *)
%o A109926 (Python)
%o A109926 from itertools import count
%o A109926 from sympy import isprime
%o A109926 def A109926(n):
%o A109926     for m in count(1):
%o A109926         c = 0
%o A109926         for k in range(m.bit_length()):
%o A109926             if isprime(m-(1<<k)):
%o A109926                 c += 1
%o A109926             if c>n:
%o A109926                 break
%o A109926         if c == n:
%o A109926             return m # _Chai Wah Wu_, Feb 23 2025
%Y A109926 Cf. A109925.
%K A109926 hard,more,nonn
%O A109926 0,2
%A A109926 _Amarnath Murthy_, Jul 17 2005
%E A109926 Edited, corrected and extended by _T. D. Noe_ and _Robert G. Wilson v_, Jul 19 2005
%E A109926 a(20) from _Donovan Johnson_, Jan 21 2009