[Question]
  [
Almost six years ago, fellow PPCG member steenslag [posted](https://codegolf.stackexchange.com/q/958/13486) the following challenge:
> 
> In a standard dice (die) the numbers are arranged so that opposite
>  faces add to seven. Write the shortest possible program in your
>  preferred language which outputs a random throw followed by 9 random
>  tippings. A tipping is a quarter turn of the dice, e.g. if the dice is
>  facing 5, all possible tippings are 1,3,4 and 6.
> 
> 
> Example of desired output:
> 
> 
> 
> > 
> > 1532131356
> > 
> > 
> > 
> 
> 
> 
So, now that everybody has completely forgotten about it and the winning answer has long since been accepted, we'll be writing a program to validate the die tipping sequences generated by the submitted solutions. (This makes sense. Just pretend it does.)
# Challenge
Your [program or function](http://meta.codegolf.stackexchange.com/a/2422/13486 "Default for Code Golf: Program, Function or Snippet?") is given a sequence such as `1532131356`. Validate that each consecutive digit is:
* Not equal to the previous digit
* Not equal to *7* minus *the previous digit*
(You don't have to validate the first digit.)
## Rules
* Your program must return a [truthy value if the input is valid and a falsey value](http://meta.codegolf.stackexchange.com/a/2194/13486 "Interpretation of Truthy/Falsey") otherwise.
* You can assume that the input consists of only the digits 1-6 and is at least 1 character long. Sequences won't have a fixed length like in steenslag's challenge.
* You can take the input as a string (`"324324"`), an array or array-like datastructure (`[1,3,5]`) or as multiple arguments (`yourFunction(1,2,4)`).
Standard [I/O](http://meta.codegolf.stackexchange.com/q/2447/13486) and [loophole](http://meta.codegolf.stackexchange.com/q/1061/13486) rules apply.
# Test cases
## Truthy
```
1353531414
3132124215
4142124136
46
4264626313135414154
6
2642156451212623232354621262412315654626212421451351563264123656353126413154124151545145146535351323
5414142
```
## Falsey
* Repeated digit
```
11
3132124225
6423126354214136312144245354241324231415135454535141512135141323542451231236354513265426114231536245
553141454631
14265411
```
* Opposing side of die
```
16
42123523545426464236231321
61362462636351
62362462636361
```
  
[Answer]
# Python 2, 43 45 bytes
```
lambda s:reduce(lambda p,n:n*(7-p!=n!=p>0),s)
```
# 43 bytes (inspired heavily by @Zgarb)
```
lambda s:reduce(lambda p,n:n*(p>0<n^p<7),s)
```
This function combines my reduce statement with the bit-flicking logic from @Zgarb's answer, for a combination that is shorter than both.
Both answers output the following:
* 0 if the input is not a valid sequence
* The last digit of the sequence if it is valid
[Answer]
## Python, 44 bytes
```
lambda x:all(0<a^b<7for a,b in zip(x,x[1:]))
```
Bitwise magic!
This is an anonymous function that takes a list of integers, and checks that the XOR of every two consecutive elements is between 1 and 6 inclusive.
## Why it works
First, the XOR is always between 0 and 7 inclusive, since 7 is `111` in base 2, and our numbers have at most 3 binary digits.
For the equality, `a^b == 0` if and only if `a == b`.
Also, we have `7-a == 7^a` when `0 ≤ a ≤ 7`, and thus `a^b == 7` if and only if `a == 7^b == 7-b`.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~11~~ 9 bytes
***-2 bytes for Osable's smart idea of using a product.***
```
¥¹D7-Á+«P
```
[Try it online!](https://tio.run/nexus/05ab1e#@39o6aGdLua6hxu1D60O@P8/2lDHOBYA "05AB1E – TIO Nexus")
```
¥           # Push deltas.
 ¹D7-Á      # Push original array, and 7 - [Array] shifted right once.
      +     # Add original to the 7 - [Array] shifted right.
       «    # Concat both.
        P   # Product, if either contain a zero, results in 0, meaning false.
```
Third approach using 05AB1E, that doesn't use the pairwise command:
* `0` if it violates the tipsy properties.
* `Not 0` if there was nothing preventing it from being tipsy.
[Answer]
# R, ~~39~~ ~~37~~ ~~32~~ 31 bytes
```
all(q<-diff(x<-scan()),2*x+q-7)
```
[Try it online!](https://tio.run/##K/r/PzEnR6PQRjclMy1No8JGtzg5MU9DU1PHSKtCu1DXXPO/iYKRgpmCCRCDaGMFQyg2BYoZgjGQ9R8A "R – Try It Online")
Takes input from stdin. Uses `diff` to see if any two consecutive digits are the same; then compares each digit to 7 minus the previous digit. Returns `TRUE` or `FALSE`.
Saved 5 bytes thanks to Jarko Dubbeldam, and another thanks to JayCe.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 10 bytes
```
$ü+7Ê¹üÊ*P
```
Uses the **CP-1252** encoding. [Try it online!](https://tio.run/nexus/05ab1e#@69yeI@2@eGuQzsP7zncpRXw/7@xobGRoZGJkaEpAA "05AB1E – TIO Nexus")
[Answer]
## R, 49 44 bytes
```
!any(rle(x<-scan())$l-1,ts(x)==7-lag(ts(x)))
```
Reads input from stdin (separated by space) and outputs `TRUE/FALSE`. Will give a warning if input is of length one but still works.
Edit: saved a couple of bytes thanks to @rturnbull
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 15 bytes
```
ü+7å¹ü-0å¹g_~~_
```
[Try it online!](https://tio.run/nexus/05ab1e#@394j7b54aWHdh7eo2sAotPj6@ri//83NjQ2MjQyMTIyBQA "05AB1E – TIO Nexus") or as a [Test suite](https://tio.run/nexus/05ab1e#RZBNTkNBDIP3uQog4fxxnC65ARIS6m24RXc92OvnVwk0I00cO4knx8/X9/328nH/5Xl75/m8XK@X1@NQDUetjlKlslMTQIeqjebm9ubCo4bSdGyQRLo9QrpZPoPOoJUFZ7jPnshqSBVlkEvEWAOE7VmwiHzXltBnxTmuM6Q/eznBZNcyjsaYBKg7e5whkebdETzOniB1BqfNtO2yEUvI4TVXcuEUH5iY51r4QykgUOBCXgd1k2dvb4Yavm93sXKtd0VfYP7D1QM)
[Answer]
## JavaScript (ES6), ~~43~~ 40 bytes
Returns `0` / `true`.
```
f=([k,...a],n=0)=>!k||k-n&&7-k-n&&f(a,k)
```
### Test cases
```
f=([k,...a],n=0)=>!k||k-n&&7-k-n&&f(a,k)
console.log('Testing truthy cases ...');
console.log(f('1353531414'));
console.log(f('3132124215'));
console.log(f('4142124136'));
console.log(f('46'));
console.log(f('4264626313135414154'));
console.log(f('6'));
console.log(f('2642156451212623232354621262412315654626212421451351563264123656353126413154124151545145146535351323'));
console.log(f('5414142'));
console.log('Testing falsy cases ...');
console.log(f('11'));
console.log(f('3132124225'));
console.log(f('6423126354214136312144245354241324231415135454535141512135141323542451231236354513265426114231536245'));
console.log(f('553141454631'));
console.log(f('14265411'));
console.log(f('16'));
console.log(f('42123523545426464236231321'));
console.log(f('61362462636351'));
console.log(f('62362462636361'));
```
[Answer]
# [Perl 6](http://perl6.org/), 22 bytes
Using a regex:
```
{!/(.)<{"$0|"~7-$0}>/}
```
Takes the input as a string. Inspired by [G B's Ruby answer](https://codegolf.stackexchange.com/a/104048/14880).  
How it works:
* `/ /`: A regex.
* `(.)`: Match any character, and capture it as `$0`.
* `<{ }>`: Dynamically generate a sub-regex to be matched at that position.
* `"$0|" ~ (7 - $0)`: The sub-regex we generate is one that matches only the previous digit, or 7 minus the previous digit (e.g. `5|2`).  
Thus the overall regex will match iff it finds an invalid consecutive pair of digits anywhere.
* `{! }`: Coerce to a boolean (causing the regex to be matched against `$_`), negate it, and turn the whole thing into a lambda (with implicit parameter `$_`).
# [Perl 6](http://perl6.org/), 38 bytes
Using list processing:
```
{all ([!=] 7-.[1],|$_ for .[1..*]Z$_)}
```
Takes the input as an array of integers.  
How it works:
* `.[1..*] Z $_`: Zip the input list with an offset-by-one version of itself, to generate a list of 2-tuples of consecutive digits.
* `[!=] 7 - .[1], |$_`: For each of those, check if `(7 - b) != a != b`.
* `all ( )`: Return a truthy or falsy value depending on whether all loop iterations returned True.
[Answer]
## Python, 38 bytes
```
f=lambda h,*t:t==()or 7>h^t[0]>0<f(*t)
```
A recursive function that takes arguments like `f(1,2,3)`.
This makes use of argument unpacking to extract the first number into `h` and the rest into the tuple `t`. If `t` is empty, output True. Otherwise, use [Zgarb's bit trick](https://codegolf.stackexchange.com/a/104074/20260) to check that the first two die rolls are not incompatible. Then, check that the result also holds on the recursive call on the tail.
[Answer]
## Ruby, 34 bytes
```
->s{!s[/[16]{2}|[25]{2}|[34]{2}/]}
```
[Answer]
# JavaScript ~~61~~ 43 bytes
Comments have mentioned I can't use C# linq functions without including the using statement, so here's the exact same in less bytes using standard JS...
```
f=a=>a.reduce((i,j)=>i>6|i==j|i+j==7?9:j)<7
```
# C#, ~~99~~ ~~67~~ 65 bytes
Takes input as an int array `a`
```
// new solution using linq
bool A(int[]a){return a.Aggregate((i,j)=>i>6|i==j|i+j==7?9:j)<7;}
```
```
// old solution using for loop
bool A(int[]a){for(int i=1;i<a.Length;)if(a[i]==a[i-1]|a[i-1]+a[i++]==7)return false;return true;}
```
Explanation:
```
// method that returns a boolean taking an integer array as a parameter
bool A(int[] a) 
{
    // aggregate loops over a collection, 
    // returning the output of the lambda 
    // as the first argument of the next iteration
    return a.Aggregate((i, j) => i > 6 // if the first arg (i) > than 6
    | i == j      // or i and j match
    | i + j == 7  // or i + j = 7
    ? 9   // return 9 as the output (and therefore the next i value)
    : j   // otherwise return j as the output (and therefore the next i value)
    ) 
    // if the output is ever set to 9 then it will be carried through to the end
    < 7; // return the output is less than 7 (not 9)
}
```
[Answer]
# ><> (Fish) 47 bytes
```
0:i:1+?!v\!
   0n;n1< >
!?-{:-"0"/^
!? -{-$7:/^
```
Pretty simple;
Line 1: check to see if inputted a number, if no number (EOF) then we have a truthy to print else checks.
Line 2: print outcome.
Line 3: turn input into number (ASCII 0 - from input), then check if it's equal to previous input.
Line 4: check if input is opposite side of die.
[Answer]
# [Brain-Flak](https://github.com/DJMcMayhem/Brain-Flak) 128 Bytes
```
(()){{}(({}<>)<>[({})])}{}([]){{{}}<>}{}([]){{}({}({})<>)<>([][()])}{}(<{}>)<>(([])){{}{}({}[(()()()){}()]){<>}<>([][()])}({}{})
```
Outputs 0 for falsey, or -7 for truthy.
[Try it Online!](http://brain-flak.tryitonline.net/#code=KCgpKXt7fSgoe308Pik8Plsoe30pXSl9e30oW10pe3t7fX08Pn17fShbXSl7e30oe30oe30pPD4pPD4oW11bKCldKX17fSg8e30-KTw-KChbXSkpe3t9e30oe31bKCgpKCkoKSl7fSgpXSl7PD59PD4oW11bKCldKX0oe317fSk&input=MiA2IDQgMiAxIDUgNiA0IDUgMSAyIDEgMiA2IDIgMyAyIDMgMiAzIDUgNCA2IDIgMSAyIDYgMiA0IDEgMiAzIDEgNSA2IDUgNCA2IDIgNiAyIDEgMiA0IDIgMSA0IDUgMSAzIDUgMSA1IDYgMyAyIDYgNCAxIDIgMyA2IDUgNiAzIDUgMyAxIDIgNiA0IDEgMyAxIDUgNCAxIDIgNCAxIDUgMSA1IDQgNSAxIDQgNSAxIDQgNiA1IDMgNSAzIDUgMSAzIDIgMw) (Truthy)  
[Try it Online!](http://brain-flak.tryitonline.net/#code=KCgpKXt7fSgoe308Pik8Plsoe30pXSl9e30oW10pe3t7fX08Pn17fShbXSl7e30oe30oe30pPD4pPD4oW11bKCldKX17fSg8e30-KTw-KChbXSkpe3t9e30oe31bKCgpKCkoKSl7fSgpXSl7PD59PD4oW11bKCldKX0oe317fSk&input=NiA0IDIgMyAxIDIgNiAzIDUgNCAyIDEgNCAxIDMgNiAzIDEgMiAxIDQgNCAyIDQgNSAzIDUgNCAyIDQgMSAzIDIgNCAyIDMgMSA0IDEgNSAxIDMgNSA0IDUgNCA1IDMgNSAxIDQgMSA1IDEgMiAxIDMgNSAxIDQgMSAzIDIgMyA1IDQgMiA0IDUgMSAyIDMgMSAyIDMgNiAzIDUgNCA1IDEgMyAyIDYgNSA0IDIgNiAxIDEgNCAyIDMgMSA1IDMgNiAyIDQgNQ) (Flasey)
**Explanation (t stands for top and s stands for second from the top):**
```
(())                # push a 1 to get this loop started
{{}                 # loop through all pairs, or until 2 are equal
(({}<>)<>[({})])    # pop t, push t on the other stack, and t - s on this one
}{}                 # end loop and pop one more time
([])                # push the height of the stack
{                   # if the height isn't 0 (there were equal numbers)...
{{}}<>              # pop everything from this stack and switch
}                   # end if
{{}                 # for every pair on the stack: pop the height and...
({}({})<>)<>        # push t + s on the other stack leaving s on this one
([][()])            # push the height - 1
}                   # end loop when there is only 1 number left
{}(<{}>)<>          # pop t, pop s, push 0 and switch stacks
(([]))              # push the height twice
{                   # loop through every pair
{}{}                # pop the height and what was t - 7
({}[(()()()){}()])  # push t - 7
{<>}<>              # if t is not 0 switch stacks and come come back
                    # if t is 0 (ie, there was a pair that added to 7) just switch once
([][()])            # push height - 1
}                   # end loop
({}{})              # push t + s (either 0 + 0 or 0 + -7)
```
[Answer]
# MATLAB, 30 bytes
```
@(a)all(diff(a)&movsum(a,2)-7)
```
[Answer]
# PHP, 63 bytes
```
for($d=$argv[$i=1];$c=$argv[++$i];$d=$c)$d-$c&&$d+$c-7?:die(1);
```
takes input as list of command arguments; exits with `1` (error) if input is invalid, `0` (ok) if valid.
Run with `-nr`.
**input as string argument, 65 bytes**
```
for($d=($s=$argv[1])[0];$c=$s[++$i];$d=$c)$d-$c&&$d+$c-7?:die(1);
```
[Answer]
# [PowerShell](https://github.com/PowerShell/PowerShell), ~~57~~ ~~44~~ 41 bytes
*([Crossed out 44 is still regular 44](http://meta.codegolf.stackexchange.com/a/7427/42963))*
```
0-notin($args|%{7-$_-$l-and$l-ne($l=$_)})
```
[Try it online!](https://tio.run/nexus/powershell#@2@gm5dfkpmnoZJYlF5co1ptrqsSr6uSo5uYlwIk81I1VHJsVeI1azX///9v9t/wv/F/MwA "PowerShell – TIO Nexus")
*(OP has clarified that taking input as separate arguments is OK - saved 13 bytes ... saved another 3 bytes by eliminating `$b`)*
We're looping through the input `$args` a digit at a time. Each digit, we verify that the `$l`ast digit is `-n`ot`e`qual to the current digit `$_`, and that `7-$_-$l` is some number other than zero (which is truthy). Those Boolean results are encapsulated in parens and fed into the right-hand operand of the `-notin` operator, checking against `0`. In other words, if there is any `False` value anywhere in the loop, the `-notin` will also be `False`. That Boolean is left on the pipeline, and output is implicit.
Lengthy because of the `$` requirement for variable names, and that Boolean commands `-ne` `-and` are verbose in PowerShell. Oh well.
[Answer]
# Processing, ~~93~~ ~~92~~ 90 bytes
*Changed* `||` *to* `|` *: 1 byte saved thanks to @ClaytonRamsey*
*Started counting backwards: 2 bytes saved thanks to @IsmaelMiguel*
```
int b(int[]s){for(int i=s.length;--i>0;)if(s[i-1]==s[i]|s[i-1]==7-s[i])return 0;return 1;}
```
Takes input as an array of ints, output `1` for true or `0` for false.
### Ungolfed
```
int Q104044(int[]s){
  for(int i=s.length;--i>0;)
    if(s[i-1]==s[i]|s[i-1]==7-s[i])
      return 0;
  return 1;
}
```
[Answer]
**C ~~47~~ 44 bytes**
```
F(char*s){return!s[1]||(*s^s[1])%7&&F(s+1);}
```
takes a string of digits (or a zero terminated array of bytes)
Explanation
`F(char*s){`
according to the standard `int` return type is implied. (saving 4 bytes)
`return` unconditional return because this is a recursive function 
using shortcut evaluation:
`!s[1]||` if the second character is *nul* return true
`((*s^s[1])%7&&` if the first two charcters aren't legal false
`F(s+1))` check the rest of the string in the same way
that confusing expression
`*s` is the first character `s[1]` is the second
`*s^s[1]` exclusive-ors them together if they are the same the result is 0 
 if they add to 7 the result is 7 , (if they differ and don't add to 7 the result is between 1 and 6 inclusive)
so `(*s^s[1])%7` is zero for bad input and non-zero otherwise, thus false if these 2 characters are bad, and true otherwise
**comment:** as this function call uses only end-recursion (only the last statement is a recursive call) an optimiser could translate the recursion into a loop, this is a happy conicidence and is obviously not worth any golf score, but in the real word makes it possible to process strings of any length without running out of stack.
[Answer]
# Python, 71 bytes
```
f=lambda s:len(s)<2or(s[0]!=s[1]and int(s[0])!=7-int(s[1]))and f(s[1:])
```
Uses a recursive approach. 
Explanation:
```
f=lambda s:                                                              # Define a function which takes an argument, s
           len(s)<2 or                                                   # Return True if s is just one character
                      (s[0]!=s[1]                                        # If the first two characters matches or...
                                 and int(s[0])!=7-int(s[1])              # the first character is 7 - the next character, then return False
                                                           )and f(s[1:]) # Else, recurse with s without the first character
```
[Answer]
## [Retina](https://github.com/m-ender/retina), 28 bytes
```
M`(.)\1|16|25|34|43|52|61
^0
```
[Try it online!](https://tio.run/nexus/retina#RZDLTYRBDIPv6QNpuSCcVwuc6ACttpDpffn8rwSaOcSxkzh5u309nt@P28f7j4725Jzq03Umzyrun8@nanhqdZQqlZ2aADpUbTQ/tzcXHjWUpmODJNLtEdLN8ht0Bq0sOMN99URWQ6oog1wixhogbM@CReS/toQ@K65xnSH92csJJruWcTTGJEDd2eMMiTTvjuBx9gKpK7hspm2XjVhCDq@5kgunWGBiXmdhh1JAoMCFfA7qJq/evgw1rG93sXKtb0VfYP7D1S8 "Retina – TIO Nexus")
Alternatively:
```
M`[16]{2}|[25]{2}|[34]{2}
^0
```
[Try it online!](https://tio.run/nexus/retina#RZDLbQNBDEPv6iNAjqZ@LeSUCowE7sNJ7evHXSDBDDCiSEkcvb1/PI7Px1379czfn3vO9Vb7je/bcaiGo1ZHqVLZqQmgQ9VGc3N7c@FRQ2k6Nkgi3R4h3SyfQWfQyoIz3KsnshpSRRnkEjHWAGF7Fiwi37Ul9FlxjusM6c9eTjDZtYyjMSYB6s4eZ0ikeXcEj7MnSJ3BaTNtu2zEEnJ4zZVcOMUHJuZaC38oBQQKXMjroG7y7O3NUMP37S5WrvWu6AvMf7h6AQ)
[Answer]
# [MATL](https://github.com/lmendo/MATL), 9 bytes
```
dG2YCs7-h
```
The input is an array of numbers representing the digits.
The output is a non-empty array, which is truthy if all its entries are non-zero, and falsy otherwise (read more about MATL's criterion for truthy and falsy [here](https://codegolf.stackexchange.com/a/95057/36398)).
[Try it online!](https://tio.run/nexus/matl#@5/ibhTpXGyum/H/f7ShgrGCKRQbKpiAcCwA "MATL – TIO Nexus") Or [verify all test cases](https://tio.run/nexus/matl#bVI9T0MxDNz5FdnexBA7DiMDbF0ZQFUlkBDqwETL0KG//ZH4zuYNHfJl587nS95fd@vnTt6eTg/3x/VxOf/8no@X5bp8fXyfLsvh@WXd16LFOGppcxzu9nOvRcYsIzZXG1HPZnTe6B7FLKWPaPcV@DFshMhrzjzv4qaz@s6csTpSvC6GkS8yzXdKnGW1rU6wqc/mSlANyM4Yuo0MGFv2ZTxb8jVHhlPwRkcnQNGXca6l3nBP3D30HHXRnRCt9Azn5jjLO418gQ@NSpUtdUVG0oPA/nNZuiisa@ma0Ne5Vr423FG@gHnXm9/Cd1DvvBILXxCJ31GpQja64880apGS3rljNevGv4JeZOVmts/sHw).
### Explanation
```
d     % Take input implicitly. Consecutive differences
G     % Push input again
2YC   % Overlapping blocks of length 2, arranged as columns of a matrix
s     % Sum of each column
7-    % Subtract 7, element-wise
h     % Concatenate horizontally. Implicitly display
```
[Answer]
# C# (with Linq) ~~90~~ ~~81~~ ~~73~~ ~~71~~ ~~69~~ 68 Bytes
```
using System.Linq;n=>n.Aggregate((p,c)=>p<9|c==p|c==103-p?'\b':c)>9;
```
## Explanation:
```
using System.Linq;           //Obligatory import
n=>n.Aggregate((p,c)=>       //p serves as both previous character in chain and error flag
    p<9                      //8 is the error flag, if true input is already invalid            
        |c==p            
            |c==103-p        //103 comes from 55(7) + 48(0)
                ?'\b'       //'\b' because it has a single digit code (8)
                    :c)      //valid so set previous character, this catches the first digit case as well
                        >8;  //as long as the output char is not a backspace input is valid
```
[Answer]
**C, 81 bytes, was 85 bytes**
```
int F(int *A,int L){int s=1;while(--L)s&=A[L]!=A[L-1]&A[L]!=(7-A[L-1]);return s;}
```
Input is an array of integers A with length L.
Returns 1 for true and 0 for false. The input is checked from the end to the start using the input length L as the array index.
[Answer]
## Haskell, 37 bytes
```
f(a:b:c)=a+b/=7&&a/=b&&f(b:c)
f _=1<2
```
Usage example: `f [1,5,2]` -> `False`.
Simple recursion. Base case: single element list, which returns `True`. Recursive case: let `a` and `b` be the first two elements of the input list and `c` the rest. All of the following conditions must hold: `a+b/=7`, `a/=b` and the recursive call with `a` dropped.
[Answer]
## JavaScript, 40 bytes
```
f=i=>i.reduce((a,b)=>a&&a-b&&a+b-7&&b,9)
```
Takes advantage of the JavaScript feature that `&&` will return the last value that is parsed (either the falsy term or the last term). `0` is passed along if it doesn't meet the conditions, and the previous term is passed along otherwise. The 9 makes sure that it starts with a truthy value.
[Answer]
# Groovy, 61 bytes
```
{i=0;!(true in it.tail().collect{x->x in [7-it[i],it[i++]]})}
```
[Answer]
# Python 2, 58 Bytes
```
lambda x:all(x[i]!=x[i+1]!=7-x[i]for i in range(len(x)-1))
```
[Answer]
# [><>](http://esolangs.org/wiki/Fish), 39 bytes
```
0>i'0'-::&0)?v1n;>&!
?=0+=7+@=}:{:<;n0^
```
[Try it online!](http://fish.tryitonline.net/#code=MD5pJzAnLTo6JjApP3Yxbjs-JiEKPz0wKz03K0A9fTp7Ojw7bjBe&input=MjY0MjE1NjQ1MTIxMjYyMzIzMjM1NDYyMTI2MjQxMjMxNTY1NDYyNjIxMjQyMTQ1MTM1MTU2MzI2NDEyMzY1NjM1MzEyNjQxMzE1NDEyNDE1MTU0NTE0NTE0NjUzNTM1MTMyMw)
[Answer]
## Batch, 102 bytes
```
@set s=%1
@set/an=0%s:~0,2%,r=n%%9*(n%%7)
@if %r%==0 exit/b
@if %n% gtr 6 %0 %s:~1%
@echo 1
```
Ungolfed:
```
@echo off
rem grab the input string
set s=%1
:loop
rem convert the first two digits as octal
set /a n = 0%s:~0,2%
rem check for divisibility by 9 (011...066)
set /a r = n %% 9
rem exit with no (falsy) output if no remainder
if %r% == 0 exit/b
rem check for divisibility by 7 (016...061)
set /a r = n %% 7
rem exit with no (falsy) output if no remainder
if %r% == 0 exit/b
rem remove first digit
set s=%s:~1%
rem loop back if there were at least two digits
if %n% gtr 6 goto loop
rem truthy output
echo 1
```
]