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.

A065821 a(n) is the smallest prime ending in exactly n 1's.

This page as a plain text file.
%I A065821 #15 Dec 08 2024 20:38:50
%S A065821 31,11,2111,101111,311111,29111111,61111111,1711111111,14111111111,
%T A065821 31111111111,311111111111,2111111111111,31111111111111,
%U A065821 3511111111111111,5111111111111111,101111111111111111,3511111111111111111,2111111111111111111,1111111111111111111,911111111111111111111
%N A065821 a(n) is the smallest prime ending in exactly n 1's.
%H A065821 Harry J. Smith, <a href="/A065821/b065821.txt">Table of n, a(n) for n = 1..100</a>
%e A065821 a(4) = 101111 because 1111=11*101, 21111=3*31*227, 31111=53*587, 41111=7^2*829, 51111=3^4*631, 61111=23*2657, 71111=17*47*89, 81111=3*19*1423, 91111=179*509 so 101111 is the first prime ending in four 1's.
%t A065821 pe[n_]:=Module[{k=0,len=IntegerLength[n]},While[Mod[k,10]==1||(!PrimeQ[ k*10^len+n]),k++];k*10^len+n]; pe/@Table[(10^n-1)/9,{n,20}] (* _Harvey P. Dale_, Dec 31 2013 *)_
%o A065821 (PARI) a(n)={ my(f=10^n, b=(f-1)/9, k=0); while (!isprime(b + k*f), k+=1+(k%10==0)); b + k*f } \\ _Harry J. Smith_, Nov 01 2009
%Y A065821 Cf. A037055, A065584, A065580, A065581, A065582.
%K A065821 base,nonn
%O A065821 1,1
%A A065821 Jonathan Ayres (jonathan.ayres(AT)btinternet.com), Nov 23 2001
%E A065821 Edited and extended by _Robert G. Wilson v_, Jul 04 2003