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

A048376 Replace each 1 in decimal expansion of n with 1 1's, each 2 with 2 2's, etc. (0 vanishes).

Original entry on oeis.org

1, 22, 333, 4444, 55555, 666666, 7777777, 88888888, 999999999, 1, 11, 122, 1333, 14444, 155555, 1666666, 17777777, 188888888, 1999999999, 22, 221, 2222, 22333, 224444, 2255555, 22666666, 227777777, 2288888888, 22999999999, 333, 3331
Offset: 1

Views

Author

Patrick De Geest, Mar 15 1999

Keywords

Examples

			12 -> 122, 123->122333.
		

Crossrefs

Programs

  • Mathematica
    With[{rules=Table[n->Table[n,{n}],{n,0,9}]},Table[FromDigits[ Flatten[ IntegerDigits[x]/.rules]],{x,40}]] (* Harvey P. Dale, Oct 09 2011 *)
  • PARI
    A048376(n)={sum(i=1,#n=concat( apply( t->vector(t,i,t),digits(n) )),n[i]*10^(#n-i))} \\ M. F. Hasler, Jan 23 2013

A057630 Primes such that replacing each digit d with d copies of the digit d produces a prime. Zeros are allowed.

Original entry on oeis.org

11, 31, 53, 101, 131, 149, 223, 283, 311, 313, 331, 397, 463, 503, 641, 691, 937, 941, 1031, 1049, 1069, 1301, 1409, 1439, 1511, 1609, 1741, 1871, 1949, 1993, 1999, 2083, 2111, 2203, 2447, 2803, 2939, 3001, 3011, 3061, 3163, 3301, 3391, 3433, 3499, 3559
Offset: 1

Views

Author

G. L. Honaker, Jr., Oct 10 2000

Keywords

Comments

"Replacing each digit d with d copies of the digit d" is the function A048376, well defined on the set of positive integers. Therefore (the range of) the present sequence is the largest subset of A000040 stable under the operation A048376.
A004022 is a subsequence. - Chai Wah Wu, Dec 19 2019

Examples

			E.g. 641 becomes 66666644441 which is also prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[500]],PrimeQ[FromDigits[Flatten[Table[#,{#}]&/@ IntegerDigits[ #]]]]&]  (* Harvey P. Dale, Dec 18 2010 *)
  • PARI
    is_A057630(n)={isprime(A048376(n)) && isprime(n)} \\ M. F. Hasler, Jan 23 2013
    
  • Python
    from sympy import isprime, nextprime
    A057630_list, dlist, p = [], [str(d)*d for d in range(10)], 2
    while len(A057630_list) < 10000:
        if isprime(int(''.join(dlist[int(d)] for d in str(p)))):
            A057630_list.append(p)
        p = nextprime(p) # Chai Wah Wu, Dec 19 2019, corrected Jan 01 2022

Extensions

More terms from Patrick De Geest, Oct 15 2000
Offset changed to 1, according to OEIS conventions, by M. F. Hasler, Jan 23 2013

A057692 Smallest prime which produces exactly n+1 different primes after n applications of the A048376 transform.

Original entry on oeis.org

2, 31, 641, 12422153, 66132153133
Offset: 0

Views

Author

G. L. Honaker, Jr., Oct 20 2000

Keywords

Comments

a(4) found by Carlos Rivera and confirmed to be the smallest by Paul Jobling (Paul.Jobling(AT)WhiteCross.com)
a(5) = 66132153133 leads to a final (probable) prime of 3560 digits. If zero is allowed, then a(5) = 12505785661 and the last (probable) prime would have 10982 digits. - Giovanni Resta, Sep 15 2011

Examples

			31 becomes 3331 and both 31 and 3331 are primes. 641 becomes 66666644441 and then 66666666666666666666666666666666666644444444444444441 and all 3 are primes.
		

Crossrefs

a(1,2,3,...) is a subsequence of A057628.

Programs

  • PARI
    A057692(n,s=2)={ forprime(p=s,, my(q=p); for(i=2,n, isprime(q=A048376(q))||next(2)); isprime(A048376(q))||return(p))} \\ Impractical for n>3. - M. F. Hasler, Jan 23 2013

Extensions

a(5) from Giovanni Resta, Sep 15 2011
Definition corrected by M. F. Hasler, Jan 23 2013

A244853 Let d(1)d(2)... d(q) denote the decimal expansion of a prime number n > 9. The sequence lists the primes such that replacing each digit d(i) with d(i+1) copies for i = 1..q-1 and d(q) with d(1) copies produces a prime. Zeros are not allowed.

Original entry on oeis.org

11, 17, 71, 113, 131, 151, 167, 181, 211, 227, 281, 431, 467, 521, 547, 617, 743, 829, 853, 883, 1163, 1193, 1733, 2131, 2137, 3121, 3181, 3413, 3457, 3727, 4441, 5351, 6143, 6151, 6473, 6779, 6823, 6977, 8263, 8293, 8423, 9787, 11273, 11321, 11369, 11483
Offset: 1

Views

Author

Michel Lagneau, Jul 07 2014

Keywords

Examples

			6473 is in the sequence because 6473 becomes 66664444444777333333 which is also prime.
		

Crossrefs

Cf. A057628.

Programs

  • Maple
    for n from 5 to 2500 do:
         p := ithprime(n): s :=0: j :=0:
         x := convert(p, base, 10): n1 := nops(x):
         q := mul(x[i], i=1..n1):
         if q<>0 then
             for m from n1 by -1 to 2 do:
                s := s*10^x[m-1]+add(x[m]*10^(i-1+j),i=1.. x[m-1]):
             od:
             s1 := add(x[1]*10^(i-1), i=1..x[n1]):
             z := s*10^x[n1]+s1:
             if isprime(z) then printf(`%d, `, p) fi:
         fi:
    od:
  • Mathematica
    deQ[n_]:=Module[{idn=IntegerDigits[n]},idn=Join[idn,{idn[[1]]}];FreeQ[ idn,0] && PrimeQ[FromDigits[Flatten[Table[#[[1]],{#[[2]]}]&/@ Partition[ idn,2,1]]]]]; Select[ Prime[Range[5,1500]],deQ] (* Harvey P. Dale, Mar 26 2016 *)
  • PARI
    isok(n) = {if (isprime(n) && (d=digits(n)) && (#d>1) && vecmin(d), s = ""; for (id = 1, #d, if (id != #d, idk = d[id+1], idk = d[1]); for (k=1, idk, s = concat(s, d[id]));); isprime(eval(s)););} \\ Michel Marcus, Jul 09 2014
Showing 1-4 of 4 results.