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-10 of 11 results. Next

A071362 Smallest n-digit prime with strictly increasing digits.

Original entry on oeis.org

2, 13, 127, 1237, 12347, 123457, 1234789, 12356789
Offset: 1

Views

Author

Rick L. Shepherd, May 21 2002

Keywords

Crossrefs

Programs

  • PARI
    A071362(n, u=vectorv(n, i, 10^(n-i)))=forvec(d=vector(n, i, [1, 9]), isprime(d*u)&&return(d*u), 2) \\ M. F. Hasler, May 04 2017
    
  • Python
    from sympy import nextprime
    def inc(n):
      s = str(n); return len(s)==1 or all(d>pd for pd, d in zip(s[:-1], s[1:]))
    def a(n):
      p = nextprime(10**(n-1))
      while not inc(p): p = nextprime(p)
      return p
    for n in range(1, 9):
      print(a(n), end=", ") # Michael S. Branicky, Feb 13 2021

A038378 Integers which have more distinct digits than any smaller number.

Original entry on oeis.org

0, 10, 102, 1023, 10234, 102345, 1023456, 10234567, 102345678, 1023456789
Offset: 1

Views

Author

Keywords

Comments

Or: Smallest number with exactly n distinct digits. - M. F. Hasler, May 04 2017

Crossrefs

Programs

  • Mathematica
    Prepend[NestList[FromDigits[Append[IntegerDigits[#],Last[Union[IntegerDigits[#]]]+1]]&,10,8],0] (* Ivan N. Ianakiev, May 10 2015 *)
    Join[{0},Table[FromDigits[PadRight[{1,0},n,{1,0,2,3,4,5,6,7,8,9}]],{n,2,10}]] (* Harvey P. Dale, Sep 27 2016 *)
  • PARI
    A038378(n)=sum(i=1,n--,10^(n-i)*if(i>1,i,10)) \\ M. F. Hasler, May 04 2017

Extensions

Offset fixed by Reinhard Zumkeller, Aug 25 2009

A071360 Smallest n-digit prime with strictly decreasing digits.

Original entry on oeis.org

2, 31, 421, 5431, 75431, 764321, 8764321, 97654321
Offset: 1

Views

Author

Rick L. Shepherd, May 21 2002

Keywords

Crossrefs

A100369 Largest primes arising in A099756 which were built up from n distinct digits. This sequence differs from A007810 because more than one copy of each digit is permitted.

Original entry on oeis.org

11, 787, 22259, 70879, 607889, 4456789, 40456789, 304456879, 1123465789, 10123457689
Offset: 1

Views

Author

Labos Elemer, Nov 29 2004

Keywords

Comments

These primes are "largest among earliest primes" at fixed number of distinct digits chosen from A099756. Their position in A099756 are: {1,27,90,198,440,774,858,930,949,950}.

Examples

			n=3: a[3]=22259, built up from the 3-subset = {2,5,9} of decimal digits.
It appears in A099756 as the 90th term. It is by definition of A099756 is
the smallest prime that can be constructed from {2,5,9} and at the same time
it is the largest prime if running through all 3-subsets of decimal digits.
All terms includes at least 2 copies of some digit.
Differs from A007810[3]=983.
		

Crossrefs

Extensions

Edited by Charles R Greathouse IV, Aug 03 2010

A100370 Primes in A099756, sorted.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 37, 41, 43, 47, 53, 59, 61, 67, 79, 83, 89, 101, 103, 107, 109, 127, 137, 139, 149, 151, 157, 163, 167, 179, 181, 211, 227, 239, 241, 251, 257, 263, 269, 281, 283, 307, 347, 349, 359, 367, 379, 389, 401, 409, 431, 449, 457, 461
Offset: 1

Views

Author

Labos Elemer, Nov 30 2004

Keywords

Comments

Inspired by A099756.

Examples

			Positions of "minimal terms" (see A007809) inside A099756 and here, in A100370, are {2,8,31,138,320,574,779,900,942,950} or {1,6,23,84,250,494,721,873,934,950} respectively.
This is because the orders of A099756 and A100370 are based on different criteria.
		

Crossrefs

Programs

  • Mathematica
    < 0 &][[-2]]*10^(Length[ss[[n]]] -  If[ Mod[ FromDigits@ ss[[n]], 3] == 0, 0, 1]) - 1]}, While[ Union@ IntegerDigits@ p != id, p = NextPrime@ p]; p]; f[3] = 3; Sort@ Array[f, 950]

A141116 Smallest n-digit prime with no identical adjacent digits (or 0 if no such prime exists).

Original entry on oeis.org

2, 13, 101, 1013, 10103, 101021, 1010129, 10101023, 101010157, 1010101039, 10101010163, 101010101063, 1010101010131, 10101010101019, 101010101010131, 1010101010101037, 10101010101010141, 101010101010101083
Offset: 1

Views

Author

Rick L. Shepherd, Jun 05 2008

Keywords

Comments

For n >= 1, a(n) >= A056830(n), the least n-digit positive integer with no identical adjacent digits (also the least positive integer whose digits occur in n runs). Conjecture: For all n, a(n) <> 0.
If the conjecture is true, then this sequence and the following two sequences are equivalent: i) Smallest prime with exactly n runs of digits and ii) Smallest prime with at least n runs of digits. For each n <= 625, a(n) is an n-digit prime (provided that each probable prime shown in the link is indeed a prime -- or at least one of very many (slightly) larger probable prime candidates is prime).
As each a(n) shown is very near A056830(n), I believe it is extremely unlikely that a randomly-given n would yield a 0 term (but I don't have a proof for arbitrary n).

Examples

			a(4) = 1013 because 1013 is the smallest 4-digit prime having no identical adjacent digits; the only smaller 4-digit prime, 1009, is disqualified by the "00", identical adjacent digits (of run length 2). Also each digit, 1, 0, 1, 3, occurs in a run of identical digits of length 1 for a total of 4 runs with 1013 being the smallest prime of any length with 4 runs of digits.
		

Crossrefs

A259146 Smallest prime with first n digits distinct.

Original entry on oeis.org

2, 13, 103, 1039, 10243, 102359, 1023467, 10234589, 102345689, 10234567897
Offset: 1

Views

Author

Zak Seidov, Jun 19 2015

Keywords

Comments

The sequence is complete: n=1..10.

Crossrefs

Programs

  • Python
    from sympy import nextprime
    def a(n):
      p = nextprime(10**(n-1))
      while len(set(str(p)[:n])) < n: p = nextprime(p)
      return p
    for n in range(1, 11):
      print(a(n), end=", ") # Michael S. Branicky, Feb 13 2021

Formula

a(n) = A007809(n), n<=9. - R. J. Mathar, Jul 06 2015

A360505 Concatenate the ternary strings for n, n-1, n-2, ..., 2, 1.

Original entry on oeis.org

1, 21, 1021, 111021, 12111021, 2012111021, 212012111021, 22212012111021, 10022212012111021, 10110022212012111021, 10210110022212012111021, 11010210110022212012111021, 11111010210110022212012111021, 11211111010210110022212012111021, 12011211111010210110022212012111021
Offset: 1

Views

Author

N. J. A. Sloane, Feb 17 2023

Keywords

Comments

Similar to A360502, but here we count down from n to 1 in base 3 and concatenate the strings to get a(n).
This is the ternary analog of A000422.

Crossrefs

Programs

  • Mathematica
    a[n_] := FromDigits @ Flatten @ IntegerDigits[Range[n, 1, -1], 3]; Array[a, 15] (* Amiram Eldar, Feb 18 2023 *)
  • PARI
    a(n) = strjoin(concat([digits(k, 3) | k <- Vecrev([1..n])])) \\ Rémy Sigrist, Feb 18 2023
    
  • Python
    from sympy.ntheory import digits
    def a(n): return int("".join("".join(map(str, digits(k, 3)[1:])) for k in range(n, 0, -1)))
    print([a(n) for n in range(1, 16)]) # Michael S. Branicky, Feb 18 2023
    
  • Python
    # faster version for initial segment of sequence
    from sympy.ntheory import digits
    from itertools import count, islice
    def agen(s=""): yield from (int(s:="".join(map(str, digits(n, 3)[1:]))+s) for n in count(1))
    print(list(islice(agen(), 15))) # Michael S. Branicky, Feb 18 2023

A081716 Smallest number x such that phi(x)=A000010(x) has exactly n different decimal digits.

Original entry on oeis.org

2, 11, 103, 1033, 10247, 102359, 1023487, 10234759, 102345979, 1023475969
Offset: 1

Views

Author

Labos Elemer, Apr 04 2003

Keywords

Examples

			phi applied to the sequence gives: 1, 10, 102, 1032, 10246, 102358, 1023486, 10234758, 102345978, ...
		

Crossrefs

Programs

  • Mathematica
    f[x_] := Length[Union[IntegerDigits[x]]]
    t=Table[0, {10}];
    Do[s=f[n]; If[PrimeQ[n]&&s<11&&t[[s]]==0,
    t[[s]]=n], {n, 1, 10000000000}];

Extensions

a(10) from Donovan Johnson, Feb 05 2010

A141405 Smallest n-digit prime using the most distinct and consecutive digits.

Original entry on oeis.org

2, 23, 101, 1423, 10243, 102043, 1234657, 10243567, 100234657, 1123465789, 10123457689, 100123456789, 1001233458679, 10011223456879, 100122334546789, 1001122334546879
Offset: 1

Views

Author

Lekraj Beedassy, Aug 03 2008, Aug 09 2008

Keywords

Examples

			a(10)=1123465789 and not 1002430567 because although the latter prime is smaller it does not have the most distinct digits. Similarly,a(13)= 1001233458679 and not 1001123456897. Note that for n >=11,all digits 0 through 9 are used.
		

Crossrefs

Cf. A007809 [From Lekraj Beedassy, Sep 14 2008]
Showing 1-10 of 11 results. Next