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.

A029948 Smallest prime containing n-th square as substring.

Original entry on oeis.org

101, 11, 41, 19, 163, 251, 367, 149, 641, 181, 1009, 1213, 1447, 1693, 11969, 2251, 12569, 1289, 13241, 1361, 4001, 2441, 14843, 3529, 15761, 6257, 6761, 2729, 7841, 6841, 9001, 6961, 10243, 10891, 115601, 12251, 12967, 11369
Offset: 0

Views

Author

Keywords

Programs

  • Mathematica
    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 *)