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 A051692 #19 Feb 28 2025 05:57:01 %S A051692 2,4,38,16,170,72,446,58,512,282,178,148,758,856,836,1592,1712,388, %T A051692 1906,2606,2034,1918,656,5924,1648,13082,652,1514,2758,10922,5758, %U A051692 18986,6764,10570,20918,4936,8188,5842,4094,30710,15212,11482,57932,14626,5624,36232,16018,57874 %N A051692 a(n) is twice the smallest k such that A051686(k) = prime(n). %C A051692 The sequence is based on the first 50000 terms of A051686, in which the first 54 primes (2,3,...,251) appear along with 19 others, the largest of which is A051686(37976) = 823. %H A051692 Amiram Eldar, <a href="/A051692/b051692.txt">Table of n, a(n) for n = 1..376</a> %e A051692 The 25th term in this sequence is 1648. This means that prime(25) = 97 arises in A051686 as A051686(1648/2) = A051686(824). Thus, 1648 is the first term in the sequence {..., 2k, ...} = {1648, 1798, 4108, ...} with the property that 2k*97 + 1 = 194k + 1 is also a prime, moreover the smallest one: 159857. %t A051692 s[n_] := Module[{p = 2, i = 1}, While[! PrimeQ[2*n*p + 1], p = NextPrime[p]; i++]; i]; seq[len_] := Module[{v = Table[0, {len}], c = 0, k = 1, i}, While[c < len, i = s[k]; If[i <= len && v[[i]] == 0, v[[i]] = 2*k; c++]; k++]; v]; seq[48] (* _Amiram Eldar_, Feb 28 2025 *) %o A051692 (PARI) a051686(n) = my(p=2); while(!isprime(2*n*p+1), p = nextprime(p+1)); p; %o A051692 a(n) = my(k=1); while(a051686(k) != prime(n), k++); 2*k; \\ _Michel Marcus_, Jun 08 2018 %o A051692 (PARI) s(n) = {my(p = 2, i = 1); while(!isprime(2*n*p + 1), p = nextprime(p+1); i++); i;} %o A051692 list(len) = {my(v = vector(len), c = 0, k = 1, i); while(c < len, i = s(k); if(i <= len && v[i] == 0, v[i] = 2*k; c++); k++); v;} \\ _Amiram Eldar_, Feb 28 2025 %Y A051692 Cf. A005384, A051644-A051654, A051860, A051861. %K A051692 nonn %O A051692 1,1 %A A051692 _Labos Elemer_ %E A051692 More terms from _Michel Marcus_, Jun 08 2018