[Question]
  [
Given an positive integer as input determine if it is a magnanimous number.
A magnanimous number is a number such that any insertion of a `+` sign between any two digits in base 10 results in an expression of a prime integer.
For example 40427 is magnanimous because
```
4+0427  = 431  is prime
40+427  = 467  is prime
404+27  = 431  is prime
4042+7  = 4049 is prime
```
## Output
You should output two distinct values, one when the input is magnanimous and one when the input is not.
## Scoring
The goal of this contest will be to make the size of the source code written to solve this task, given in bytes, as small as possible.
## Test Cases
```
1       -> True
2       -> True
4       -> True
10      -> False
98      -> True
101     -> True
109     -> False
819     -> False
4063    -> True
40427   -> True
2000221 -> True
```
**[OEIS 253996](http://oeis.org/A252996)**
  
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 10 bytes
### Code
```
η¨¹.s¨R+pP
```
Uses the **05AB1E** encoding. [Try it online!](https://tio.run/##MzBNTDJM/f//3PZDKw7t1Cs@tCJIuyDg/38TAxMjcwA "05AB1E – Try It Online") or [Verify all test cases!](https://tio.run/##MzBNTDJM/V9TVvn/3PZDKyr1ig@tCNIuCPhfqXR4P6euHefh/Uo6/w25jLiMuUy4TLnMuMy5LLgsuQwNuCwtgKQhEFtyWRhacpkYmBiZAwA)
### Explanation
```
η¨             # Take the prefixes of the input and remove the last element
  ¹.s¨         # Take the suffixes of the input and remove the last element
      R        # Reverse the array of suffixes
       +       # Vectorized addition
        p      # Check if each element is prime
         P     # Product of the array
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 83 ~~84~~ ~~85~~ ~~83~~ ~~84~~ ~~86~~ ~~75~~ ~~111~~ bytes
All optimizations turned off and only on GCC 32-bit.
-1 byte thanks to @ceilingcat
+some bytes for `1` case.
+some bytes for reusable functions.
```
i,j,r,s;f(a){for(i=10,r=1;a/i;i*=10)for(s=a%i+a/i,r*=s-1,j=2;j<s;)r*=s%j++>0;a=!r;}
```
Takes input as an integer. **Return 1 for false cases, 0 for true cases.**
[Try it online!](https://tio.run/##bY/RagMhEEXf/QoTWNCsoWpDk2Dsl/RFNlpmSdyiplBCvn3jShNWyH07M5d7Z7r1d9eNI7CeBRaVI4Ze3RAIaMFZ0EKZN1CwykSncdSmgTbPWFjpuBas11L1h6joxE3ftp9cGb0I6jb@DnDEycZEwCecKLoinAWOLBxJlBaa9BOywZFlc8R/Nn75JctuVdb2FO0rnx@ethtCU/7ZgCePjtIq/jMKyDnkZ2a039U7UeN@jjtR4YZ/vNe8kduqlnMu5SMx2HQJHvNyNBrv "C (gcc) – Try It Online")
See my another answer for Mathematica code (55 bytes).
[Answer]
## [Retina](https://github.com/m-ender/retina), 38 bytes
```
\B
$`$*_$'$*_
S`\d
G`^_$|^(__+)\1+$
^$
```
[Try it online!](https://tio.run/##K0otycxL/K@q4Z7wP8aJSyVBRSteRR1IcAUnxKRwuSfExavUxGnEx2trxhhqq3DFqfz/b8hlxGVpwWVoYAjEllwWhpZcJgYmRuYA "Retina – Try It Online")
Prints `1` for magnanimous numbers and `0` otherwise.
### Explanation
```
\B
$`$*_$'$*_
```
We start by matching each position between two digits (positions that aren't word boundaries) and inserting both the prefix and the suffix of that match in unary, using `_` as the unary digit. So instead of inserting `+`s, we directly insert the unary result of the sum there.
```
S`\d
```
Now we split the string around digits, so that each sum goes on its own line and we get rid of those digits (there'll be an empty leading and trailing line as well, but that's not important).
```
G`^_$|^(__+)\1+$
```
This is the standard regex to match non-prime numbers in unary. Using a `G`rep stage here means that we simply keep all lines that contain positive non-primes (discarding the empty lines).
```
^$
```
Finally we check whether the string is empty. If the input was magnanimous, the previous stage will have discarded all lines (because they were all primes), and this gives us `1`. Otherwise, if any line wasn't a prime, it will remain in the string and the regex fails, giving `0`.
[Answer]
# [Python 2](https://docs.python.org/2/), ~~82~~ ~~79~~ 78 bytes
```
f=lambda n,d=10:n<d or d/n<all((n/d+n%d)%k*f(n,10*d)for k in range(2,n/d+n%d))
```
This is *slow* and can only cope with the test cases with memoization.
[Try it online!](https://tio.run/##RU/NbsMgDD6Hp/AFFTqqAqvWHzV7kWmHTMAaNXEimh3Wqs@e2YmiXWzs78cf/e9w6dCPYyqbqv0KFaAJpbMnPAfoMoQtnqumUQq34QVl0PK6TgqNs@ugExGuUCPkCr@j8mYh6THEBG1su/oeVdInUfAAJTyeomDsEps@ZjKCQFtnmVLUCaaNBuwG9mURA5P6Y8Y@iZ/mJyE5Dj95Ji64WJbzDSESKf6z0Eyxke2dAW/ouIHjgbvjcjRwcFR29u2V687viWat9d5Rlj7XOMBK7m@weQd5W4GcQlMk@vYf "Python 2 – Try It Online")
### Alternate version, 79 bytes
```
f=lambda n,d=10:n<d or f(n,10*d)>d/n<all((n/d+n%d)%k for k in range(2,n/d+n%d))
```
Sped up at the cost of one byte.
[Try it online!](https://tio.run/##NY7LDoIwFETX@hWzaSh6DW0l8gjwLzVXlIAXgmz8emwXbs4szmQyy3d7zeL2vW8n/76zhxC31tTSMOYVvRay5sRpx5k0fpq0lozPojhVI/rQGDEIVi/Ph3b0d@kelURlCY5gDaEqY9qIilDagNzcrpG5K0LNGOOcrY@HZR1kQ6KKDy4d1CeBQjgS34TpHw "Python 2 – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 12 bytes
```
DJ⁵*⁸dṖS€ÆPẠ
```
[Try it online!](https://tio.run/##ASYA2f9qZWxsef//RErigbUq4oG4ZOG5llPigqzDhlDhuqD///80MDQyNw "Jelly – Try It Online")
[Verify all test cases.](https://tio.run/##y0rNyan8/9/F61HjVq1HjTtSHu6cFvyoac3htoCHuxb8P9wOZP//b6hjpGNpoWNoYKhjYWipY2JgYmQOAA)
[Answer]
# Java 8, ~~175~~ ~~171~~ ~~94~~ 88 bytes
```
n->{long d=10,r=0,i,t;for(;d<=n;d*=10,r|=t-i)for(t=n/d+n%d,i=1;t%++i%t>0;);return r==0;}
```
-77 thanks to *@PeterTaylor* by using an arithmetic (instead of String with `.substring`) and getting rid of the separate method to check if the integer is a prime.  
-6 bytes using [*@SaraJ*'s prime-checking method](https://codegolf.stackexchange.com/a/181611/52210), so make sure to upvote her!
[Try it here.](https://tio.run/##jZDRboMgFIbvfYpzY6KrOnTNVsPoE2y96eWyCyq0odODwWOXpfPZHXW9VwIh5@cDPjjLi0xtq/Gsvsaqll0H79LgNQAwSNodZaVhdysBDtbWWiJUUW3xBBhzHw9@@L4DBAEjptvrtKhEzhInWGIS4kfrIq5eBXL1MOW/glIT32IS@KhWGKrEiJxTuFqZkLaMx9xp6h2CE4LxYeSBv6TtD7WpoCNJfrpYo6DxstGenMHTxyfI@N/09gRovBDq76mIJleA/U9HuslsT1nr91CNUZNhVkX5WzyHFPNIzuaZcrPknHwJVM5Dm3wBtGbPT0uodfGy4JsYY0WxwL@8tzs5BMP4Bw)
**Explanation:**
```
n->{                  // Method with long as both parameter and return-type
  long d=10,r=0,i,t;  //  Some temp longs
  for(;d<=n           //  Loop as long as `d` is below or equal to input `n`
                      //  (inclusive instead of exclusive due to special case 10)
      ;               //    After every iteration:
       d*=10,         //     Multiple `d` by 10
       r|=t-i)        //     and Bitwise-OR `r` with `t-i`
    for(t=n/d+n%d,    //   Set `t` to `n` integer-divided by `d` plus `n` modulo-`d`
        i=1;          //   Set `i` to 1
        t%++i%t>0;);  //   Inner oop as long as `t` modulo `i+1` modulo `t` is not 0 yet
                      //   (after we've first increased `i` by 1 with `++i`)
                      //   (if `t` equals `i` afterwards, it means `t` is a prime)
  return r==0;}       //  Return if `r` is still 0
```
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 14 bytes
```
.AmP_ssMcQ]dtU
```
[Try it online!](https://pyth.herokuapp.com/?code=.AmP_ssMcQ%5DdtU&input=%2240427%22&debug=0) Will display `True` if the number is magnanimous, `False` otherwise. Takes the number as a string.
**Explanations**
```
.AmP_ssMcQ]dtU
              Q    # Implicit input Q
            tU     # Generate the range [1, 2, ..., len(Q)-1]
  m                # For each index d in the above range...
        cQ]d       # Split Q at index d
      sM           # Convert the two parts to integers
     s             # Sum
   P_              # Check it is a prime
.A                 # ...end for. Check all elements are True
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~104 102 98 96~~ 103 bytes
* Thanks to @Wheat Wizard for 2 bytes: made `i` completely anonymous since it is called only once.
* Thanks to @Hyperneutrino for 4 bytes: smarter way of obtaining the numbers from the main number instead of slicing
* @Hyperneutrino saved another 2 bytes: `x-1` to just `x` for the prime checking rarnge.
* Fixed failure for case `x=10`,thus adding 7 Bytes, thanks to @Dennis and @Wheat Wizard for spotting it: my earlier version was considering 1 a prime
```
lambda x:all((lambda x:x>1and all(x%j for j in range(2,x)))(x/10**j+x%10**j)for j in range(1,len(`x`)))
```
[Try it online!](https://tio.run/##XYtBCoMwEEX3nmI2QmIH6gShKtiLtAWnaFs1xiAupqe3SRdddDF/@J/3/Ht7Lc7sU3PdLc/3jkFqtlapX5MzsesgjpKO8FhWGGFwsLJ79sqgaK2VHCnPsvEg6ffrP4rQ9k610gZ273jj5kJokHKsypAUrsKSKizywpxuSdR91CNbJ@DXwW1qUj7oHw "Python 2 – Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt), ~~24~~ 16 bytes
This was pretty much a collaboration between @Shaggy, @ETHproduction, and myself.
```
¬£[YîU UtY]xÃÅej
```
[Try it online!](https://tio.run/##y0osKPn//9CaQ4ujIw@vC1UILYmMrTjcfLg1Nev/fyUTAxMjcyUA "Japt – Try It Online")
Takes input as a string.
[Answer]
# [Pip](https://github.com/dloscutoff/pip), ~~25~~ 24 bytes
```
$&0N_%,_=1M$+(a^@_)M1,#a
```
[Try it online!](https://tio.run/##K8gs@P9fRc3AL15VJ97W0FdFWyMxziFe09dQRznx////JgZmxgA "Pip – Try It Online")
### Explanation
`a` is the first command-line argument. `1,#a` generates a Range containing numbers `1` through `len(a)-1`. To this, we map a lambda function:
```
$+(a^@_)
   a^@_   Split a at this index
$+(    )  Fold the resulting 2-element list on +
```
Next, we map another lambda function, `0N_%,_=1`, that tests for primality. I took it from [this answer](https://codegolf.stackexchange.com/a/108295/16766); you can read the explanation there. Finally, we fold the list on logical AND (`$&`). The result is `1` iff all the sums were prime, `0` if any of them weren't.
Example, with input of `4063`:
```
                    1,#a   [1; 2; 3]
           $+(a^@_)M       [67; 103; 409]
  0N_%,_=1M                [1; 1; 1]
$&                         1
```
[Answer]
# [CJam](https://sourceforge.net/p/cjam), 22 bytes
```
r:L,({)_L<i\L>i+mp!},!
```
[Try it online!](https://tio.run/##S85KzP3/v8jKR0ejWjPexyYzxscuUzu3QLFWR/H/fxMDEyNzAA "CJam – Try It Online")
Prints positive integer for truthy, zero for falsy.
-1 thanks to a clever trick by [Peter Taylor](https://codegolf.stackexchange.com/users/194/peter-taylor).  
-3 thanks to another tip by Peter Taylor.
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 23 bytes
Takes input as a string.
Dang it; [beaten to the punch](https://codegolf.stackexchange.com/a/128681/58974) on a much shorter alternative I was working on.
```
¬£i+YÃÅe@OxXr"%+0+"'+)j
```
[Test it](http://ethproductions.github.io/japt/?v=1.4.5&code=rKNpJytZw8VlQE94WHIiJSswKyInKylq&input=IjQwMDQzIg==)
[Answer]
## Mathematica, 75 bytes
```
And@@Table[PrimeQ@ToExpression@StringInsert[#,"+",n],{n,2,StringLength@#}]&
```
`Function` which expects a `String`. `PrimeQ@ToExpression@StringInsert[#,"+",n]` returns whether inserting a `+` after the `n`th digit gives a prime number. `Table[...,{n,2,StringLength@#}]` gives the list of these values as `n` ranges from `2` to the length of the string. We then take `And` of each of the elements of that list. Conveniently, if `StringLength@#<2`, then `Table[...]` is the empty list, for which `And@@{}==True`
[Answer]
# Mathematica, 55 ~~50~~ ~~45~~ ~~49~~ ~~50~~ ~~54~~ ~~62~~ bytes
It seems I should post it separately.
+6 bytes for code length remeasured.
+5 bytes thanks to ngenisis.
```
And@@(qPrimeQ[#~Mod~q+⌊#/q⌋])@Rest@PowerRange@#&
```
Takes input as an integer and return regular `True` and `False`. The `` in-between is unicode 0xF4A1, short for `Function[,]`. Code length is measured on file size (UTF-8 without BOM), comment if it is not correct.
`PowerRange[x]` returns 1, 10, 100... no greater than `x`, which is introduced in Mathematica 10.
[Answer]
# [Plain English](https://github.com/Folds/english) ~~4,204~~ ~~341~~ ~~315~~ ~~251~~ ~~241~~ 240 bytes
(Re-)incorporated primality testing into Plain English's library, by moving 3,863 bytes into Plain English's library. Deleted 26 bytes of white space. Saved 64 bytes by abbreviating local variables. Saved 10 bytes by abbreviating the interface. Per [RosLuP](https://codegolf.stackexchange.com/users/58988)'s suggestion, saved 1 byte by changing how m is initialized and incremented.
```
To decide if a n number is g:
Put 1 in a m number.
Loop.
Multiply the m by 10.
If the m is greater than the n, say yes.
Divide the n by the m giving a q quotient and a r remainder.
Add the q to the r.
If the r is not prime, say no.
Repeat.
```
Ungolfed version of final code:
```
To decide if a number is magnanimous:
  Put 1 in another number.
  Loop.
    Multiply the other number by 10.
    If the other number is greater than the number, say yes.
    Divide the number by the other number giving a quotient and a remainder.
    Add the quotient to the remainder.
    If the remainder is not prime, say no.
  Repeat.
```
Notes: The Plain English IDE is available at [github.com/Folds/english](https://github.com/Folds/english). The IDE runs on Windows. It compiles to 32-bit x86 code.
The [Osmosian Order](http://www.osmosian.com/)'s dynamic fork of Plain English already had primality testing in version 4700, but it used a very inefficient algorithm (as of January through June 2017). Versions 4001-4011 of the GitHub site's dynamic fork omitted primality testing. Version 4013 of the GitHub site's dynamic fork includes primality testing. The code to perform the primality testing was developed as part of previous revisions of this answer.
[Answer]
# [Perl 6](http://perl6.org/), 58 bytes
```
{?(10,10* *...^*>$_).map({$_ div$^a+$_%$^a}).all.is-prime}
```
[Try it online!](https://tio.run/##FYrRCoIwGEZf5btYMVeN/19ijsreRBmkMNhoKAQiPvtaF@ecm5PGOTQ5rjhOeObtJZnOTApKa92rTgyVji7JTQx4@6/o3UkMh5K90i4E7ZdLmn0c93zHJP/34lZMnxkPhgETbFvMBYuWLWpqrkW1ucEQkTHc5R8 "Perl 6 – Try It Online")
`10, 10 * * ...^ * > $_` is the geometric sequence of multiples of ten, taken until one before the element that exceeds the input parameter `$_`. Then we just check that for each power of ten, the sum of the input parameter taken div and mod that power is prime.
[Answer]
# Haskell, ~~114~~ 110 bytes
```
p x=[x]==[i|i<-[2..x],x`mod`i<1]
i!x|i<1=0<1|0<1=p(uncurry(+)$divMod x$10^i)&&(i-1)!x
f x=(length(show x)-1)!x
```
Ungolfed with explanation:
```
-- Check if x is a prime number
p x = [x] == [i | i<-[2..x], x`mod`i < 1]
-- Checks all pairs of numbers a '+' can be put in between
i ! x | i<1 = 0<1                                -- Single-digit numbers are always truthy
      | 0<1 = p (uncurry (+) $ divMod x $ 10^i)  -- Does x split at i digits from right sum up to a prime?
           && (i-1) ! x                          -- If so, check next pair
-- Start (!) with the number of digits in x minus one
f x = (length (show x)-1) ! x
```
[Answer]
# Axiom, 88 bytes
```
f(n:PI):Boolean==(i:=10;repeat(q:=n quo i;q=0 or ~prime?(q+n rem i)=>break;i:=i*10);q=0)
```
test and results
```
(10) -> [[i,f(i)]  for i in [1,2,4,10,98,101,109,819,4063,40427,2000221,999999999999999999999999999999999999999999999]]
   (10)
   [[1,true], [2,true], [4,true], [10,false], [98,true], [101,true],
    [109,false], [819,false], [4063,true], [40427,true], [2000221,true],
    [999999999999999999999999999999999999999999999 ,false]]
```
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 11 bytes
```
{~cĊℕᵐ+}ᶠṗᵐ
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/pfXa6koGunoFSuVv2obcOjpuZHHcuVSopKU5VqQKy0xJziVKXaciU9BaWHuzprH26d8L@6LvlI16OWqUC2du3DbQse7pwOEv4fbahjpGOiY2igY2kBJA2B2FLHwtBSx8TAzBhImBiZ6xgZGBgYGRnGAgA "Brachylog – Try It Online")
```
{      }ᶠ      Find every
      +        sum of
   Ċ           two
    ℕᵐ         whole numbers
 ~c            which concatenate to the input,
          ᵐ    and assert that all of them
         ṗ     are prime.
```
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), 35 bytes
```
{m:ex/^(.+)(.+)$/.all.sum.is-prime}
```
[Try it online!](https://tio.run/##K0gtyjH7n1upoJamYKvwvzrXKrVCP05DT1sThFX09RJzcvSKS3P1Mot1C4oyc1Nr/6flFylo5GTmpRZrKlRzcRYnVirYp2lo5@rHpGjra3LV/jdUgABdO4WQotJULiM0vgka39AAzndLzClO5bK0QFdgiMa3RNVgYYgmYGJgZoxipYGJkTmykwwMDIyMDGF8AA "Perl 6 – Try It Online")
### Explanation:
```
{                                 }     # Anonymous code block that
 m:ex/^        $/                         # Match all
       (.+)(.+)                           # Splits of the input number
                 .all                     # Are all of them
                     .sum                   # When summed
                         .is-prime          # Prime?
```
[Answer]
# [Husk](https://github.com/barbuz/Husk), 13 bytes
```
Λȯṗṁd§e↑↓d¹ḣL
```
[Try it online!](https://tio.run/##ASkA1v9odXNr///Om8iv4bmX4bmBZMKnZeKGkeKGk2TCueG4o0z///80MDQyNw "Husk – Try It Online")
-1 byte from user.
[Answer]
# [Risky](https://github.com/Radvylf/risky), 44 bytes
```
*0!?+0-_1+0___?+0+_1+0___?{?}_*+0+__?[?}_*+0_!\?+0+1111:!111111111+111111111111111111111
```
[Try it online!](https://radvylf.github.io/risky?p=WyIqXG4wIT8rMC1fMSswIF8gX18_KzArXzErMFxuX1xuX18_ez99XyorMCArIF9fP1s_fV8qKzBcbl9cbiFcXD8rMCsxMTExIDogITExMTExMTExMVxuK1xuMTExMTExMTExMSAxIDExMTExMTExMTEiLCJbWzIsMCwwLDAsMiwyLDFdXSIsMF0)
Takes input as an array of digits (which is [allowed by default](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods/18097#18097)). Outputs `1` for true and `0` for false.
[Answer]
# [Vyxal 3](https://github.com/Vyxal/Vyxal/tree/version-3) `g`, 10 bytes
```
ṗΩL2=]“⌊ṠṄ
```
[Try it Online!](https://vyxal.github.io/latest.html#WyJnIiwiIiwi4bmXzqlMMj1d4oCc4oyK4bmg4bmEIiwiIiwiWzgsMSw5XSIsIjMuNC4wIl0=)
[Answer]
# [Stacked](https://github.com/ConorOBrien-Foxx/stacked), 51 bytes
```
[tostr:#'1-~>splitat tr['+',' '#`#~prime]map 1,all]
```
[Try it online!](https://tio.run/##FcxLCoMwFEbhuav4SwZRqpCbSmscSPchQkOrIL5CvB2VuvU0HZxveHa2z6l/hdDytrOvhaTiaHY3j2wZ7Ft5lrmEFA9xOD8ufbdYB8rtPHfhXg9JkhI0SMFUUYoZVGRQquslUuobtFJKa8rwOSFdIVE0kRVDhi/@u@3N4Qc "Stacked – Try It Online")
This is a function. It works by converting its argument to a string (`tostr`), duplicating it and obtaining its length (`:#'`), subtracting 1 (`1-`), making a range from 1 to that number (`~>`). The stack looks something like this, for input `40427`:
```
('40427' (1 2 3 4))
```
We perform vectorized `splitat`, resulting in the following array to be at the top of the stack:
```
(('4' '40' '404' '4042') ('0427' '427' '27' '7'))
```
Transposing this with `tr`, we get:
```
(('4' '0427') ('40' '427') ('404' '27') ('4042' '7'))
```
Then, we map the function `['+',' '#`#~prime]`(with`map`). This function does:
```
['+',' '#`#~prime]
 '+',                concatenate a plus sign (string)    `('4' '0427' '+')
     ' '#`           join by spaces                      `'4 0427 +'`
          #~         evaluate                            `431`
            prime    check primality                     `1`
```
Then, after the map, we concatenate `1`. This is since `all` returns `undef` for an empty list.
[Answer]
## JavaScript (ES6), 70 bytes
```
P=(n,x=2)=>n%x?P(n,x+1):n==x
f=(n,i=10)=>i>n||P((n/i|0)+n%i)&f(n,i*10)
```
Fails on the last case in my browser due to a "too much recursion" error while calculating `P(200023)`. Hopefully this doesn't invalidate it.
[Answer]
# [QBIC](https://drive.google.com/drive/folders/0B0R1Jgqp8Gg4cVJCZkRkdEthZDQ), 38 bytes
```
_L;|[a-1|q=q*µ!_sA,b|!+!_sA,b+1,a|!}?q
```
## Explanation
```
_L |     Create a variable a and set it to the length of
  ;      the input string (A$)
[a-1|    FOR b = 1 to a-1
q=q*     multiply q by
 µ       -1 if prime, 0 if not, of
  !        a cast of 
   _s       a substring of
     A,       A$
     b        from index 1 to index b (only one index is given, so that is assumed to be the req. length from 1)
      |!   to number
 +         plus
 !         a cast of
  _s         a substring of
    A,         A$
    b+1        from index b+1
    ,a         for the length of a (does not error if it exceeds the end of the string)
      |!   to number
 }       NEXT 
 ?q      PRINT q, which is eitrher -1 or 1 for all-prime sums, or 0 otherwise
```
[Answer]
## CJam (21 bytes)
```
r:R,({RiA@)#md+mp!},!
```
[Online demo](http://cjam.aditsu.net/#code=r%3AR%2C(%7BRiA%40)%23md%2Bmp!%7D%2C!&input=40427), [online test suite](http://cjam.aditsu.net/#code=qN%250%3AF%3B1%3AT%3B%7B%22-%3Eruealse%22-~%5C%60%3AQ%3B%0A%0AQ%3AR%2C(%7BRiA%40)%23md%2Bmp!%7D%2C!%0A%0A%3D%7D%2F&input=1%20%20%20%20%20%20%20-%3E%20True%0A2%20%20%20%20%20%20%20-%3E%20True%0A10%20%20%20%20%20%20-%3E%20False%0A21%20%20%20%20%20%20-%3E%20True%0A22%20%20%20%20%20%20-%3E%20False%0A98%20%20%20%20%20%20-%3E%20True%0A101%20%20%20%20%20-%3E%20True%0A109%20%20%20%20%20-%3E%20False%0A819%20%20%20%20%20-%3E%20False%0A4063%20%20%20%20-%3E%20True%0A40427%20%20%20-%3E%20True%0A2000221%20-%3E%20True)
### Dissection
```
r:R       e# Take a token of input and assign it to R
,(        e# Take the length of R minus one
{         e# Filter i = 0 to (length of R minus two)
  Ri      e#   Push R as an integer value
  A@)#    e#   Push 10 to the power of (i + 1)
  md      e#   divmod
  +mp!    e#   Add, primality test, negate result
},        e# The result of the filter is a list of splits which give a non-prime
!         e# Negate result, giving 0 for false and 1 for true
```
[Answer]
# Pyth, ~~15~~ 14 bytes
```
.AmP_svcz]dtUz
```
[Test suite](https://pyth.herokuapp.com/?code=.AmP_svcz%5DdtUz&test_suite=1&test_suite_input=1%0A2%0A10%0A98%0A101%0A109%0A819%0A4063%0A40427%0A2000221&debug=0)
Saved a byte using Pyth's newest change.
[Answer]
# APL(NARS), chars 35, bytes 70
```
{0≥k←¯1+≢⍕⍵:1⋄∧/0π(m∣⍵)+⌊⍵÷m←10*⍳k}
```
test:
```
  f←{0≥k←¯1+≢⍕⍵:1⋄∧/0π(m∣⍵)+⌊⍵÷m←10*⍳k}
  f¨1 2 4 10 98 101 109 819 4063 40427 2000221
1 1 1 0 1 1 0 0 1 1 1 
```
This would be the translation in APL from Axiom post algo here...
```
{0≥k←¯1+≢⍕⍵:1⋄∧/0π(m∣⍵)+⌊⍵÷m←10*⍳k}
 0≥k←¯1+≢⍕⍵:1⋄  assign to k the length as array of argument return 1 if that is <=0
 ∧/0π(m∣⍵)+⌊⍵÷m←10*⍳k
              m←10*⍳k  m is the array pow(10,1..k)
           ⌊⍵÷m       the array of quotient of argumet with m
          +           sum 
     (m∣⍵)            with array of remander
   0π                 build the binary array of "are prime each"
 ∧/                   and that array
```
[Answer]
# PHP, 100 bytes
```
for(;++$k<strlen($a=$argn);$x+=$i==1)for($i=$n=substr($a,$k)+$b.=$a[$k-1];--$i&&$n%$i;);echo$x+2>$k;
```
prints `1` if input is magnanimous, empty output if not. Run as pipe with `-nR` or [try it online](http://sandbox.onlinephpfunctions.com/code/3f55db523d77f0ef91890bc3efc65c624c0e9bae).
]