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

A089392 Magnanimous primes: primes with the property that inserting a "+" in any place between two digits yields a sum which is 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, 2221, 2267, 2281, 2447, 4001, 4027, 4229, 4463, 4643, 6007, 6067, 6803, 8009, 8221, 8821, 20261, 24407, 26881, 28429, 40427
Offset: 1

Views

Author

Amarnath Murthy, Nov 10 2003

Keywords

Comments

Original definition: Let the digits of n be abcd. Then bcd+a, cd+ab, d+abc, abcd, etc. must all be primes. If n is a k-digit number then it must produce k such primes.
Partition the digits of n into two groups by placing a '+' sign anywhere inside; the result of the expression is prime in every case. Conjecture: sequence is infinite. 11 is the largest term with all odd digits. 2 is the only member with all even digits. Observation: all two-digit primes with the most significant digit even are members.
In contradiction to the above conjecture, it is rather expected that this sequence is finite, cf. the link to C. Rivera's "Puzzle 401", and G. Resta's web page. Concerning the statement about 2 and 11, one can say that all terms except 2, 11 and 101 consist of even digits followed by a final odd digit. - M. F. Hasler, Dec 25 2014
Primes among the magnanimous numbers A252996. - M. F. Hasler, Dec 25 2014

Examples

			2267 is a member which gives primes 2+267 = 269, 22+67 = 89, 226+7 = 233 and 2267 itself.
		

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:=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
  • Mathematica
    mpQ[n_]:=Module[{idn=IntegerDigits[n],len},len=Length[idn];And@@PrimeQ[ Table[ FromDigits[Take[idn,i]]+FromDigits[Take[idn,-(len-i)]],{i,len}]]]; Select[Range[41000],mpQ] (* Harvey P. Dale, Nov 06 2013 *)
  • PARI
    is_A089392(n)={!for(i=1,#Str(n),ispseudoprime([1,1]*(divrem(n,10^i)))||return)} \\ M. F. Hasler, Dec 25 2014
    
  • Python
    from sympy import isprime
    def ok(n):
        if not isprime(n): return False
        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

Extensions

Corrected and extended by C. Ronaldo (aga_new_ac(AT)hotmail.com), Dec 25 2004
Comments edited by Zak Seidov, Jan 29 2013
Edited by M. F. Hasler, Dec 25 2014

A348674 Number of distinct values that can be produced by splitting n and adding the parts.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4
Offset: 0

Views

Author

Alois P. Heinz, Oct 29 2021

Keywords

Comments

Differs from A055642 first at n=120: a(120) = 4 != 3 = A055642(120).
The number of split positions can vary from 0 to length(n)-1.

Examples

			a(0) = 1: 0.
a(10) = 2: 1 = 1+0, 10.
a(100) = 3: 1 = 1+0+0, 10 = 10+0, 100.
a(120) = 4: 3 = 1+2+0, 12 = 12+0, 21 = 1+20, 120.
a(2493690) = 62 = |{33, 51, 60, 69, 78, 87, 96, 105, 114, 123, 132, 141, 150, 159, 168, 177, 186, 195, 213, 267, 294, 321, 348, 375, 384, 402, 420, 510, 564, 591, 618, 708, 726, 744, 789, 807, 942, 951, 969, 1032, 1050, 1185, 2508, 2562, 2589, 3183, 3705, 3723, 3741, 3939, 4947, 5028, 9375, 9393, 24945, 25026, 49371, 93696, 93714, 249369, 493692, 2493690}|.
		

Crossrefs

Ordinal transform gives A349315.
Where records occur: A349316.

Programs

  • Maple
    b:= proc(s) option remember; (n-> {parse(s), seq(seq(seq(x+y,
          y=b(s[i+1..n])), x=b(s[1..i])), i=1..n-1)})(length(s))
        end:
    a:= n-> nops(b(""||n)):
    seq(a(n), n=0..120);

Formula

a(n) <= 2^floor(log_10(n)) = 2^A004216(n) for n>0.
a((10^n-1)/9) = a(A002275(n)) <= A000041(n) with equality only for n <= 23.
a(10^n) = a(A011557(n)) = n+1.

A089696 Numbers k such that the numbers obtained by placing as many '*' signs as possible anywhere between the digits and then adding 1 yields a prime in every case: let abc.. be the digits of k, then abc+1, a*bc+1, ab*c+1, a*b*c+1, ... must all be primes.

Original entry on oeis.org

1, 2, 4, 6, 12, 16, 22, 28, 36, 52, 58, 66, 82, 112, 136, 166, 256, 352, 556, 562, 586, 616, 652, 658
Offset: 0

Views

Author

Amarnath Murthy, Nov 10 2003

Keywords

Comments

Though the first 14 terms match with that of A089395, the next term of A089395 306 is not a member of this sequence. Conjecture: Sequence is finite.
No more terms < 10^7. The first 13 terms match with that of A089395, but A089395(14) = 106 is not included because 1*0*6+1 = 1 is not prime. - David Wasserman, Oct 04 2005

Examples

			256 is a member 256+1, 2*56 +1, 25*6+1, 2*5*6 +1 are all prime.
		

Crossrefs

Cf. A089695.

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:=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

Extensions

Corrected and extended by C. Ronaldo (aga_new_ac(AT)hotmail.com), Dec 25 2004
Showing 1-3 of 3 results.