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-2 of 2 results.

A023107 Largest integer in which every prefix is prime in base n (written in base 10).

Original entry on oeis.org

71, 191, 2437, 108863, 6841, 4497359, 1355840309, 73939133, 6774006887, 18704078369, 122311273757, 6525460043032393259, 927920056668659, 16778492037124607, 4928397730238375565449, 5228233855704101657, 3013357583408354653, 1437849529085279949589, 101721177350595997080671, 185720479816277907890970001
Offset: 3

Views

Author

Keywords

Comments

Or, largest right-truncatable prime with base n>2 (in decimal form).
a(n) <= A094335(n).

Examples

			a(100) = 70123916363515199416199518301698321195339012727994799// 190371992151279729974757397909992327936943877127375781091143. - _Giovanni Resta_, Apr 11 2016
		

Crossrefs

Cf. A076586.

Programs

  • PARI
    a(n) = my(S,m,D); D=select(x->(gcd(x,n)==1),vector(n-1,j,j)); S=select(ispseudoprime,vector(n-1,i,i)); while(#S, m=vecmax(S); S=concat(vector(#D,j,select(ispseudoprime,vector(#S,i,S[i]*n+D[j]))));); m /* Max Alekseyev, Dec 09 2014 */

Extensions

More terms from Don Reble, Jun 23 2004
a(54)-a(75) in b-file from Max Alekseyev, Dec 09 2014
a(76)-a(100) in b-file from Giovanni Resta, May 01 2016

A012883 Numbers in which every prefix (in base 10) is 1 or a prime.

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 53, 59, 71, 73, 79, 113, 131, 137, 139, 173, 179, 191, 193, 197, 199, 233, 239, 293, 311, 313, 317, 373, 379, 593, 599, 719, 733, 739, 797, 1319, 1373, 1399, 1733, 1913, 1931, 1933, 1973, 1979, 1993, 1997, 1999
Offset: 1

Views

Author

Larry Calmer (larry(AT)wri.com), Simon Plouffe

Keywords

Crossrefs

Cf. A024770 (every prefix is prime).

Programs

  • Mathematica
    max = 10^10; truncate[p_] := If[q = Quotient[p, 10]; q == 1 || PrimeQ[q], q, p]; ok[p_] := FixedPoint[truncate, p] < 10; p = 1; cnt = 2; A012883 = Join[{1}, Reap[While[(p = NextPrime[p]) < max, If[ok[p], Print[cnt++, " ", p]; Sow[p]]]][[2, 1]]] (* Jean-François Alcover, Nov 23 2015 *)
  • PARI
    for(n=1, 1e4, k=n; while(isprime(n) || n==1, c=n; n=(c-lift(Mod(c, 10)))/10); if(n==0, print1(k, ", ")); n=k) \\ Altug Alkan, Nov 23 2015

Extensions

Last term is A094335(10) = 1979339339 (confirmed by David W. Wilson ).
Showing 1-2 of 2 results.