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 10 results.

A089394 Largest n-digit member of A089392, or 0 if there is no such n-digit term.

Original entry on oeis.org

7, 89, 881, 8821, 80849, 864883, 8608081, 48804809, 608844043, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Amarnath Murthy, Nov 10 2003

Keywords

Comments

A089392 has no members with 10, 11, or 12 digits. It is unlikely that it has any with more than 12 digits. - David Wasserman, Sep 15 2005
Giovanni Resta has checked this up to 16 digits. Indeed 5391391551358 and 97393713331910 are the only 13- resp. 14-digit numbers (not primes) with this property, i.e., in A252996. See Carlos Rivera's puzzle page for a probabilistic argument concerning the finiteness. - M. F. Hasler, Dec 25 and Dec 28 2014

Crossrefs

Programs

  • Maple
    with(combinat): ds:=proc(s) local j: RETURN(add(s[j]*10^(j-1),j=1..nops(s))):end: for d from 1 to 6 do sch:=[seq([1,op(i),d+1],i=[[],seq([j],j=2..d)])]: for n from 10^d-1 by -1 to 10^(d-1) do sn:=convert(n,base,10): fl:=0: for s in sch do m:=add(j,j=[seq(ds(sn[s[i]..s[i+1]-1]),i=1..nops(s)-1)]): if not isprime(m) then fl:=1: break fi od: if fl=0 then printf("%d, ",n):break fi od od: # C. Ronaldo

Extensions

More terms from C. Ronaldo (aga_new_ac(AT)hotmail.com), Dec 25 2004
3 more terms from David Wasserman, Sep 15 2005
Definition edited and a(10..16) = 0 added by M. F. Hasler, Dec 28 2014

A089393 Smallest n-digit magnanimous prime (A089392), or 0 if there is no such prime with n digits.

Original entry on oeis.org

2, 11, 101, 2221, 20261, 220021, 2000221, 20266681, 228440489, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Amarnath Murthy, Nov 10 2003

Keywords

Comments

A089392 has no members with 10, 11, or 12 digits. It is unlikely that it has any with more than 12 digits. - David Wasserman, Sep 15 2005
Giovanni Resta has checked this up to 16 digits, see Carlos Rivera's puzzle page for a probabilistic argument. - M. F. Hasler, Dec 28 2014

Crossrefs

Programs

  • Maple
    with(combinat): ds:=proc(s) local j: RETURN(add(s[j]*10^(j-1),j=1..nops(s))):end: for d from 1 to 10 do sch:=[seq([1,op(i),d+1],i=[[],seq([j],j=2..d)])]: for n from 10^(d-1) to 10^d-1 do sn:=convert(n,base,10): fl:=0: for s in sch do m:=add(j,j=[seq(ds(sn[s[i]..s[i+1]-1]),i=1..nops(s)-1)]): if not isprime(m) then fl:=1: break fi od: if fl=0 then printf("%d, ",n):break fi od od: # C. Ronaldo

Extensions

a(5) and a(6) from Mark Hudson (mrmarkhudson(AT)hotmail.com), Dec 15 2004
Corrected and extended by C. Ronaldo (aga_new_ac(AT)hotmail.com), Dec 25 2004
Two more terms from David Wasserman, Sep 15 2005
Definition edited and a(10..16) = 0 added by M. F. Hasler, Dec 28 2014

A211160 Number of n-digit terms in A089392 (magnanimous primes).

Original entry on oeis.org

4, 10, 17, 15, 10, 15, 7, 2, 4, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Zak Seidov, Jan 30 2013

Keywords

Comments

Apparently all next terms are zero.

Examples

			a(1) = 4: 2, 3, 5, 7.
a(2) = 10: 11, 23, 29, 41, 43, 47, 61, 67, 83, 89.
a(8) = 2: 20266681, 48804809.
a(9) = 4: 228440489, 244064027, 606202627, 608844043.
		

Crossrefs

Extensions

a(13)-a(15) from Donovan Johnson, Feb 17 2013

A252996 Magnanimous numbers: numbers such that the sum obtained by inserting a "+" anywhere between two digits gives a prime.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 14, 16, 20, 21, 23, 25, 29, 30, 32, 34, 38, 41, 43, 47, 49, 50, 52, 56, 58, 61, 65, 67, 70, 74, 76, 83, 85, 89, 92, 94, 98, 101, 110, 112, 116, 118, 130, 136, 152, 158, 170, 172, 203, 209, 221, 227, 229, 245, 265, 281, 310, 316, 334, 338, 356
Offset: 1

Views

Author

M. F. Hasler, Dec 25 2014

Keywords

Comments

Inclusion of the single-digit terms is conventional: here the property is voidly satisfied since no sum can be constructed by inserting a + sign between two digits, therefore all possible sums are prime. (It is not allowed to prefix a leading zero (e.g., to forbid 4 = 04 = 0+4) since in that case all terms must be prime and one would get A089392.)
All terms different from 20 and not of the form 10^k+1 have the last digit of opposite parity than that of all other digits.
The sequence is marked as "finite", although we do not have a rigorous proof for this, only very strong evidence (numerical and probabilistic). G. Resta has checked that up to 5e16 the only magnanimous numbers with more than 11 digits are 5391391551358 and 97393713331910, the latter being probably the largest element of this sequence. In that case the 10+33+79+104+112+96+71+35+18+6+5+0+1+1 = 571 terms listed in Wilson's b-file are the complete list, which is what the keyword "full" stands for.

Examples

			245 is in the sequence because the numbers 2 + 45 = 47 and 24 + 5 = 29 are both prime. See the first comment for the single-digit terms.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local d;
      for d from 1 to ilog10(n)-1 do
        if not isprime(floor(n/10^d)+(n mod 10^d)) then return false fi
      od:
      true
    end proc:
    select(filter, [$0..10^5]); # Robert Israel, Dec 25 2014
  • Mathematica
    fQ[n_] := Block[{idn = IntegerDigits@ n, lng = Floor@ Log10@ n}, Union@ PrimeQ@ Table[ FromDigits[ Take[ idn, i]] + FromDigits[ Take[ idn, -lng + i -1]], {i, lng}] == {True}]; (* or *)
    fQ[n_] := Block[{lng = Floor@ Log10@ n}, Union@ PrimeQ[ Table[ Floor[n/10^k] + Mod[n, 10^k], {k, lng}]] == {True}];
    fQ[2] = fQ[3] = fQ[5] = fQ[7] = True; Select[ Range@ 500, fQ]
    (* Robert G. Wilson v, Dec 26 2014 *)
    mnQ[n_]:=AllTrue[Total/@Table[FromDigits/@TakeDrop[IntegerDigits[n],i],{i,IntegerLength[n]-1}],PrimeQ]; Join[Range[0,9],Select[Range[ 10,400], mnQ]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 26 2017 *)
  • PARI
    is(n)={!for(i=1,#Str(n)-1,ispseudoprime([1,1]*(divrem(n,10^i)))||return)}
    t=0;vector(100,i,until(is(t++),);t)
    
  • Python
    from sympy import isprime
    def ok(n):
        s = str(n)
        return all(isprime(int(s[:i])+int(s[i:])) for i in range(1, len(s)))
    print([k for k in range(357) if ok(k)]) # Michael S. Branicky, Oct 14 2024

A089395 Prime productive numbers m: Let the digits of m be abcd. Then the numbers bcd*a+1, cd*ab+1, d*abc+1, abcd+1 etc. are all primes. If m is a k-digit number it produces k such primes.

Original entry on oeis.org

1, 2, 4, 6, 12, 16, 22, 28, 36, 52, 58, 66, 82, 106, 112, 136, 166, 178, 256, 306, 336, 352, 448, 502, 508, 556, 562, 586, 616, 652, 658, 718, 982, 1018, 1108, 1162, 1192, 1228, 1498, 1708, 2002, 2026, 2086, 2686, 2776, 2998, 3136, 3412, 3526, 3592, 4078, 4918
Offset: 0

Views

Author

Amarnath Murthy, Nov 10 2003

Keywords

Comments

Conjecture: Sequence is infinite.

Examples

			256 is a term as 2*56 + 1 = 113, 25*6 + 1 = 151 and 256 + 1 = 257 are all primes.
		

Crossrefs

Programs

  • Maple
    with(combinat): ds:=proc(s) local j: RETURN(add(s[j]*10^(j-1),j=1..nops(s))):end: for d from 1 to 6 do sch:=[seq([1,op(i),d+1],i=[[],seq([j],j=2..d)])]: for n from 10^(d-1) to 10^d-1 do sn:=convert(n,base,10): fl:=0: for s in sch do m:=mul(j,j=[seq(ds(sn[s[i]..s[i+1]-1]),i=1..nops(s)-1)])+1: if not isprime(m) then fl:=1: break fi od: if fl=0 then printf("%d, ",n) fi od od: # C. Ronaldo
  • Mathematica
    ppnQ[n_]:=Mod[n,10]!=0&&AllTrue[Times@@@Table[FromDigits/@TakeDrop[ IntegerDigits[ n],k]/.(0->1),{k,IntegerLength[n]}]+1,PrimeQ]; Select[Range[5000], ppnQ] (* The program uses the AllTrue and TakeDrop functions from Mathematica version 10 *) (* Harvey P. Dale, Mar 23 2019 *)

Extensions

Corrected and extended by C. Ronaldo (aga_new_ac(AT)hotmail.com), Dec 25 2004

A089695 Numbers m such that placing as many possible '+' signs anywhere in between the digits yields a prime in every case. Let abcd... be the digits of m; then abcd, a + bcd, ab + cd, abc + d, a + b + cd, a + bc + d, ab + c + d, a + b + c + d, ... are all prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 23, 29, 41, 43, 47, 61, 67, 83, 89, 101, 227, 229, 281, 401, 443, 449, 467, 601, 607, 647, 661, 683, 809, 821, 863, 881, 4001, 4463, 4643, 6007, 6067, 6803, 8009
Offset: 1

Views

Author

Amarnath Murthy, Nov 10 2003

Keywords

Comments

Though the first 27 terms match those of A089392, the next term of A089392 (2221) is not a member of this sequence. Conjecture: sequence is finite.
No more terms < 10^8. - David Wasserman, Oct 04 2005

Examples

			863 is a member 863, 8 + 63, 86 + 3, 8 + 6 + 3 are all prime.
		

Crossrefs

Cf. A089696.

Programs

  • Maple
    with(combinat): ds:=proc(s) local j: RETURN(add(s[j]*10^(j-1),j=1..nops(s))):end: for d from 1 to 6 do sch:=[seq([1,op(i),d+1],i=choose([seq(j,j=2..d)]))]: for n from 10^(d-1) to 10^d-1 do sn:=convert(n,base,10): fl:=0: for s in sch do m:=add(j,j=[seq(ds(sn[s[i]..s[i+1]-1]),i=1..nops(s)-1)]): if not isprime(m) then fl:=1: break fi od: if fl=0 then printf("%d, ",n) fi od od: # C. Ronaldo
    # second Maple program:
    b:= proc(s) option remember; (n-> {s, seq(seq(seq(""||x||"+"||y,
            y=b(s[i+1..n])), x=b(s[1..i])), i=1..n-1)})(length(s))
        end:
    q:= n-> andmap(isprime, map(parse, b(""||n))):
    select(q, [$1..10000])[];  # Alois P. Heinz, Oct 29 2021
  • Mathematica
    Select[Prime@Range@1010,And@@PrimeQ[n=#;Total/@(FromDigits/@#&/@Union[DeleteCases[SplitBy[#,#==-1&],{-1}]&/@(Insert[IntegerDigits@n,-1,#]&/@(List/@#&/@Rest@Subsets[Range@IntegerLength@n]))])]&] (* Giorgos Kalogeropoulos, Oct 29 2021 *)

Extensions

Corrected and extended by C. Ronaldo (aga_new_ac(AT)hotmail.com), Dec 25 2004

A252495 Restricted magnanimous numbers: numbers such that the sum obtained by inserting a "+" anywhere between two digits gives a prime, but no "leading zeros" may appear.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 14, 16, 20, 21, 23, 25, 29, 30, 32, 34, 38, 41, 43, 47, 49, 50, 52, 56, 58, 61, 65, 67, 70, 74, 76, 83, 85, 89, 92, 94, 98, 110, 112, 116, 118, 130, 136, 152, 158, 170, 172, 221, 227, 229, 245, 265, 281, 310, 316, 334, 338, 356
Offset: 1

Views

Author

M. F. Hasler, Dec 28 2014

Keywords

Comments

Inclusion of the single-digit terms is conventional: here the property is vacuously satisfied since no sum can be constructed by inserting a + sign between two digits, therefore all possible sums are prime. (It is not allowed to prefix a leading zero (e.g., to forbid 4 = 04 = 0+4) since in that case all terms must be prime and one would get A089392.)
The restriction on leading zeros means that numbers with digit 0 other than in the last position are excluded, so this sequence equals A252996 with terms in A252480 removed.
Since all primes > 2 are odd, all terms different from 11 and 20 have the last digit of opposite parity to that of all other digits.
As A252996, this sequence is "finite" (without rigorous proof), and up to 5e16 the only terms with more than 11 digits are 5391391551358 and 97393713331910, the latter being probably the largest element of this sequence (due to Giovanni Resta).
(See links for "intellectual ownership": The sequence (without single-digit terms) was suggested by Eric Angelini, a first list of terms computed by Lars Blomberg, then others. Hans Havermann observed that this is a variant of what had been termed "magnanimous numbers" at least 10 years ago by A. Murthy, G. Resta and/or C. Rivera, cf. A089392 and links.)

Examples

			110 is in the sequence since 1+10=11 and 11+0 = 11 are both prime.
101 is not in the sequence because although 10+1 = 11 and 1+01 = 2 are prime, the latter sum is forbidden since 01 has a leading zero.
Number, smallest and largest of the n-digit terms:
| n   #     min    max
| 1  10      0      9
| 2  33      11     98
| 3  69     110     998
| 4  90     1112    9910
| 5  81    11116    99998
| 6  71    111112   999994
| 7  54   1115756   9959374
| 8  25   11771992  95559998
| 9   9  117711170  995955112
|10   4  1777137770 9151995592
|11   4 22226226625 46884486265
|12   0  -
|13   1     5391391551358
|14   1     97393713331910
|15   0  -
		

Crossrefs

Programs

  • PARI
    is(n)=!for(i=1,#Str(n)-1,ispseudoprime([1,1]*(divrem(n,10^i)))||return)&&(n<100||vecmin(digits(n\10)))
    t=0;vector(100,i,until(is(t++),);t)

A089396 Smallest n-digit term of A089395.

Original entry on oeis.org

1, 12, 106, 1018, 10312, 105502, 1197058, 11056216
Offset: 0

Views

Author

Amarnath Murthy, Nov 10 2003

Keywords

Examples

			a(3) = 256 which is the smallest 3-digit number such that 2*56 + 1 = 113, 25*6 + 1 = 151 and 256 + 1 = 257 are all prime.
		

Crossrefs

Programs

  • Maple
    with(combinat): ds:=proc(s) local j: RETURN(add(s[j]*10^(j-1),j=1..nops(s))):end: for d from 1 to 7 do sch:=[seq([1,op(i),d+1],i=[[],seq([j],j=2..d)])]: for n from 10^(d-1) to 10^d-1 do sn:=convert(n,base,10): fl:=0: for s in sch do m:=mul(j,j=[seq(ds(sn[s[i]..s[i+1]-1]),i=1..nops(s)-1)])+1: if not isprime(m) then fl:=1: break fi od: if fl=0 then printf("%d, ",n):break fi od od: # C. Ronaldo

Extensions

Corrected and extended by C. Ronaldo (aga_new_ac(AT)hotmail.com), Dec 25 2004
One more term (a(7)) from Harvey P. Dale, Mar 23 2019

A089397 Largest n-digit member of A089395.

Original entry on oeis.org

6, 82, 982, 9748, 96052, 992548
Offset: 1

Views

Author

Amarnath Murthy, Nov 10 2003

Keywords

Crossrefs

Programs

  • Maple
    with(combinat): ds:=proc(s) local j: RETURN(add(s[j]*10^(j-1),j=1..nops(s))):end: for d from 1 to 6 do sch:=[seq([1,op(i),d+1],i=[[],seq([j],j=2..d)])]: for n from 10^d-1 by -1 to 10^(d-1) do sn:=convert(n,base,10): fl:=0: for s in sch do m:=mul(j,j=[seq(ds(sn[s[i]..s[i+1]-1]),i=1..nops(s)-1)])+1: if not isprime(m) then fl:=1: break fi od: if fl=0 then printf("%d, ",n):break fi od od: # C. Ronaldo

Extensions

More terms from C. Ronaldo (aga_new_ac(AT)hotmail.com), Dec 25 2004

A129616 10-digit numbers d_1d_2...d_10 such that all the nine numbers d_1...d_i + d_(i+1)...d_10 (0

Original entry on oeis.org

1777137770, 2240064227, 2444402809, 5753779594, 6464886245, 9151995592
Offset: 1

Views

Author

Farideh Firoozbakht, May 24 2007

Keywords

Comments

All terms are composite so there is no 10-digit Magnanimous prime.

Examples

			9151995592 is in the sequence because all the nine numbers 9+151995592, 91+51995592, 915+1995592, 9151+995592, 91519+95592, 915199+5592, 9151995+592, 91519955+92 & 915199559+2 are primes.
		

Crossrefs

Cf. A089392.
Showing 1-10 of 10 results.