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

A032758 Undulating primes (digits alternate).

Original entry on oeis.org

2, 3, 5, 7, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 131, 151, 181, 191, 313, 353, 373, 383, 727, 757, 787, 797, 919, 929, 18181, 32323, 35353, 72727, 74747, 78787, 94949, 95959, 1212121, 1616161, 323232323, 383838383
Offset: 1

Views

Author

Patrick De Geest, May 15 1998

Keywords

Comments

Sometimes called "smoothly undulating primes", to distinguish them from A059168.

References

  • C. A. Pickover, "Keys to Infinity", Wiley 1995, p. 159,160.
  • C. A. Pickover, "Wonders of Numbers", Oxford New York 2001, Chapter 52, pp. 123-124, 316-317.

Crossrefs

Programs

  • Mathematica
    a[n_] := DeleteDuplicates[Take[IntegerDigits[n],{1,-1,2}]]; b[n_] := DeleteDuplicates[Take[IntegerDigits[n],{2,-1,2}]]; t={}; Do[p=Prime[n]; If[p<10, AppendTo[t,p], If[Length[a[p]] == Length[b[p]] == 1 && a[p][[1]] != b[p][[1]], AppendTo[t,p]]], {n,3*10^7}]; t (* Jayanta Basu, May 04 2013 *)
  • Python
    from itertools import count, islice
    from sympy import isprime, primerange
    def agen(): # generator of terms
        yield from (p for p in primerange(2, 100) if p != 11)
        yield from (t for t in (int((A+B)*d2+A) for d2 in count(1) for A in "1379" for B in "0123456789" if A != B) if isprime(t))
    print(list(islice(agen(), 51))) # Michael S. Branicky, Jun 09 2022

Extensions

Sequence corrected by Juri-Stepan Gerasimov, Jan 28 2010
Offset corrected by Arkadiusz Wesolowski, Sep 13 2011

A235154 Primes which have one or more occurrences of exactly two different digits.

Original entry on oeis.org

13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 113, 131, 151, 181, 191, 199, 211, 223, 227, 229, 233, 277, 311, 313, 331, 337, 353, 373, 383, 433, 443, 449, 499, 557, 577, 599, 661, 677, 727, 733, 757, 773, 787, 797, 811
Offset: 1

Views

Author

Colin Barker, Jan 04 2014

Keywords

Comments

The first term having a repeated digit is 101.
a(3402) > 10^10.

Crossrefs

Programs

  • PARI
    s=[]; forprime(n=10, 1000, if(#vecsort(eval(Vec(Str(n))),,8)==2, s=concat(s, n))); s
    
  • PARI
    is(n)=isprime(n) && #Set(digits(n))==2 \\ Charles R Greathouse IV, Feb 23 2017
    
  • PARI
    \\ See Corneth link
    
  • Python
    from sympy import isprime
    from sympy.utilities.iterables import multiset_permutations
    from itertools import count, islice, combinations_with_replacement, product
    def agen():
        for digits in count(2):
            s = set()
            for pair in product("0123456789", "1379"):
                if pair[0] == pair[1]: continue
                for c in combinations_with_replacement(pair, digits):
                    if len(set(c)) < 2 or sum(int(ci) for ci in c)%3 == 0:
                        continue
                    for p in multiset_permutations(c):
                        if p[0] == "0": continue
                        t = int("".join(p))
                        if isprime(t):
                            s.add(t)
            yield from sorted(s)
    print(list(islice(agen(), 100))) # Michael S. Branicky, Jan 23 2022

A039986 Primes such that every distinct permutation of digits is composite (including permutations with leading zeros).

Original entry on oeis.org

2, 3, 5, 7, 11, 19, 23, 29, 41, 43, 47, 53, 59, 61, 67, 83, 89, 151, 211, 223, 227, 229, 233, 257, 263, 269, 353, 383, 409, 431, 433, 443, 449, 487, 499, 523, 541, 557, 599, 661, 677, 773, 827, 829, 853, 859, 881, 883, 887, 929, 997, 1447, 1451, 1481, 2111
Offset: 1

Views

Author

Keywords

Comments

At most one permutation of digits of A179239 can occur in this sequence. - David A. Corneth, Jun 28 2018
Is there a term with more than 4 distinct digits? - David A. Corneth, Jun 30 2018
Up through 9999991 (the largest 7-digit prime) there are no terms with more than 4 distinct digits. - Harvey P. Dale, Dec 12 2018
The sequence can be seen as a table with the n-digit terms in row n. Row lengths would then be (4, 13, 34, 45, 68, 67, 47, 36, 40, 46, 33, 45, 35, 38, 32, ...). In these rows there are (0, 0, 0, 6, 9, 3, 0, 1, 0, 0, ...) terms with >= 4 distinct digits: this seems to happen only for terms with 4, 5, 6 or 8 digits. I conjecture that there are no more than these 6 + 9 + 3 + 1 = 19 terms (2861, 4027, 4801, 5209, 5623, 5849, 24889, 26561, 40609, 40883, 66541, 66853, 85087, 85843, 86441, 288689, 442469, 558541, 55555429) with 4, and none with 5 or more distinct digits. - M. F. Hasler, Jul 01 2018
Prime repunits (A004022) are a subset of this sequence. As larger terms are seemingly all near-repdigit primes, it is possible to obtain very large terms. For example: (10^10002 - 1)/9 - 10^2872. - Hans Havermann, Jul 08 2018

Crossrefs

Cf. A225421 (only odd digits).
Cf. A244529 for another variant. - M. F. Hasler, Jun 28 2018

Programs

  • Mathematica
    t = {}; Do[p=Prime[n]; If[Length[Select[Table[FromDigits[k], {k,Permutations[IntegerDigits[p]]}], PrimeQ]] == 1, AppendTo[t,p]], {n,330}]; t (* Jayanta Basu, May 07 2013 *)
    Select[Prime[Range[400]],AllTrue[FromDigits/@Rest[ Permutations[ IntegerDigits[#]]], CompositeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Nov 22 2015 *)
  • PARI
    is(n,d=digits(n))={isprime(n)&&!for(i=1,(#d)!, (n=vecextract(d,numtoperm(#d,i)))!=d&& isprime(fromdigits(n))&& return)} \\ Then: select(is,primes(500)) - M. F. Hasler, Jun 28 2018
    is(n)={isprime(n)||return; my(d=vecsort(digits(n), (a, b)->if(a-b&& t=bittest(650, a)-bittest(650, b),t,a-b)), p=vector(#d,i,i), N(p,i=2)= while((t=p[i]-1)&& while((setsearch(Set(p[i+1..#p]),t)|| d[t]==d[p[i]])&& t--,); !t, i++>#p&& return); i<#p|| bittest(650, d[t])|| return; concat([setminus(Set(p[1..i]),[t]), t, p[i+1..#p]]), t); #d==1|| !until(!p=N(p),(n!=t=fromdigits(vecextract(d,p)))&& isprime(t)&& return)} \\ Produces only inequivalent permutations which can be prime. - M. F. Hasler, Jun 28 2018
    A039986_row(n)={if(n>1, local(D=eval(Vec("0245681379")), u=vectorv(n, i, 10^(n-i)), nextperm()=for(i=2,n,(t=p[i]-1)&& while(setsearch(Set(p[i+1..n]),t)|| d[t]==d[p[i]], t--||break); t|| next; iM. F. Hasler, Jul 01 2018
    
  • Python
    from itertools import count, islice, combinations_with_replacement
    from sympy.utilities.iterables import multiset_permutations
    from sympy import isprime
    def A039986_gen(): # generator of terms
        for l in count(1):
            xlist = []
            for p in combinations_with_replacement('0123456789',l):
                flag = False
                for q in multiset_permutations(p):
                    if isprime(m:=int(''.join(q))):
                        if flag or q[0]=='0':
                            flag = False
                            break
                        else:
                            flag = True
                            r = m
                if flag:
                    xlist.append(r)
            yield from sorted(xlist)
    A039986_list = list(islice(A039986_gen(),30)) # Chai Wah Wu, Dec 26 2023

Extensions

Name clarified upon the suggestion of Robert Israel, Jun 30 2018

A092696 Smoothly undulating palindromic primes of the form (12*10^n-21)/99.

Original entry on oeis.org

1212121, 12121212121, 1212121212121212121212121212121212121212121
Offset: 1

Views

Author

Rick L. Shepherd, Mar 04 2004

Keywords

Comments

The De Geest link calls these smoothly undulating palindromic primes. Corresponding n are given in A062209. Equivalently, primes of the form 1212...121: Decimal digits "12" repeated k times with 1 appended (or "21" repeated k times with 1 prefixed). Corresponding k are given in A056803. The next term, a(4), has "12" repeating A056803(4) = 69 times and length A062209(4) = 2*A056803(4) + 1 = 139 decimal digits.

Crossrefs

Cf. A056803 (number of 12's (or 21's)), A062209 (corresponding decimal digit lengths).

Formula

a(n) = (4*10^A062209(n)-7)/33. - M. F. Hasler, Jul 30 2015

Extensions

Edited by M. F. Hasler, Jul 30 2015

A090155 Primes of the form identical digits preceded by a 7.

Original entry on oeis.org

7, 71, 73, 79, 733, 7333, 79999, 733333, 799999, 71111111, 799999999, 79999999999, 79999999999999999999999999, 79999999999999999999999999999999999999999999999999
Offset: 1

Views

Author

Robert G. Wilson v, Nov 22 2003

Keywords

Crossrefs

Subsequence of A030096 and of A030291. Apart from the first term, a subsequence of A235154.

Programs

  • Mathematica
    Select[ FromDigits /@ Flatten[ Table[ PadRight[{7}, i, # ] & /@ {1, 2, 3, 4, 5, 6, 7, 8, 9}, {i, 2, 50}], 1], PrimeQ[ # ] &]
    Select[FromDigits/@Flatten[Table[PadRight[{7},i,#]&/@{1,3,7,9},{i,50}],1],PrimeQ[#]&]//Union (* Harvey P. Dale, Nov 22 2024 *)

A048518 Primes containing only two distinct digits whose sum of digits is 28, the second perfect number.

Original entry on oeis.org

1999, 9199, 338383, 383833, 1181881, 1881181, 1881811, 2222929, 2922229, 8118181, 8188111, 8881111, 9222229, 15551551, 15555151, 15555511, 16166611, 16616161, 33333373, 33733333, 34434343, 44334343, 44343433, 51155551, 51515551, 55155151, 55155511, 55515151
Offset: 1

Views

Author

Patrick De Geest, May 15 1999

Keywords

Comments

Calculated by Robert T. McQuaid (robert.mcquaid(AT)headwaters.com).

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[3100000]],Count[DigitCount[#],0]==8&&Total[ IntegerDigits[ #]]==28&] (* Harvey P. Dale, Jun 11 2016 *)

Extensions

More terms from Naohiro Nomoto, Jul 28 2001
Offset corrected by Sean A. Irvine, Jun 20 2021

A073064 Primes with non-distinct digits.

Original entry on oeis.org

11, 101, 113, 131, 151, 181, 191, 199, 211, 223, 227, 229, 233, 277, 311, 313, 331, 337, 353, 373, 383, 433, 443, 449, 499, 557, 577, 599, 661, 677, 727, 733, 757, 773, 787, 797, 811, 877, 881, 883, 887, 911, 919, 929, 977, 991, 997, 1009, 1013, 1019
Offset: 1

Views

Author

Zak Seidov, Aug 24 2002

Keywords

Comments

A000040 INTERSECT A109303. - R. J. Mathar, May 01 2008
Comment from N. J. A. Sloane, Jan 22 2023 (Start)
A "nontrivial permutation" means any one of the m!-1 elements of S_m apart from the identity permutation.
This sequence consists of those primes that are fixed under at least one nontrivial permutation of its digits.
A prime p is in the sequence iff its decimal expansion p = d_1 d_2 ... d_m is such that there is a non-identity permutation pi in S_m with the property that p = d_pi(1) d_pi(2) ... d_pi(m). (End)

Examples

			a(1)=11 because 11 is the first prime not all digits of which are distinct; a(2)=101 because 101 is the second prime not all digits of which are distinct.
		

Crossrefs

Programs

  • Maple
    A055642 := proc(n) max(ilog10(n)+1,1) ; end: A043537 := proc(n) nops(convert(convert(n,base,10),set)) ; end: isA109303 := proc(n) RETURN( A055642(n) > A043537(n) ) ; end: isA073064 := proc(n) RETURN(isprime(n) and isA109303(n) ) ; end: for n from 1 to 1019 do if isA073064(n) then printf("%d,",n) ; fi ; od: # R. J. Mathar, May 01 2008
  • Mathematica
    ta=IntegerDigits[Prime[Range[1000]]]; ta2=Table[Length[ta[[i]]]>Length[Union[ta[[i]]]], {i, 1000}]; Prime[Flatten[Position[ta2, True]]]

A073069 Indices of primes with non-distinct digits.

Original entry on oeis.org

5, 26, 30, 32, 36, 42, 43, 46, 47, 48, 49, 50, 51, 59, 64, 65, 67, 68, 71, 74, 76, 84, 86, 87, 95, 102, 106, 109, 121, 123, 129, 130, 134, 137, 138, 139, 141, 151, 152, 153, 154, 156, 157, 158, 165, 167, 168, 169, 170, 171, 172, 173, 174, 177, 178, 182, 185, 186
Offset: 1

Views

Author

Zak Seidov Aug 24 2002

Keywords

Crossrefs

Indices of primes in A073064. Cf. A030291.

Programs

  • Mathematica
    ta=IntegerDigits[Prime[Range[1000]]]; ta2=Table[Length[ta[[i]]]>Length[Union[ta[[i]]]], {i, 1000}]; Flatten[Position[ta2, True]]
  • Python
    from sympy import prime, primerange
    def ok(p): s = str(p); return len(set(s)) < len(s)
    def aupto(limit):
      alst = []
      for pi, p in enumerate(primerange(1, prime(limit)+1), start = 1):
        if ok(p): alst.append(pi)
      return alst
    print(aupto(186)) # Michael S. Branicky, May 26 2021
Showing 1-8 of 8 results.