login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A029948 Smallest prime containing n-th square as substring. 2

%I #24 May 14 2017 03:10:01

%S 101,11,41,19,163,251,367,149,641,181,1009,1213,1447,1693,11969,2251,

%T 12569,1289,13241,1361,4001,2441,14843,3529,15761,6257,6761,2729,7841,

%U 6841,9001,6961,10243,10891,115601,12251,12967,11369

%N Smallest prime containing n-th square as substring.

%H John Cerkan, <a href="/A029948/b029948.txt">Table of n, a(n) for n = 0..10000</a>

%H John Cerkan, <a href="/A029948/a029948_2.py.txt">Python 2.7</a>

%t fr[n_] := If[n == 0, {{}}, Join[{Range[9]}, Table[Range[0, 9], {n - 1}]]]; bk[n_] := If[n == 0, {{}}, Join[Table[Range[0, 9], {n - 1}], {{1, 3, 7, 9}}]]; cand[n_, f_, b_] := FromDigits /@ Partition[ Flatten[ Map[ IntegerDigits, Tuples@ DeleteCases[Join[fr[f], {{n}}, bk[b]], {}], 2]], f + b + IntegerLength@n]; a[0] = 101; a[n_] := Block[{m = Infinity, k = 0}, While[m == Infinity, k++; Do[ m = Min[m, Select[cand[n^2, f, k - f], PrimeQ]], {f, 0, k}]]; m]; Array[a, 100, 0] (* _Giovanni Resta_, May 11 2017 *)

%K nonn,base

%O 0,1

%A _Patrick De Geest_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 09:48 EDT 2024. Contains 371905 sequences. (Running on oeis4.)