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.

A068695 Smallest number (not beginning with 0) that yields a prime when placed on the right of n.

This page as a plain text file.
%I A068695 #56 Jun 08 2025 16:15:42
%S A068695 1,3,1,1,3,1,1,3,7,1,3,7,1,9,1,3,3,1,1,11,1,3,3,1,1,3,1,1,3,7,1,17,1,
%T A068695 7,3,7,3,3,7,1,9,1,1,3,7,1,9,7,1,3,13,1,23,1,7,3,1,7,3,1,3,11,1,1,3,1,
%U A068695 3,3,1,1,9,7,3,3,1,1,3,7,7,9,1,1,9,19,3,3,7,1,23,7,1,9,7,1,3,7,1,3,1,9,3,1
%N A068695 Smallest number (not beginning with 0) that yields a prime when placed on the right of n.
%C A068695 Max Alekseyev (see link) shows that a(n) always exists. Note that although his argument makes use of some potentially large constants (see the comments in A060199), the proof shows that a(n) exists for all n. - _N. J. A. Sloane_, Nov 13 2020
%C A068695 Many numbers become prime by appending a one-digit odd number. Some numbers (such as 20, 32, 51, etc.) require a 2-digit odd number (A032352 has these). In the first 100000 values of n there are only 22 that require a 3-digit odd number (A091089). There probably are some values that require odd numbers of 4 or more digits, but these are likely to be very large. - _Chuck Seggelin_, Dec 18 2003
%H A068695 David W. Wilson, <a href="/A068695/b068695.txt">Table of n, a(n) for n=1..10000</a>
%H A068695 Max Alekseyev, <a href="/A068695/a068695_2.txt">Given n, there is a k such that the concatenation n||k is a prime</a>, Nov 09 2020
%H A068695 <a href="/index/Pri#piden">Index entries for primes involving decimal expansion of n</a>
%e A068695 a(20)=11 because 11 is the minimum odd number which when appended to 20 forms a prime (201, 203, 205, 207, 209 are all nonprime, 2011 is prime).
%t A068695 d[n_]:=IntegerDigits[n]; t={}; Do[k=1; While[!PrimeQ[FromDigits[Join[d[n],d[k]]]],k++]; AppendTo[t,k],{n,102}]; t (* _Jayanta Basu_, May 21 2013 *)
%t A068695 mon[n_]:=Module[{k=1},While[!PrimeQ[n*10^IntegerLength[k]+k],k+=2];k]; Array[mon,110] (* _Harvey P. Dale_, Aug 13 2018 *)
%o A068695 (PARI) A068695=n->for(i=1,oo,ispseudoprime(eval(Str(n,i)))&&return(i)) \\ _M. F. Hasler_, Oct 29 2013
%o A068695 (Python)
%o A068695 from sympy import isprime
%o A068695 from itertools import count
%o A068695 def a(n): return next(k for k in count(1) if isprime(int(str(n)+str(k))))
%o A068695 print([a(n) for n in range(1, 103)]) # _Michael S. Branicky_, Oct 18 2022
%Y A068695 Cf. A032352 (a(n) requires at least a 2 digit odd number), A091089 (a(n) requires at least a 3 digit odd number).
%Y A068695 Cf. also A060199, A228325, A336893.
%K A068695 base,easy,nonn
%O A068695 1,2
%A A068695 _Amarnath Murthy_, Mar 03 2002
%E A068695 More terms from _Chuck Seggelin_, Dec 18 2003
%E A068695 Entry revised by _N. J. A. Sloane_, Feb 20 2006
%E A068695 More terms from _David Wasserman_, Feb 14 2006