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.

Showing 1-3 of 3 results.

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

A262254 a(1) = 11; for n>1, a(n) is the smallest prime that starts with the least significant digit of the previous term and has not occurred earlier.

Original entry on oeis.org

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

Views

Author

Maghraoui Abdelkader, Sep 16 2015

Keywords

Comments

This sequence is different from A089755, as this one does not include single-digit primes.
This sequence is different from A089755, for which a(n+1) uses all the digit of a(n) except the most-significant digit of a(n).
In this sequence, a(n+1) uses only the least-significant digit of a(n).

Examples

			a(3) = 31 where the most significant digit of 31 is 3, which is the least significant digit of a(2) = 13.
		

Crossrefs

Programs

  • Mathematica
    f[s_List] := Block[{lsd = Mod[s[[-1]], 10], p = 3}, While[ IntegerDigits[p][[1]] != lsd || MemberQ[s, p], p = NextPrime@ p]; Append[s, p]]; s = {11}; s = Nest[f, s, 70] (* Robert G. Wilson v, Sep 16 2015 *)
  • PARI
    msd(n)=(n\10^(#Str(n)-1)); l1=1;l3=1;l7=1;l9=1; q=1; lsd(n)=n%10;
    t1 = vector(200); i=1;forprime(n=11,10000, if( digits(n)[1]==1,t1[i]=n; i=i+1 ; )) ;
    t3 = vector(130); i=1;forprime(n=31,3900 ,  if( digits(n)[1]==3,t3[i]=n; i=i+1 ; ));
    t7 = vector(130); i=1;forprime(n=71,70000, if( digits(n)[1]==7,t7[i]=n; i=i+1 ; )) ;
    t9 = vector(130); i=1;forprime(n=97,90000, if( digits(n)[1]==9,t9[i]=n; i=i+1 ; )) ;lsd(n)=n%10;
    t = vector(200);
    findnextnumber(m) =
    {if(lsd(m)==1, l1=t1[i1] ; i1=i1+1;return(l1);); if(lsd(m)==3, l3=t3[i3];  i3=i3+1 ; return(l3););
    if(lsd(m)==7, l7=t7[i7] ; i7=i7+1;return(l7);); if(lsd(m)==9, l9=t9[i9];  i9=i9+1;return(l9);); }
    i1=1;  i3=1;  i7=1;  i9=1;  j=1;s=11;   for(n=1,200,   p=findnextnumber(s) ; t[j]=p; s=p;j++);for(i=1,200, print1(t[i],", ") )

A321523 List of pairs: primes whose reversal is also prime, each followed by its reversal.

Original entry on oeis.org

2, 2, 3, 3, 5, 5, 7, 7, 11, 11, 13, 31, 17, 71, 31, 13, 37, 73, 71, 17, 73, 37, 79, 97, 97, 79, 101, 101, 107, 701, 113, 311, 131, 131, 149, 941, 151, 151, 157, 751, 167, 761, 179, 971, 181, 181, 191, 191, 199, 991, 311, 113, 313, 313, 337, 733, 347, 743, 353, 353
Offset: 1

Views

Author

Kritsada Moomuang, Nov 12 2018

Keywords

Examples

			The sequence begins:
     2,  2;
     3,  3;
     5,  5;
     7,  7;
    11, 11;
    13, 31;
    17, 71;
    31, 13;
    37, 73;
    71, 17;
...
107 has its reversal as 701.
971 has its reversal as 179.
		

Crossrefs

Subsequence of A135020.

Programs

  • Mathematica
    Flatten@ Table[ If[PrimeQ[r = IntegerReverse@ p], {p,r}, {}], {p, Prime@ Range@ 71}] (* Giovanni Resta, Nov 13 2018 *)
  • PARI
    forprime(p=1, 353, r=fromdigits(Vecrev(digits(p))); if (isprime(r), print1(p ", " r ", "))) \\ Rémy Sigrist, Nov 16 2018

Formula

a(2n-1) = A007500(n).
a(2n) = A004086(A007500(n)).
a(2n) = A095180(n). - Rémy Sigrist, Nov 16 2018
Showing 1-3 of 3 results.