Function Repository Resource:

FindNumberSequence

Source Notebook

Generate an association of information containing a qualifying sequence, its start position and its digit path

Contributed by: Jordan Hasler, Nicholas Brunk, Wolfram|Alpha Math Team

ResourceFunction["FindNumberSequence"][n,len,crit]

generates an association of information containing a qualifying sequence, its start position, and its digit path for the number n of length len for which crit[ei] is True.

ResourceFunction["FindNumberSequence"][{n,b},len,crit]

generates an association of information containing a qualifying sequence, its start position and its digit path for the number n in base b.

Details

A time limit to the computation may be specified through the option "TimeLimit", which defaults to 10.

Examples

Basic Examples (2) 

Find the first 10-digit Prime that appears in the sequence of digits of E:

In[1]:=
ResourceFunction["FindNumberSequence"][E, 10, PrimeQ]
Out[1]=

Find the first 5-digit prime number that appears in the sequence of digits of Pi:

In[2]:=
ResourceFunction["FindNumberSequence"][Pi, 5, PrimeQ]
Out[2]=

Scope (1) 

Find the first 10-digit odd number that appears in the sequence of digits of E in base 5:

In[3]:=
ResourceFunction["FindNumberSequence"][{E, 5}, 10, OddQ]
Out[3]=

Publisher

Wolfram|Alpha Math Team

Version History

  • 2.0.0 – 23 March 2023
  • 1.0.0 – 18 January 2021

Related Resources

Author Notes

To view the full source code for FindNumberSequence, evaluate the following:

In[1]:=
SystemOpen[
 FileNameJoin[{DirectoryName[FindFile["ResourceFunctionHelpers`"]], "FindNumberSequence.wl"}]]

License Information