A089755 a(1)=11; for n>1, a(n) is the smallest prime not occurring earlier beginning with a(n-1) without its first digit. Single-digit primes are not allowed unless they arise from the previous term as multi-digit number with leading zero(s) (i.e., a(n-1) has 0 as second digit) which are remembered for the subsequent left-truncations.
11, 13, 31, 17, 71, 19, 97, 73, 37, 79, 907, 7, 701, 101, 103, 3, 307, 709, 911, 113, 131, 311, 1103, 1031, 313, 137, 373, 733, 331, 317, 173, 739, 397, 971, 719, 191, 919, 193, 937, 379, 797, 977, 773, 7307, 3079, 7901, 9011, 1109, 109, 929, 29, 941, 41, 107, 727, 271, 7103, 1033, 337, 3701, 7013
Offset: 1
Examples
After a(1) = 11, the next term must start with 1. 11 is already present, so 13 is next. After 13, the next term starts with 3, but it cannot be just 3 as that is a single digit. After 103, dropping the lead digit leaves 03, and 3 has not occurred before, so that is the next term. As sequences in the OEIS are sequences of numbers, not numerals, this appears in the sequence as 3. The subsequent term will be the next prime having as first digits the preceding 03 with the initial 0 removed (but not the 3 removed). Thus, it must start with 3, and since 3, 31 and 37 have already occurred, it's 307.
Links
- M. F. Hasler, Table of n, a(n) for n = 1..250
Programs
-
PARI
A089755(N,D=-1,u=[],a=11)={my(d); for(n=1,N, print1(a","); D>=0&&setsearch(Set(digits(a)),D)&&return([n,a]);u=setunion(u,[a]);a>9&&isprime(a%=10^d=#Str(a)-1)&&d>1&&!setsearch(u,a)&&next;for(d=1,999,a*=10;forstep(i=1,10^d-1,2,ispseudoprime(a+i)&&a+i>9&&!setsearch(u,a+i)&&(a+=i)&&next(3))));a} \\ If a 2nd argument D is given, then returns [n, a(n)] for the first a(n) having the digit D, if this occurs before the limit N. M. F. Hasler, Sep 18 2015
Extensions
Edited by Franklin T. Adams-Watters, Sep 18 2015
Definition reworded and data corrected and extended by M. F. Hasler, Sep 18 2015
Comments