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.

A076653 Smallest prime number not occurring earlier and starting with the final digit of the previous term.

Original entry on oeis.org

2, 23, 3, 31, 11, 13, 37, 7, 71, 17, 73, 307, 79, 97, 701, 19, 907, 709, 911, 101, 103, 311, 107, 719, 919, 929, 937, 727, 733, 313, 317, 739, 941, 109, 947, 743, 331, 113, 337, 751, 127, 757, 761, 131, 137, 769, 953, 347, 773, 349, 967, 787, 797, 7001, 139, 971
Offset: 1

Views

Author

Amarnath Murthy, Oct 28 2002

Keywords

Comments

This sequence is infinite but still does not contain all the primes. There is no way for 5 to appear, nor any higher prime starting with 5. - Alonso del Arte, Sep 19 2015
Moreover, it is an obvious fact that there is no way for any prime starting with 2 (aside from the first two), 4, 6 or 8 to appear. - Altug Alkan, Sep 20 2015
Apart from the first two terms, this sequence is identical to how it would be if it were to start with 5 and 53 instead of 2 and 23. - Maghraoui Abdelkader, Sep 22 2015
From Danny Rorabaugh, Dec 01 2015: (Start)
We can initiate with a different prime p (see the a-file):
p=3: [a(3), a(4), ...];
p=5: [5, 53, a(3), a(4), ...];
p=7: [7, 71, 11, 13, 3, 31, 17, 73, 37, ...];
etc.
Define p~q to mean that the sequences generated by p and q eventually coincide (with different offset allowed). For example, we can see that 2~3~5, but it appears these are not equivalent to 7. Empirically, there are exactly four equivalence classes of primes:
Starting with 1, or starting with 2/4/5/6/8 and ending with 1
[11, 13, 17, 19, 41, 61, 101, 103, 107, 109, 113, 127, 131, 137, ...];
Starting with 3, or starting with 2/4/5/6/8 and ending with 2/3/5
[2, 3, 5, 23, 31, 37, 43, 53, 83, 223, 233, 263, 283, 293, 307, ...];
Starting with 7, or starting with 2/4/5/6/8 and ending with 7
[7, 47, 67, 71, 73, 79, 227, 257, 277, 457, 467, 487, 547, 557, ...];
Starting with 9, or starting with 2/4/5/6/8 and ending with 9
[29, 59, 89, 97, 229, 239, 269, 409, 419, 439, 449, 479, 499, ...].
(End)

Crossrefs

Programs

  • Maple
    N:= 10^5: # get all terms before the first a(n) > N
    Primes:= select(isprime,[seq(i,i=3..N,2)]):
    Inits:= map(p -> floor(p/10^ilog10(p)), Primes):
    for d in [1,2,3,7,9] do
      Id[d]:= select(t -> Inits[t]=d, [$1..nops(Inits)]); p[d]:= 1;w[d]:= nops(Id[d]);
    od:
    A[1]:= 2:
    for n from 2 do
      d:= A[n-1] mod 10;
      if p[d] > w[d] then break fi;
      A[n]:= Primes[Id[d][p[d]]];
      p[d]:= p[d]+1;
    od:
    seq(A[i],i=1..n-1); # Robert Israel, Dec 01 2015
  • Mathematica
    prevLastDigPrime[seq_] := Block[{k = 1, lastDigit = Mod[Last@seq, 10]}, While[p = Prime@k; MemberQ[seq, p] || lastDigit != Quotient[p, 10^Floor[Log[10, p]]], k++]; Append[seq, p]]; Nest[prevLastDigPrime, {2}, 55] (* Robert G. Wilson v *)
    A076653 = {2}; Do[k = 2; d = Last@IntegerDigits@A076653[[n - 1]]; While[Or[MemberQ[A076653, k], First@IntegerDigits@k != d], k = NextPrime@k]; AppendTo[A076653, k], {n, 2, 60}]; A076653 (* Michael De Vlieger, Sep 21 2015 *)
  • Sage
    def A076653(lim,p=2):
        A = [p]
        while len(A)A076653(56) # Danny Rorabaugh, Dec 01 2015

Extensions

More terms from Robert G. Wilson v, Nov 17 2005