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.

A382035 a(n) is the smallest prime q such that q + prime(n) is of form 10^k or 2*10^k, or 0 if no such prime exists.

This page as a plain text file.
%I A382035 #16 Mar 28 2025 23:01:16
%S A382035 0,7,5,3,89,7,3,181,977,71,1999969,163,59,157,53,47,41,139,1933,29,
%T A382035 127,199921,17,11,3,999999999899,97,999999893,19891,887,73,
%U A382035 9999999999999999999869,863,61,9851,1999999999849,43,37,9833,827,821,19,809,7,3,1801,1789
%N A382035 a(n) is the smallest prime q such that q + prime(n) is of form 10^k or 2*10^k, or 0 if no such prime exists.
%C A382035 a(1) is not the only term equal to 0.
%C A382035 For example, a(37145)=0, since prime(37145)=442609, and:
%C A382035   10^k - 442609 is a multiple of 3, for k>=6,
%C A382035   2*10^(2*k) - 442609 is a multiple of 11, for k>=3,
%C A382035   2*10^(6*k+1) - 442609 is a multiple of 7, for k>=1,
%C A382035   2*10^(6*k+3) - 442609 is a multiple of 13, for k>=1,
%C A382035   2*10^(6*k+5) - 442609 is a multiple of 37, for k>=1.
%e A382035 For n=11 (prime(n)=31):
%e A382035 For all positive integer k, 10^k-31 is multiple of 3.
%e A382035 200 - 31 = 169 = 13 * 13
%e A382035 2000 - 31 = 1969 = 11 * 179
%e A382035 20000 - 31 = 19969 = 19 * 1051
%e A382035 200000 - 31 = 199969 = 7 * 7 * 7 * 11 * 53
%e A382035 2000000 - 31 = 1999969 is a prime number.
%e A382035 thus a(11) = 1999969.
%t A382035 Table[If[MissingQ[#], 0, # - Prime[i]] &@SelectFirst[Flatten[Table[{10^j, 2 10^j}, {j, 100}]], # > Prime[i] && PrimeQ[# - Prime[i]] &], {i, 1, 47}]
%Y A382035 Cf. A191474 (base 2 version of this sequence).
%K A382035 nonn
%O A382035 1,2
%A A382035 _Steven Lu_, Mar 12 2025