text:
Is this number Loeschian?
A positive integer \$k\$ is a Loeschian number if

\$k\$ can be expressed as \$i^2 + j^2 + i\times j\$ for \$i\$, \$j\$ integers.

For example, the first positive Loeschian numbers are: \$1\$ (\$i=1, j=0\$); \$3\$ (\$i=j=1\$); \$4\$ (\$i=2, j=0\$); \$7\$ (\$i=2, j=1\$); \$9\$ (\$i=-3, j=3\$); ... Note that \$i, j\$ for a given \$k\$ are not unique. For example, \$9\$ can also be generated with \$i=3, j=0\$.
Other equivalent characterizations of these numbers are:

\$k\$ can be expressed as \$i^2 + j^2 + i\times j\$ for \$i, j\$ non-negative integers. (For each pair of integers \$i, j\$ there's a pair of non-negative integers that gives the same \$k\$)

There is a set of \$k\$ contiguous hexagons that forms a tesselation on a hexagonal grid so that corresponding cells are the same distance apart (see illustrations for \$k = 4\$ and for \$k = 7\$). (Because of this property, these numbers find application in mobile cellular communication networks.)

See more characterizations in the OEIS page of the sequence.

The challenge
Given a positive integer, output a truthy result if it is a Loeschian number, or a falsy result otherwise.
The program or function should handle (say in less than a minute) inputs up to \$1000\$, or up to data type limitations.
Code golf. Shortest wins.
Test cases
The following numbers should output a truthy result:
1, 4, 7, 12, 13, 108, 109, 192, 516, 999

The following numbers should output a falsy result:
2, 5, 10, 42, 101, 102, 128, 150, 501, 1000

Related (as noted by @PeterTaylor)

note for the brute force algorithm: if you iterate to √k you reduce algorithm complexity from O(n²) to O(n), at expense of some bytes c;

i, j non-negative integers or 9 (i=-3, j=3) - which one is it?

@Titus Oh now I see. For each pair of integers i, j there's a non-negative pair that gives the same k

I just ran across this while working on this

@uhoh Your actual question seems much more complicated though. Sorry that I cannot contribute to it

Find all integer pairs that produce a given Loeschian number My first question here, I've borrowed from your question quite a bit, but I think the continuity is helpful, and you did such a nice job writing this up.

Your "equivalent characterization" involving a tessellation is bogus, because a straight line of $k$ hexagons is a shape which tessellates the plane, for any positive integer $k$. But you may say instead, that on the lattice of centres of these hexagons (or equivalently of corners in a tessellation of equilateral triangles, complete edge to complete edge), there are two lattice points at distance $\sqrt{k}$.

Jelly, 11 9 bytes
ÆF‘%3,2ḄȦ

Try it online! or verify all test cases.
Background
In Elementary results on the binary quadratic form a² + ab + b², the author proves the following theorem about Löschian numbers.

Theorem 16. The necessary and sufficient condition of any non-negative integer to be in the form a² + ab + b² is that, in its prime factorization, all primes other than 3 that are not in the form (6k + 1) have even exponents.

As noted on the relevant OEIS page, since all integers are are congruent to 0, 1 or 2 modulo 3, the number 3 is the only prime that is congruent to 0, and all numbers of the form (6k + 1) are congruent to 1, the theorem can be stated alternatively as follows.
A non-negative integer n is a Löschian number if and only if all prime factors of n that are congruent to 2 modulo 3 have even exponents.
How it works
ÆF‘%3,2ḄȦ  Main link. Argument: n (integer)

ÆF         Yield the prime factorization of n, as prime-exponent pairs.
  ‘        Increment all primes and exponents, turning primes of the form 3k - 2
           into multiples of 3 and odd exponents into multiples of 2.
   %3,2    Reduce all incremented primes/exponents modulo 3/2.
           n is Löschian if and only if this does not result in a [0, 0] pair.
           Due to Jelly's form of vectorization, this yields [3, 2] if n = 1.
       Ḅ   Unbinary; convert each pair from base 2 to integer.
           Note that [x, y] = [0, 0] if and only if 2x + y = 0.
        Ȧ  All; return 1 if the result contains no zeroes, 0 otherwise.

Retina, 66 63 45 43 36 bytes
^()(\1(?<1>.\1))+(\1(.(?(4).\4)))*$

Despite the title saying Retina, this is just a plain .NET regex which accepts unary representations of Loeschian numbers.
Inputs 999 and 1000 take well under a second.
Try it online! (The first line enables a linefeed-separated test suite, and the next two take care of the conversion to unary for convenience.)
Explanation
The solution is based on the classification that the input can be written as i*i + j*(i + j) for positive i and non-negative j (since we don't have to handle input 0), and that n*n is just the sum of the first n odd integers. Golfing this was an interesting exercise in forward references.
A "forward reference" is when you put a backreference inside the group it refers to. Of course that doesn't work when the group is used the first time, since there is nothing to be backreferenced yet, but if you put this in a loop, then the backreference gets the previous iteration's capture each time. This in turn, let's you build up a larger capture with each iteration. This can be used to craft very compact patterns for things like triangular numbers, squares and Fibonacci numbers.
As an example, using the fact that squares are just sums of the first n odd integers, we can match a square input like this:
(^.|..\1)+$

On the first iteration, ..\1 can't work, because \1 doesn't have a value yet. So we start with ^., capturing a single character into group 1. On subsequent iterations, ^. no longer matches due to the anchor, but now ..\1 is valid. It matches two more characters than the previous iteration and updates the capture. This way we match increasing odd numbers, getting a square after each iteration.
Now unfortunately, we can't use this technique as is. After matching i*i, we need to get i as well, so that we can multiply it by j. A simple (but long) way to do this is to make use of the fact that matching i*i takes i iterations, so that we've captured i things in group 1. We could now use balancing groups to extract this i, but like I said that's expensive.
Instead, I figured out a different way to write this "sum of consecutive odd integers" that also yields i in a capturing group at the end. Of course the ith odd number is just 2i-1. This gives us a way to increment the forward reference only by 1 on each iteration. That's this part:
^()(\1(?<1>.\1))+

This () just pushes an empty capture onto group 1 (initialising i to 0). This is pretty much equivalent to the ^.| in the simple solution above, but using | in this case would be a bit trickier.
Then we have the main loop (\1(?<1>.\1)). \1 matches the previous i, (?<1>.\1) then updates group 1 with i+1. In terms of the new i, we've just matched 2i-1 characters. Exactly what we need.
When we're done, we've matched some square i*i and group 1 still holds i characters.
The second part is closer to the simple square matching I showed above. Let's ignore the backreference to 1 for now:
(.(?(4).\1))*

This is basically the same as (^.|..\4)*, except that we can't make use of ^ because we're not at the start of the string. Instead we make use of a conditional, to match the additional .\1 only when we've already used group 4. But in effect this is exactly the same. This gives us j*j.
The only thing that's missing is the j*i term. We combine this with the j*j by making use of the fact that the j*j computation still takes j iterations. So for each iteration we also advance the cursor by i with \1. We just need to make sure not to write that into group 4, because that would mess with matching consecutive odd numbers. That's how we arrive at the:
(\1(.(?(4).\1)))*

The more times I read this, the less I understand. I really want to know that many regex

@JavierDiaz There is a series of posts explaining forward references on Stack Overflow, based on Java regex. The examples there are probably a bit simpler.

CJam (16 15 bytes)
{mF{~\3%2=&},!}

Online demo
This is a block (an "anonymous function") which takes input on the stack and leaves 0 or 1 on the stack. It uses the characterisation that a number is Loeschian iff it has no prime factor equal to 2 mod 3 with odd multiplicity.
Thanks to Dennis for a one-byte saving.

Wow, nice characterization!

Python 2, 49 bytes
lambda n:0in[(n-3*i*i+0j)**.5%1for i in range(n)]

Try it online!
Uses the equivalent quadratic form given on OEIS of n == 3*i*i+j*j.  Check whether n-3*i*i is a perfect square for any i by taking its square root and checking if it's an integer, i.e. equals 0 modulo 1. Note that Python computes square roots of perfect squares exactly, without floating point error. The +0j makes it a complex number to avoid an error on the square root of a negative.

perfect square stuff is good to know, but how did you know this? I've just asked How (and why) does “Python compute square roots of perfect squares exactly”?

@uhoh I should note that comment of mine isn't quite correct -- it's only true up to some limit. Interested in the answers to your question there.

interesting new comment

Is this Python 3? If so, the +0j isn't necessary: some_negative_int**0.5 already gives a complex number. But I don't see how the % operation will work with either Python 2 or Python 3, given that you can't use % on complex numbers. What version of Python was this solution written for?

@MarkDickinson This is Python 2. At least, it works in 2.7. I wasn't aware that complex % isn't available in Python 3 -- thanks for pointing this out.

Thanks! I had no idea % worked with complex numbers in Python 2. (Apparently the behaviour was deprecated back in 2002, but not removed until Python 3: https://bugs.python.org/issue543387.)

Haskell, 42 bytes
f k=or[k==i*i+j*j+i*j|i<-[0..k],j<-[0..i]]

Usage example: f 501 -> False.
Tries all combinations of i from 0 to k and j from 0 to i . or returns True if the equality k==i*i+j*j+i*j holds for at least one of the combinations.
@flawr found a slightly different version with the same byte count:
f k|v<-[0..k]=or[(i+j)^2==k+i*j|i<-v,j<-v]

I didn't know about or, cool=) Perhaps you have an idea how to golf this alternative phrasing: f k|v<-[0..k]=or[(i+j)^2==k+i*j|i<-v,j<-v]?

@flawr: no, no idea how to golf your version further down. If you don't mind, I'l add it to my answer as an alternative version.

Python 2, 56 bytes
lambda n:any(n==i*i%n+i/n*(i/n+i%n)for i in range(2*n*n))

Java 8, 81 bytes
k->{for(int i=0,j;i<=k;i++)for(j=0;j<=k;)if(i*i+j*j+i*j++==k)return 1;return 0;};

simple, naïve implementation. coincidentally same code as C# but uses -> rather than =>.

Three less bytes because you can omit the curly braces and ending ;. DAMN!

@TheLethalCoder I actually can't, I made a mistake - same byte count as C#.

Makes me feel better anyway :)

This doesn´t seem to test negative i or j.

Jellyfish, 56 43 41 29 28 bytes
2 bytes thanks to Zgarb
p
n    <
+`/
`1*
/
+
&*r&;>i

Try it online!
A fork of my Jelly answer.

Jelly, 15 14 13 12 bytes
1 byte thanks to miles.
²S+P
‘ṗ2’Ç€i

Try it online!
Verify the smaller testcases.
A word of advice when testing for large numbers (bigger than 50): don't.
Truthy is a positive number. Falsey is zero.
Explanation
‘ṗ2’Ç€i   main chain, argument: z
‘ṗ2’      generate all pairs of numbers between 0 and z inclusive
    Ç€    apply the helper link to each pair
      i   find the index of z in the result

²S+P   helper link, argument: [x,y] (a pair of numbers)
²      compute [x*x, y*y]
 S     x*x+y*y
  +P   x*x+y*y+x*y

Tied (for) now... :-)

Should we exploit Peter's characterization...?

@LuisMendo That seems interesting, but it seems that it would be longer

I don't think you need to flatten it. Your helper link already maps from tuples to integers.

@miles That's clever, thanks.

MATL, 14 13 bytes
t:0hU&+HM&*+m

Try it online! Or verify all test cases.
Outputs 1 or 0.
Explanation
t:    % Implicitly input number k. Duplicate. Generate vector [1 2 ...k]
0h    % Concatenate a 0. Gives [1 2 ... k 0]
U     % Square, element-wise. Gives [1 4 ... k^2 0]
&+    % Sum of all pairs from this vector. Gives a (k+1)×(k+1) matrix
HM    % Push [1 2 ... k 0] again
&*    % Product of all pairs from this vector. Gives a (k+1)×(k+1) matrix
+     % Add the two matrices
m     % True if k is a member of the resulting matrix. Implicitly display

Did you just out-golf Jelly?

@LeakyNun Let's see how long it lasts. Maybe I'll delay the code explanation a bit :-P

Nope. – – – – –

Your turn – – –

@LeakyNun Aw :-( Now I can add the explanation :-)

Python, 67 bytes
lambda k,r=range:any(i*i+j*j+i*j==k for i in r(k+1)for j in r(k+1))

https://repl.it/Cj6x

Brachylog, 13 bytes
ḋḅ{h%₃<2|~j}ᵐ

Try it online!
Explanation
Uses the prime factors approach.
ḋḅ{h%₃<2|~j}ᵐ
ḋ              Prime factorization: gives a list like [7, 3, 2, 2]
 ḅ             Analyze into blocks of the same value: [[7], [3], [2, 2]]
  {        }ᵐ  This predicate must succeed for each block:
   h            The head (first number in the list, i.e. the prime factor)
    %₃           mod 3
      <2         is less than 2
        |       Or
         ~j      the list can be considered the result of joining two identical sublists
                 (i.e. its length is even, i.e. that prime factor has an even exponent)

C (gcc), 71 69 bytes
i,j,r;f(n){for(r=i=n+1;i--;)for(j=n;j--;)r*=n!=i*i+j*j+i*j;return!r;}

69 bytes: i,j,r;f(n){for(r=i=n+1;i--;)for(j=n;j--;)r*=n!=i*i+j*j+i*j;return!r;}.

This doesn´t seem to test negative i or j.

@Titus The question dictates non-negative i and j.

positive k, but not i and j. Take a closer look at the examples.

@Titus Quoting from the challenge: "k can be expressed as i*i + j*j + i*j for i, j non-negative integers." You take a closer look.

I did now. We should delete this discussion; it was pointless. Sorry, my fault.

65 bytes

VBA, 68 67 bytes
Function L(N):For a=0To N:For b=0To a:L=L+(N=a^2+a*b+b^2):Next b,a

Naive search, starting to slow down slightly for n=1000. Excel recognizes zero return as falsy, all other returns as truthy.
Note that investigation of negative i and j is not needed, since given i>j>=0 :

(-i)2 + (-i)(-j) + (-j)2 = i2 + ij + j2

(the same result as for i and j)

(-i)2 + (-i)j + j2 = i2 - ij + j2
i2 + i(-j) + (-j)2 = i2 - ij + j2

(if one is negative, it doesn't matter which one), and then

(i-j)2 + (i-j)j + j2 = (i2 - 2ij + j2) + (ij - j2) + j2 = i2 - ij + j2

And since both (i-j) and j are non-negative, any generation of Loeschian numbers involving a negative number can be achieved using non-negative numbers.

Saved a byte, Next:Next -> Next b,a thanks to Taylor Scott.

This doesn´t seem to test negative i or j.

See the first point under "Other equivalent characterizations". Note that all test cases come up correctly. I'll add the mathematical justification to my answer (if I can).

Sorry, my fault. Overread that that´s not necessary.

@Joffan you can condense Next:Next to Next b,a

@Joffan looking at your solution again maybe that is because of a missing :End Functionat the end of your solution

@Joffan, I have confirmed that this works in both 64 and 32 bit VBA; if you restrict your language to Excel VBA, then For a=0To[A1]:For b=0To a:x=x+([A1]=a^2+a*b+b^2):Next b,a:?x works for 60 Bytes

@TaylorScott Yes you're right, I was retyping and made a small slip, oops.

@TaylorScott the missing End Function  is deliberate; I allow an extra keystroke for the return that generates it.

@Joffan - I was unsure of the validity of AutoCompletion in languages that use it so I asked a question on the meta - It seems that the community has voted against it

C#, 84 82 81 bytes
k=>{for(int i=0,j;i<=k;++i)for(j=0;j<=k;)if(i*i+j*j+i*j++==k)return 1;return 0;};

A naïve solution. 1 = true, 0 = false

05AB1E, 10 bytes
ÝãDnOsP+Iå

Try it online or verify all test cases.
Explanation:
Ý           # Push a list in the range [0, (implicit) input]
 ã          # Create all possible pairs by taking the cartesian product on itself
  D         # Duplicate this list of pairs
   n        # Square each inner value in the pairs: [i²,j²]
    O       # Sum each inner pair together: i²+j²
     s      # Swap so the original list of pairs is at the top of the stack again
      P     # Take the product of each inner pair: i*j
       +    # Sum the values in the list at the same positions: i²+j²+i*j
        Iå  # And check if the input-integer is in this list
            # (after which the result is output implicitly)

Desmos, 62 60 bytes
f(k)=\prod_{n=0}^k\prod_{m=0}^k\left\{mm+nn+mn=k:0,1\right\}

Outputs \$0\$ for truthy and \$1\$ for falsey
Try It On Desmos!
Explanation:The products(\$\prod\$) iterate through \$0\$ through \$k\$ inclusive for both \$m\$ and \$n\$. It then tests if \$m^2+n^2+mn=k\$. If it does, then we know that \$k\$ is a Loeschian number, and we multiply by \$0\$. Else, we multiply by \$1\$. So if we don't encounter any pairs of \$m\$ and \$n\$ that satisfy \$m^2+n^2+mn=k\$, it will keep on multiplying \$1\$, and therefore it will stay at \$1\$ at the end. So the falsey value is \$1\$. But if a pair does satisfy \$m^2+n^2+mn=k\$, then it multiplies by \$0\$, and because \$0\$ times anything is \$0\$, and we are essentially just multiplying over and over again, it is guaranteed that once we multiply by \$0\$, it will stay at \$0\$. Hence, the truthy value is \$0\$.

PowerShell v2+, 63 56 55 bytes
param($k)(0..$k|%{0..($i=$_)|%{$i*($i+$_)+$_*$_}})-eq$k

Takes input $k, loops upwards twice (outer loop $i = 0 to $k, inner loop $j = 0 to $i), each iteration generates the result of i*i + j*j + i*j (shortened to i*(i+j) + j*j). Those results are encapsulated in parens, and passed as an array to -eq$k. This acts as a filter to select only elements that equal the input. Outputs a nonzero (the number back) for truthy, or nothing (empty) for falsey. Processes 1000 in about 15 seconds on my machine.
Test Cases
PS C:\Tools\Scripts\golfing> (1,4,7,12,13,108,109,192,516,999|%{.\loeschian-numbers.ps1 $_})-join','
1,4,7,12,13,108,109,192,516,999

PS C:\Tools\Scripts\golfing> (2,5,10,42,101,102,128,150,501,1000|%{.\loeschian-numbers.ps1 $_})-join','

PS C:\Tools\Scripts\golfing>

Javascript (using external library - Enumerable) (63 bytes)
k=>_.Range(0,k+1).Any(i=>_.Range(0,k+1).Any(j=>i*i+j*j+i*j==k))

Link to library: https://github.com/mvegh1/Enumerable
Code explanation: Create a range of integers from 0 to k (call this the "i" range), and test if any "i" satisfies a certain predicate. That predicate creates a range from 0 to k (call this the "j" range), and tests if any "j" satisfies a certain predicate. That predicate is the loeschian formula

Matlab, 53 52 bytes
n=input('');[a b]=ndgrid(0:n);find((a+b).^2-a.*b==n)

Simple search over all possibilities.
Outputs empty array as falsy and a non-empty vector as truthy value.
Considering all-zeros matrix as falsy and not-all-zeros matrix as truthy we can get rid of the find function resulting in 47 46 bytes solution:
n=input('');[a b]=ndgrid(0:n);(a+b).^2-a.*b==n

One byte saved thanks to @flawr

(a+b).^2-a.*b==n is shorter.

x.^2+3.*y.^2==n is even shorter. Any good?

Perl 6,  52 51  50 bytes
->\k{?first ->(\i,\j){k==i*i+j*j+i*j},(0..k X 0..k)}
->\k{?grep ->(\i,\j){k==i*i+j*j+i*j},(0..k X 0..k)}

{?grep ->(\i,\j){$_==i*i+j*j+i*j},(0..$_ X 0..$_)}

Explanation:
{
  # Turn the following into a Bool
  # ( Technically not necessary as a list of 1 or more values is truthy )
  ?

  # find all where the code block returns a truthy value
  grep

  # pointy block that takes one value (list of 2 values)
  # and gives each of the values in it a name
  ->
    $ ( \i, \j )
  {
    # return true if the definition matches
    $_ == i*i + j*j + i*j
  },

  # a list of 2 element lists (possible i and j values)
  ( 0..$_ X 0..$_ )
}

Test:
use v6.c;
use Test;

my @true = 0, 1, 4, 7, 12, 13, 108, 109, 192, 516, 999;
my @false = 2, 5, 10, 42, 101, 102, 128, 150, 501, 1000;

plan (@true + @false) * 2;

my &is-loeschian = {?grep ->(\i,\j){$_==i*i+j*j+i*j},(0..$_ X 0..$_)}

for |(@true X True), |(@false X False) -> ( $input, $expected ) {
  my ($result,$seconds) = $input.&time-it;
  is $result, $expected, ~$input;
  cmp-ok $seconds, &[<], 60, "in $seconds seconds"
}

sub time-it ( $input ) {
  my $start = now;
  my $result = $input.&is-loeschian;
  my $finish = now;
  return ( $result, $finish - $start )
}

1..42
ok 1 - 0
ok 2 - in 0.00111763 seconds
ok 3 - 1
ok 4 - in 0.00076766 seconds
...
ok 19 - 516
ok 20 - in 0.19629727 seconds
ok 21 - 999
ok 22 - in 0.1126715 seconds
ok 23 - 2
ok 24 - in 0.0013301 seconds
ok 25 - 5
ok 26 - in 0.00186610 seconds
...
ok 37 - 150
ok 38 - in 0.83877554 seconds
ok 39 - 501
ok 40 - in 9.2968558 seconds
ok 41 - 1000
ok 42 - in 37.31434146 seconds

This doesn´t seem to test negative i or j.

@Titus the (0..$_ X 0..$_) produces an empty list if $_ is less than 0, so there is no need to check for negative i and j because they will never be negative. Since it is only supposed to produce True for a positive Loeschian number, I don't have to do anything special for the negative case.

9 = (3*3)+(-3*-3)+(3*-3) is a positive Loeschian with i=3, j=-3; BUT I overread that every Loeschian number has non-negative i and j. So looking for negative numbers is not necessary. So actually we could delete those comments. Sorry for bugging; my fault.

@Titus modifying the code to {grep ->(\i,\j){$_==i*i+j*j+i*j},(-$_..$_ X -$_..$_)}(9) results in ((-3,0),(-3,3),(0,-3),(0,3),(3,-3),(3,0)). Honestly I probably just adapted it from other answers.

Perl, 54 + 1 (-n flag) = 55 bytes
for$i(0..$_){for$j(0..$_){$i*$i+$j*$j+$i*$j-$_?1:say}}

Needs -n and -M5.010 flags to run :
perl -nE 'for$i(0..$_){for$j(0..$_){$i*$i+$j*$j+$i*$j-$_?1:say}}'

Outputs some stuffs if the number is a Loeschian number, and nothing otherwise.
This implementation is quite boring, so here is another one, for 87 bytes, regex-based, just for the eyes :
perl -pE '$_=(1 x$_)=~/^(.*)(??{$1x(-1+length$1)})(.*)(??{$2x(-1+length$2)})(??{$1x length$2})$/'

Carefull with this one, as the backtracking will use a lot of memory, so don't try to test numbers too big! (especially numbers that aren't Loeschians)

Dyalog APL, 19 bytes
⊢∊(∘.(×-⍨2*⍨+)⍨0,⍳)

Checks if k ∊ (i + j)² – ij, for any 0 ≤ i, j ≤ k.
    ⊢ is k
∊ a member of
    ∘. all combinations of
        × i times j
        -⍨ subtracted from
        2*⍨ the square of
        + i plus j
    ⍨ for all i and j in
    0, zero prepended to
    ⍳ the integers 1 through k
1000 takes 3.3 seconds on my M540 and even less on TryAPL.

C, 66 bytes
Call f() with the number to test. The function returns the number of solutions it found.
q,r;f(n){for(r=q=0;q++<n*n;r+=n==q%n*(q%n+q/n)+q/n*q/n);return r;}

Try it on ideone.

Mathematica, 44 bytes
MemberQ[(+##)^2-##&@@@0~Range~#~Tuples~2,#]&

Unnamed function taking an integer as input and returning True or False. The command 0~Range~#~Tuples~2 creates all ordered pairs of integers both between 0 and the input #. The function (+##)^2-##& computes the square of the sum of its arguments minus the product of its arguments; when called on two arguments i and j, this is exactly i^2+j^2+ij as desired. So that function is called on all the tuples, and then MemberQ[...,#] checks whether the input is one of the resulting values.

ASP, 39 + 4 = 43 bytes
o:-k=I*I+J*J+I*J;I=1..k;J=1..k.:-not o.

Output: the problem is satisfiable iff k is Loeschian.
Answer Set Programming is a logical language, similar to prolog.
I use here the Potassco implementation, clingo.
Input is taken from parameters (-ck= is 4 bytes long). Call example:
clingo -ck=999

Output sample:
SATISFIABLE

Tried with 1000:
clingo -ck=1000

Output sample:
UNSATISFIABLE

You can try it in your browser ; unfortunately, this method doesn't handle call flags, so you need to add the line #const k=999 in order to make it work.

Ungolfed & explained code:
v(1..k).  % predicate v(X) holds for any X in [1..k]
o:- k=I*I+J*J+I*J ; v(I) ; v(J).  % o holds if k is Loeschian.
:- not o.  % discard models where o doesn't holds (make problem unsatisfiable)

k=X*X+3*Y*Y is shorter than k=I*I+J*J+I*J. Any good?

PHP, 70 bytes
for(;$i++<$k=$argv[1];)for($j=$i+1;$j--;)$i*$i+$j*$j+$i*$j-$k?:die(1);

takes input from command line argument; exits with 1 for Loeschian number, with 0 else.
Run with -nr.
breakdown
for(;$i++<$k=$argv[1];)     # loop $i from 1 to $k
    for($j=$i+1;$j--;)      # loop $j from $i to 0
        $i*$i+$j*$j+$i*$j-$k?   # if $i,$j,$k do not satisfy the equation, do nothing
        :die(1);                # else exit with return code 1
                            # implicit: exit with code 0

revisited, 67 bytes
by merging the loops to one:
for($b=1+$a=$n=$argv[1];$b--||$b=--$a;)$a*$a+$b*$b+$a*$b-$n||die(1);

not tested, though
pushed it a little further ...
57 bytes:
while($a*$a+$b*$b+$a*$b-$argn)$b++<$a||$b=1/($a++<$argn);

takes input from pipe; run with -nR
no output if input is Loeschian, division by zero error if not
not tested either

Haven´t been here for a while. I thought I remembered that deliberate errors were forbidden; but I couldn´t find it. What I found instead was a deleted post in the loopholes thread that requested to forbid output to STDERR. Could someone refresh my memory?
breakdown
# $a and $b are implicitly initialized with NULL, which increments to 1
while($a*$a+$b*$b+$a*$b-$argn)      # while solution not found
    $b++<$a                         # inner loop: $b from 1 to $a
    ||$b=1/($a++<$argn);            # outer loop: $a from 0 to $argn(=input)
    # $a<$argn: 1/true -> 1
    # else: 1/false -> division by zero

$x*$x+3*$y*$y is shorter than $a*$a+$b*$b+$a*$b. Any good?

Add++, 28 26 bytes
D,g,@@,*aaz€b*Fs
L,0rd‽gAe

Try it online! or verify the test cases
Takes a long time for large inputs. Times out on TIO for the 501 and larger test cases.
How it works
D,g,@@,		; Define a helper function that takes 2 arguments, i and j
		; Example: i = 0, j = 2			STACK = [0 2]
	*	; Multiply				STACK = [0]
	aaz	; Push [i i] and [j j]			STACK = [0 [0 0] [2 2]]
	€b*	; Take their products			STACK = [0 [0 4]]
	Fs	; Flatten and return the sum		STACK = [0 0 4 4]
		; Returns i*i + i*j + j*j		Returns 4

L,		; Main function, takes 1 argument, k
		; Example: k = 4			STACK = [4]
	0r	; Range from 0				STACK = [[0 1 2 3 4]]
	d	; Duplicate				STACK = [[0 1 2 3 4] [0 1 2 3 4]]
	‽	; Across all pairs...			STACK = [[[0 0] [0 1] [0 2] ... [4 2] [4 3] [4 4]]]
	    g	;   run the helper function		STACK = [[0 1 4 ... 28 37 48]]
	Ae	; Is k in the array?			Returns 1

"Bloody regex"? :-)

@LuisMendo I swear, my hatred for regex has only slightly decreased since that commit :)

GAP 4.7.9, 75 bytes
k->Filtered(Collected(FactorsInt(k)),d->RemInt(d[2],2)+RemInt(d[1],3)=3)=[]

Every positive integer \$k\$ has a unique representation as the product of powers of distinct primes, \$p_1^{e_1}\dots p_s^{e_s}\$. \$k\$ is Loeschian iff no prime \$p_i\$ occurs to an odd power \$e_i\$ if \$p_i=2\$ modulo 3.
The above GAP code is for a lambda-expression which returns true if k is Loeschian and false if not.
Try it online!
Its algorithm is nice and simple but the long names for some of those GAP functions make for poor golf, unfortunately.

Jelly, 9 8 bytes
Żp`ḋÄ$€i

Try it online!
Returns a non-zero integer for Loeschian numbers and \$0\$ for non-Loeschian numbers
-1 byte thanks to Sisyphus
May be a little cheeky to post, as the only reason this is shorter than Leaky's and Dennis’ Jelly answer is due to newer features, but it's different enough from the existing Jelly answers.
How it works
Żp`ḋÄ$€i - Main link. Takes k on the left
Ż        - Yield [0, 1, 2, ..., k]
  `      - Use this as both left and right argument for:
 p       -   Cartesian power
     $€  - Over each pair, [i, j], run the previous two commands:
    Ä    -   Cumulative sum; [i, i+j]
   ḋ     -   Dot product with [i, j]; Yields i×i+j×(i+j) = i×i + i×j + j×j
           This yields all Loeschian numbers below 3k²
       i - Index of k in this list, or 0 if not found

Husk, 11 bytes
€¹m§+Πṁ□π2ṡ

Try it online!

Japt, 13 bytes
ô ï d@¶Xx²+X×

Try it

Pyth, 17 bytes
.Am+%hd3%h/PQd2{P

Try it online! Test cases
Translation of Dennis's Jelly answer.

Perl 5 -pal, 50 bytes
$_=grep{//;grep$'*$'+$_*$_+$'*$_=="@F",0..$_}0..$_

Try it online!

Jellyfish, 26 bytes
p
c-&*+S
i*  R
 E  E,r&;32

Try it online!
Judge if the input value is in { (x+y)^2-xy | 0<=x,y<32 } with c

JavaScript (Node.js), 51 bytes
k=>g=(z=k*k,i=z/k|0)=>z&&(i+z%k)**2-z%k*i==k|g(z-1)

Try it online!
n^2 time
JavaScript (Node.js), 59 bytes
k=>g=(i=k,j=k)=>i<0|j<0?0:i*i+j*j+i*j-k?g(i-1,j)|g(i,j-1):1

Try it online!
C(2k,k) time

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Permute a string using Bit-Reversal
Previously, we computed the Bit-Reversal Permutation where we found how the order of indices would be permuted. In that case, we received an input n which was the order of the permutation of the indices where the length was 2n. However, this time, we are given a string of length m = 2k for some k. Now we want to apply the permutation indices of order k to a string.
Task
Your goal is to create a function or program that given a string where the length is a power of 2, output the permutation of it using bit-reversal.
As an example, the string 'codegolf' has length 8 which is a power of 2, that is 8 = 23. We learned in the previous challenge that the bit-reversal permutation of order 3 is [0, 4, 2, 6, 1, 5, 3, 7] which means that we select the characters from the input string using that order of indices.
Input                  Output
0 1 2 3 4 5 6 7        0 4 2 6 1 5 3 7
c o d e g o l f        c g d l o o e f

This is one possible method of solving this task. Since we do not require the order of indices as output, there may be shorter algorithms which avoid generating the indices and rely on permuting characters only.
Test Cases
Input = Output
"z" = "z"
"cg" = "cg"
"code" = "cdoe"
"golf" = "glof"
"codegolf" = "cgdlooef"
"aaaazzzz" = "azazazaz"
"LynngDaie dneers" = "Legendary Dennis"
"hieroglyphically" = "hpoaeillihglrcyy"
"Programming Puzzles N' Code-Golf" = "PliorNPGosgem zlrenda'uog  -mCzf"
"super spectacular dazzling dream" = "srenrzcrpdt sllau cg zueeaadpiam"

Rules

This is code-golf so the shortest code wins.
Builtins are allowed.
The input string will only be in ASCII. The length of the input string will always be a power of 2.

This is a trivial modification of the previous question.

@PeterTaylor This is not a duplicate. The previous is asking for indices and this is asking to permute which means there might be more possible methods to solve it. Are challenges which ask for the number of cycles in a permutation a duplicate to challenges which ask for the cycles of a permutation? That is a trivial modification if any if you ask me.

Yes, I would say they are.

@PeterTaylor We've had a challenge to generate the first n Fibonacci numbers and just recently we've had a challenge to find the product of the first n Fibonacci numbers. That is a trivial modification yet is a different task. Are you saying those are duplicates?

This is not the place for extended discussions. If you want to discuss how non-trivial a modification must be to not be a dupe, take it to meta.

Pyth, 9 bytes
hu+M.Tc2G

Try it online
How it works
 u       Q   fixed point: let G = input, and repeatedly replace G with
      c2G      chop G into two equal pieces
    .T         justified transpose
  +M           map concatenate
             until a duplicate is found
h            take the first (only) element of the resulting list

Haskell, 72 bytes
This is "permuting characters only", but is it shorter than a different approach?
s(a:b:c)|(x,y)<-s c=(a:x,b:y)
s n=(n,n)
r a|[_]<-a=a|(x,y)<-s a=r x++r y

s is a helper function to seperate the characters from even and odd positions, r is the bit reversal permutation function:
Prelude> r "codegolf"
"cgdlooef"

Python 3.5, 112 111 bytes:
from math import*;lambda d:''.join([d[int(bin(i)[2:].zfill(int(log2(len(d))))[::-1],2)]for i in range(len(d))])

You really start to appreciate the all in one power and compactness of Python once you start using languages like C and Java. Anyways, this is an anonymous function that you call by first naming it, and then calling it like a normal function wrapped inside the print() function.
Try It Online! (Ideone)

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Build a digital clock in Conway's Game of Life
Your task is to build a Game of Life simulation representing a digital clock, which satisfies the following properties:

The clock displays the hours and minutes in decimal (e.g. 12:00, 3:59, 7:24) with a different state for each of the 1,440 minutes of the day — either the hours will go from 0 to 23 or from 1 to 12 with a PM indicator.
The pattern is periodic, and the state loops around without any outside interaction.
The minutes update at regular intervals — from one change of minute to the next takes the same number of generations.
An anonymous bystander is able to tell at a glance that the display is supposed to be a digital clock. In particular, this entails:

The digits are visible and clearly distinguishable. You must be able to tell with certainty at a glance what time is being displayed.
The digits update in place. Each new number appears in the same place as the previous number, and there is little to no movement of the bounding boxes of the digits. (In particular, a digit does not contain 10 different digits in different places that get uncovered every time the digits change.)
The digits appear next to each other, without an excessive amount of space between them.

Your program will be scored on the following things, in order (with lower criteria acting as tiebreakers for higher criteria):

Bounding box size — the rectangular box with the smallest area that completely contains the given solution wins.
Fastest execution — the fewest generations to advance one minute wins.
Initial live cell count — smaller count wins.
First to post — earlier post wins.

Does the clock have a fixed starting time?

Can The display be in binary?

@FryAmTheEggman No, but the starting time shouldn't matter if the display state is cyclic.

@tuskiomi No, the display must be decimal.

I'm pretty sure this is B3/S23, but could you confirm or deny?

Yes, B3/S23 is correct.

"from one change of minute to the next must take the same number of generations" assuming our digits change in a cascade-of-pixels fashion, can we simply ensure that the cascade starts and/or ends at the same time each minute? that is, 1 is narrower than 0, so 1 probably won't take as long to change. it can start, or middle, or end at the same time as 0, but not all 3 without a lot more work.

"They must also update in place — each new number must appear in the same place as the previous number." How do you define "in the same place", since the digits won't necessarily be rectangular.

how discernable must our decimal digits be? is "if you know what it is and you squint then you can tell the difference between 0 and 8" enough, or does it need to pass the "an anonymous bystander can tell what it is with no prompting" test?

@Sparr You can ensure that a cascade starts or ends, and an anonymous bystander should be able to tell without prompting.

@MartinEnder There should be little to no movement of the bounding boxes of the digits. (You can make "1" right-aligned like a seven-segment display if you're implementing that, but otherwise the digits should all have roughly the same bounding box.)

@MartinEnder I think he means it can't be a glider.

@PyRulez I built that rule to exclude the kinds of digits that appear in different positions and just get uncovered when the clock is on that digit. The digital clock display should look roughly like an actual digital clock display.

By Game of Life, do you mean the B3/S23 ruleset originally defined by Conway, or any Life-like cellular automata? Does it need to use a rectangular grid, or is a hexagonal grid acceptable?

@Mego B3/S23, rectangular grid.

This is even harder than tetris as it seems.

this got posted on the Hackaday blog too : http://hackaday.com/2017/03/11/a-clock-created-with-conways-life/

How about this analogue clock⸮ https://copy.sh/life/?pattern=clock2&fps=1 (not made by me)

So, its now answered, now you make a challenge harder than a clock but easier than tetris. what about... Pong?

@SIGSEGV A pong challenge already exists, so they could answer there.

The tetris challenge has been solved, you can update the top.

11,520 generations per clock count / 10,016 x 6,796 box / 244,596 pop count
There you go... Was fun.
Well, the design is certainly not optimal. Neither from the bounding box standpoint (those 7-segment digits are huge), nor from the initial population count (there are some useless stuff, and some stuff that could certainly be made simpler), and the execution speed - well... I'm not sure.
But, hey, it's beautiful. Look:

Run it!
Get the design from this gist. Copy the whole file text to the clipboard.
New: here is a version with both AM and PM indicators for the demanding.
Go to the online JavaScript Conway life simulator. Click import, paste the design text. You should see the design. Then, go to settings and set the generation step to 512, or something around those lines, or you'll have to wait forever to see the clock display updating.
Click run, wait a bit and be amazed!
Direct link to in-browser version.
Note that the only algorithm that makes this huge design useable is hashlife. But with this, you can achieve the whole clock wraparound in seconds. With other algorithms, it is impractical to even see the hour changing.
How it works
It uses p30 technology. Just basic things, gliders and lightweight spaceships. Basically, the design goes top-down:

At the very top, there's the clock. It is a 11520 period clock. Note that you need about 10.000 generations to ensure the display is updated appropriately, but the design should still be stable with a clock of smaller period (about 5.000 or so - the clock needs to be multiple of 60).
Then, there is the clock distribution stage. The clock glider is copied in a balanced tree, so at the end, there are 32 gliders arriving at the exact same moment to the counters stage.
The counter stage is made using a RS latch for each state, and for each digit (we're counting in decimal). So there is 10 states for the right digit of the minutes, 6 states for the left digit of the minuts, and 12 states for the hours (both digits of the hours are merged here). For each of these groups, the counter behaves like a shift register.
After the counting stage, there are the lookup tables. They convert the state pulses to display segments ON/OFF actions.
Then, the display itself. The segments are simply made with multiple strings of LWSS. Each segment has it own latch to maintain its state. I could have made a simple logical-OR of the digit states to know wether a segment must be ON or OFF, and get rid of these latches, but there would be glitches for non-changing segments, when the digits are changing (because of signal delays). And there would be long streams of gliders coming from the lookup table to the digit segments. So it wouldn't be as nice-looking. And it needed to be. Yes.

Anyway, there is actually nothing extraordinary in this design. There are no amazing reactions that have been discovered in this process, and no really clever combinations that nobody thought of before. Just bits taken here and there and put together (and I'm not even sure I did it the "right" way - I was actually completely new to this). It required a lot of patience, however. Making all those gliders coming up at the right time in the right position was head-scratching.
Possible optimizations:

Instead of copying and distributing the same root clock to the n counter cells, I could have just put the same clock block n times (once for each counter cell). This would actually be much simpler. But then I wouldn't be able to adjust it as easily by changing the clock at a single point... And I have an electronics background, and in a real circuit, that would be horribly wrong.
Each segment has it own RS latch. This requires the lookup tables to output both R and S pulses. If we had a latch that would just toggle its state from a common input pulse, we could make the lookup tables half as big. There is such a latch for the PM dot, but it is huge, and I'm unable to come up with something more practical.
Make the display smaller. But that wouldn't be as nice-looking. And it needed to be. Yes.

Beautiful. Nice answer.

I'm only a little disappointed that the PM indicator is just on/off. It would be dope to have it swap between AM and PM. Nice job with this

It's too big. I'm not able to copy that large of a file to my clipboard. I, too, would recommend using something other than Pastebin.

@mbomb007 Copying works fine for me on windows, tho

I click the "copy" button, and I get an error. Maybe it's Chrome, but idk.

@mbomb007 Oh, for that I had to go to raw mode. The copy button seems to do nothing

Give this a try next!

@riker I know. I'll have a look, but it is more complicated, despite what some said. There is more information to share between blocks, there is the problem of making a convenient input mean, and generating the next blocks as randomly as possible, etc...

@Poke come on, you could have tried to add this yourself... Anyway, I have edited the post with a version with both AM+PM, for your pleasure.

@mınxomaτ Thanks. I moved the code to an anonymous gist, and linked to the raw file directly. It seems anonymous gists never expire.

what would code golfing suggestions on this post look like?

Just so you know, this answer has been featured in Microsiervos, one of the most important blogs about technology in Spanish, with over 800K followers on Twitter

@Luis wow. Thanks for the info. I'll have a look.

@Luis oh, I forgot one detail: I can't read spanish. Nevermind. But I'm both a bit proud and a bit ashamed because I'm sure the real GoL researchers would laugh at the way I did things. I, myself, see many thing that aren't right in this solution.

It killed my browser. :) Too much RAM allocated.

This is incredible. Is it possible to determine a step rate which would guarantee a minute between digit changes?

Direct link: https://copy.sh/life/?gist=f3413564b1fa9c69f2bad4b0400b8090&step=512 (sorry about undocumented parameters!)

@polynomial. No, not with the existing game of life programs: it depends on the computer speed and the step rate must be a power of two, which disallows accurate tuning. But you could make a specific game of life simulation program that guarantees it, however, since the number of generation steps between minute increment is constant.

@copy Cool! Thanks, it makes it a lot easier. May I ask you to put a link to this question from the pattern info dialog? Just for the credit, and in case  the design evolves. Also, so that people can have the explanation on how it works, eventually. Thanks a lot, anyway.

How would you even start designing something like this?

@Rory You take your head, smash it on the wall a dozen times as hard as you can. You are then ready to start.

It seems this stuff has gone viral...

@dim I'd suggest you add it to the pattern file: #O Your comment here

I want to give all of my rep to this answer. Is it possible?

What does p30 technology mean?

I can't even.... so besides being an alien in a human planet, what else do you do in the afternoons?
In all seriousness... wow....it would be great if you could do a write up on the design process for this.

@GurupadMamadapur you can set a bounty, but you need to wait for the current one to end. I don't think you should be so generous, though. I wouldn't know what to do with all that rep. Thanks anyway.

@jl6 it is the period at which the oscillators in these design run at. Basically, the number of generation steps between gliders in a stream. So, here it is 30. P30 is used in many designs, because people have found a lot of elementary building blocks for this. But there are other options, the other most frequently used being p46 (used by the OTCA metapixel design) and Herschel (stable - actually no oscillators at all).

Amazing! I managed to fumble-right-click to draw in some extra cells, and the pattern quickly disintegrated like it had cancer; the corrupt parts sending out gliders to corrupt others. So I was thinking: Are there resilient life machines that can clean this up, and have an “immune system”? I imagine it is required to be scaled up by 100 or 1000x from the clock for the complexity of it.

@bluss I'd be tempted to think (but I am far from being an expert on this - what I say here may be complete bullshit) that the stability would be more tied to the ruleset of the game (there are other kinds of cellular automata beyond the B3/S23 "standard life" rules originally defined by Conway) rather than the complexity of the design. There are certainly talented mathematicians working on these questions.

Is it for real or am I daydreaming? a lot of patience + right time in the right position was head-scratching = how exactly, what was the process?

@Michal you'll understand if you try to design something with that. Basically, the glider moves forward, but to advance one single cell, it needs four generations steps. It therefore has four possible "positions" (some call them "colors"). Now, if you want your glider to make something useful, it has to collide something. Almost everything is constantly moving on the design, because everything is made of oscillators. If your glider comes to collide that thing at the wrong time, or in the wrong position, it will most certainly just create a mess.

So the design process is: "Ok, I need to collide that, and my glider comes from there in this position at this time. Let's see bring it there using two reflectors. Crap, the thing it needs to collide is just two generation steps too soon, there. If I move the reflectors a bit, let's see... Crap, too late. Ok, let's collide them some place else. Crap, I don't have the room to make my glider go there. Ok, let's add two other useless reflectors just to make it arrive there instead. Crap, the reflectors collide this other stream of glider... Crap, let's go to bed."

@dim this is amazing stuff. How much time did you take to build this?

relevant xkcd

@mohitmun about two/three weeks, part time. Hard to say exactly how many hours, but quite some. I had to learn a lot of things in the process, too. I had no idea that could be done, actually. I first saw the tetris question and just though "What the hell? Forget that.". Then I saw this question and thought "What the hell again? What's up with this game of life thing, anyway?" So I made a bit of research, and saw many people had made funny things with it, so I thought "Ok, let's try".

@dim You don't need to be able to read Spanish. If you're using Google Chrome, there should be a "Translate this page" button in the address bar if you have the Chrome setting "Offer to translate pages..." enabled. Welcome to the 21st century. :)

@Polynomial 24 FPS with a Generation Step of 8 will be change the display once per minute (24 x 8 x 60 = 11520). If you computer is a bit sluggish, you could also try 12 FPS with Generation Step 16.

@dim, one question i couldnt find a meaningful answer from my basic google searches.. what tools you use to work on this kind of project ?. In addition to your comment on the thought process behind this (which includes a lot of craps :) ), where do you try out, play out and learn the new patterns created by others ?

@funtime. The only tool really required is "golly". Now, the knowledge can be found with extensive google searching. But most of the things I used come from the conwaylife site, both the wiki and the forums. Also the golly samples. The turing machine design also contains interesting patterns (see http://rendell-attic.org/gol/tmdetails.htm). There are other pages (from last century's www) containing various interesting info: http://www.radicaleye.com/lifepage, http://radicaleye.com/DRH/, ...

@dim Oh golly, that is useful!

If there was no rep cap, this single answer would make almost the entirety of his rep... Good job, needless to say +1

So many bounties

@DownChristopher Indeed. And I want to take this opportunity to really thank everybody. I didn't expect that many rewards.

How does one even learn something like this just off the internet? I tried googling around for a while, there's just a plethora of random patterns and no instructions on how to combine them into something useful. And then I tried really zooming in in your clock to figure out what's going on (and failed obviously). You've earned another +500 :P But seriously, where did you even learn all this?

@ghosts_in_the_code Thank you. Well, to answer your question, since I have some electronics background, I started to think that way. I thought if I could find some way of producing gliders regularily (clock), some way of sending the same information to multiple places (duplicator), some basic logic operators (and/or gates, ...), and some way of displaying the info (display), I could manage to do it. Googling helped to find these basic patterns (and the display was inspired from the metapixel design). Then, after playing with this a bit, you start to find more efficient ways to combine things.

But, before searching for patterns, you need to know what kind of patterns you're looking for... Maybe that was the step you were missing in your research.

Ok great. I think I'm starting to get it now. Not sure about those lines of gliders at the top of the clock... Why are they running criss cross, and how is all the information encoded in them? Anyways, I'll check it out again. Is there like a list of GoL patterns that are most useful in this kind of programming? Or do all the patterns come handy?

Not sure which line of gliders you're talking about. If you're talking about the zone from cursor Y=-3300 to Y=-2700, these are just duplicators. They copy the original clock pulse (single glider coming from the top of the tree) so there are 29 gliders arriving exactly at the same time to the counter stage, which is made out of some kind of flip-flops. By the way, this part has actually been difficult to design, although it is functionally very simple, because the two gliders the duplicators outputs don't have the same timings, so you have to compensate (with reflectors and stuff).

@ghosts_in_the_code Otherwise, the kind of patterns you need really depend on what you plan to design. But for something like this, duplicators, reflectors, and gates are always useful. See some other comment I made above for reference.

@ghosts_in_the_code I realize you were likely talking about the lookup tables: the squares with several lines/colums of lightweight spaceships (these are not gliders, gliders go diagonally, and LWSS go horizontally/vertically). These tables are translating the digit pulses (0 to 9) to display segment on/off actions. basically, the digit pulse input comes from the top, in the column corresponding to the digit, in the form of a missing LWSS in the stream. When this missing LWSS goes through the pattern you see at some crossings, it is replicated as a new missing LWSS on the horz stream...

each horizontal stream correspond to either a "on" or a "off" action on a specific segment. This information is then conveyed to the flip-flop (a one-bit memory) of the corresponding segment (each segment has one), which will enable or disable the LWSS within the segment (that you see as a digit when zoomed out). Basically, the information contained here is the shape of the digits, and it is encoded by the presence/absence of the little patterns at the line/column crossings.

@dim Ok thanks. Im not sure I can do any of it, but I'll try. Seems interesting. And your clock is inspiring, I must say

What software did you use to do this? I've tried to build some Life machines but I've found the primary pattern programs like Golly very awkward and awfully NOT user-friendly for building patterns -- namely they are sorely missing the ability to copy and paste from a "palette" of components and also "evolve on the spot" (that is, select a set of tiles and evolve it in isolation to get it "into the right phase".). I couldn't imagine building something like this with that. What program did you use?

@mike3 I actually used golly. Yes, it was a pain, and the features you're describing would have made things easier, indeed. Golly has its "layers" concept that somewhat allows that, but I agree it is, at best, not very flexible. Maybe someone should start developing a better tool...

A million congratulations, wonderful work! Very clever use of glider/LWSS interaction in the LUT phase. Now if only I could get off my lazy rear end and actually make good on my two-year-old promise to fulfill the tetris game request, lol ( biggest roadblock being that it requires a ton of new reactions that I'm not sure how to go about finding :[ ).

@dim Apologies for a new addition to an old thread, but I'm looking for official permission to add your digital clock pattern to the Online Archives for Golly 3.2.  May I?
If you have any attribution or other additional information about the pattern that I should add to the pattern comments, you could send it to b3s23life@gmail.com (if you'd prefer not to post it here).

@DaveGreene Sure. I grant you all permission to distribute this, modified or unmodified, under the terms you want. I'd appreciate an attribution notice: just put a link to this answer, as I wish to remain anonymous. And thank you very much for the notification. Also, thanks for your work on Golly, without which I certainly wouldn't have been able to do this (although - if I may - this tool could highly benefit from a kind of "reusable components palette" feature:  see the comment from The_Sympathizer above).

Yes, the "palette" idea is an old one -- Life32 had a feature like that.  On the other hand, you can do what The_Sympathizer mentions in the current Golly, in a way that's only a little rough around the edges:  open a labeled "stamp collection" of common components in one layer (or even a second copy of Golly), and do your editing in another layer. Tile the layers if you don't want to switch back and forth between tabs.  Select and Ctrl+Space in Golly does the evolve-on-the-spot trick; Shift+Space is "freeze selection and evolve everything else". -- And thanks for the official permission!

Thanks to the YouTube algorithm, I came to this answer from https://www.youtube.com/watch?v=3NDAZ5g4EuU


text:
Build a digital clock in Wireworld
Inspired by this Game of Life question.
Wireworld simulates "electrons" flowing through "wires", simple arrangements of which produce typical logic gate behavior.
I challenge you to build a digital clock in the Wireworld cellular automaton. Your clock must count upwards from 00:00 to 23:59 in the usual fashion, or to 11:59 with an AM/PM indicator, then reset.
Your entry should be visibly divided into two parts. Part A should contain all of the non-display logic, all of the parts involved in incrementing and looping the digits. Part B will be the display and the logic that drives it. The only connection between these two parts should be 16 wires representing the four digits of the time in BCD (with one optional wire for the AM/PM indicator, and one optional wire for a signal clock line if your signals aren't continuous). (EDIT: always-zero wires can be omitted)
The timing of the clock behavior should be consistent. The simulation should take the same number of ticks for each of the 1440 transitions between states. Any electrons on the 16 wires should emitted from part A at the same time and start their trip in parallel.
This is a code-golf competition. Your score is the area of the axis aligned bounding box surrounding part A.
By analogy, if this were a textual language, your score would be the size of the clock-management function producing four 4-bit outputs, which contains a loop and the logic for 4 counters, not the function that decodes and prints that output.
Your part B can be as large or small as you'd like. It is only required so that the output of your submission can be seen by someone running it, since there is no easy way to simply "debug" outputs from a wireworld circuit. There are multiple BCD->7segment circuits available online. Feel free to use whichever one you'd like, or make your own if you need a clocked signal line, and display your AM/PM indicator at some scale similar to the digits.
EDIT: Part B is now optional. If you just have the BCD outputs from your part A, feel free to submit that. It will be more tedious to confirm the clock works, but I can read a row of bits just fine in a paused simulation.

Here is a small online simulator.

I've been working on this but only saw it last week so I'll probably miss the bounty. I can't find a 4-wire version of a wireworld bcd->7-segment; building a 4-to-2 converter in front of the popular 2-wire 7-segment device (like the one that comes with golly) may be the way to go. One problem with that device is that, while it's nice-looking, it's slow to update, which will bloat Part A's size because it can pump numbers out faster than they can be displayed and must be artificially slowed down.

I have a 150,000 cell working Part A that I can prove works but currently lacks a rule-compliant Part B.

I didn't expect part B to be difficult. How far apart are your electrons in part A?

What a waste of 500 rep if nobody answers.... You should add it to the List of Bounties with no Deadline instead.

I think it shouldn't be there until after the deadline. If someone answers here and gets a single upvote then it will automatically go to them, I think?

@wyldstallyns please post your part A

I've been thinking hard about Part B and whether it's theoretically possible to create a 6-micron 7-segment display. I'm very doubtful it's practically possible, although I'm still working on whether it's theoretically possible (it'd have to have very thin lines at a minimum I think). Interestingly however, it might well be practically possible (and I'm thinking of trying) to make a 6-micron Braille display. My clock therefore might end up displaying in Braille rather than Arabic numerals.

You aren't required to stick to 6-micron. I'm surprised everyone is going that large, actually. I expected to see some 4 and 5 micron solutions.

I feel like a small 7-seg display should be possible at any scale, as long as you're willing to accept segments as short as the electron spacing.

I just wrote a lua BCD wire logger for golly, see my answer.

What time does this close?

@wyldstallyns It closes at 16/12/2016 03:30:35Z (you can hover over the 'tomorrow' to get the precise times). The very best of luck to you. I genuinely like your clock. It's an elegantly simple idea and an excellent execution. I must admit I was also surprised with how much space mine ended up taking in the end. And I'd be interested to see any improvements you can come up with in yours. So, best of luck :)

@niemiro Yes I expected computed times to have a much smaller footprint and I'd be out of the running when yours worked.

...man, I might do this over the next few days. Wish I'd seen it weeks/months ago.

We obviously need a next wireworld challenge.

Someone should suggest a few rule changes to the life clock challenge that inspired this one, and go compete over there :)

I like this challenge a lot more than doing it in CWOL. Expect an answer from me at some point.

"The only connection between these two parts should be 16 wires representing the four digits of the time in BCD" - may this also be 2 lines coded serially instead of bcd coded in parallel?

@MarkJeronimus I would love to see that solution, but its far too late to change the spec here

Never mind. If this was allowed then one could just make a tiny 86400-counter and a huge display decoder

Counting to 86400 (or just 1440) wouldn't meet the other requirements. If you can get a serial line to count from 00:00 23:59, that would be closer.

Binary counter clock (score = 134×33 = 4422 134×32 = 4288)
As promised 2⅔ years ago. Actual building time from scratch was less than 3 days.
I took inspiration from several sources, but in the end everything is custom made, and no cell is copied from any design by someone else. It makes royal use of the colors of WireWorldMarked (also by me, and supported by default by  Golly). The colors are just eye-candy and don't change the rules of WireWorld.
This uses 10 micron technology (electrons spaced 10 gens apart). This makes small loops (memory cells for example) larger, however it allows not only for easier calculations but also compact axis-aligned ROMs and decoders, and it's the maximum throughput of a 'cross' gate. Everything makes use of 'negative' logic, where the presence of electrons is a logical '0' and missing electrons are '1'. In this sense, an OR gate, for example, does A=0 OR b=0 -> output 0. The sole reason for this is that it makes the binary counters, and in particular, the reset logic, much less complex.
The clock's real-time speed is 480 gens per minute (large green loop) which translates to 0.125s per gen or 8 gens/s. The loop expands the bounding box by 1 in the vertical direction, but with any smaller number the carries propagate too slow and it never displays the correct time. Unfortunately it will never be real-time in Golly because Golly only applies a delay between gens, and with a non-negligible duration of calculating a gen, it will run slow if you set the delay to 0.125. In fact, the speed appears to be non-constant and fluctuates by several percents.
[edit] This is v2 in which I've synchronized the display segments. This way the maximum delay between the final change of the leftmost display and the next change of the rightmost display (between 24:00->0:00) is 170 gens. The V1 display update took 500 gens, longer than 480 gens (a 'minute'), oops. I was about to boast how good I am for squeezing a loop of 440 in a box 1 less tall, then choosing 400 gens because it divides a minute nicely, but I wanted a significantly higher number, and was done waiting until someone pointed out "hey why don't you just use a smaller loop and some dividers?". So I used three dividers and a loop of 150 gens for a rate of 1200 gens/min (20Hz). The squeezed loop is still visible in the explanation image below.

High-speed animation at 7200 gens/s (1.2MiB)
Real-time animation of only the display (600KiB)
(animations are of v1 but still give an impression of the clock)
Extra explanations and some dividers before final space-optimizations:
(the gray arrows point to cells in the middle of the machinery which are either present or absent, depending on if that bit should contribute to the reset logic.)

Golly pattern with everything I made until now: Clock (Mark Jeronimus).mc

Latching Clock
Score - 53,508 (of which only 36,828 is actively used due to the L-shaped design)

High Quality recording - https://1drv.ms/u/s!ArQEzxH5nQLKhvt_HHfcqQKo2FODLQ
Golly pattern - https://1drv.ms/u/s!ArQEzxH5nQLKhvwAmwCY-IPiBuBmBw
Guiding Principles -

Since this was my first time using a cellular automaton I avoided stringing together large premade components. One valid approach I did not take would have been a binary adder starting at zero and continuously adding one to the last output, followed by a binary to BCD converter, display demultiplexer, 7-segment decoder and 7-segment display.
It should be possible to cold start the clock. I imposed on myself the additional restriction that a single electron head placed at a specific conductor cell should correctly start the clock. I did not want to require careful manual synchronisation of many disparate flip-flops and individual timing elements before beginning the simulation.

Part I: The Minute Counter
Mathematics
Counting from 0 to 9 in binary (for the least significant minutes digit) goes as follows -
0 - 0000
1 - 0001
2 - 0010
3 - 0011
4 - 0100
5 - 0101
6 - 0110
7 - 0111
8 - 1000
9 - 1001
Reading that as columns, the least significant (2^0 units bit stream) goes 01010101, the 2^1 units stream goes 0011001100, the 2^2 units stream goes 0000111100 and the 2^3 units stream goes 0000000011.
The first one's easy - just flip-flip 01 forever. The third is a stream of four 1s, six 0s, phase shifted by six zeros. The fourth is a stream of eight 0s and two 1s.
The second is a bit harder as it's got a nasty asymmetry. However, I notice that (where . is concat operator):
0011001100 . 0011001100 = 0011001100 . NOT(1100110011) = 00110011001100110011 XOR 00000000001111111111 = 5(0011) XOR 00000000001111111111
(Incidentally, as alluded to later, the majority of my clock runs on a 60-beat ticker. The 00000000001111111111 double length wave is where the need for the 120-beat ticker comes in).
Design
The output streams from top to bottom go Units of Minutes (2^0, 2^1, 2^2, 2^3) then Tens of Minutes (2^0, 2^2, 2^1). Note that the bottom two wires are crossed.

120-beat main clock.
Where to place an electron for a cold start. Without any electron tail it splits in two directions but the diode immediately above catches one of these giving a nice cycling electron going around and round the 120-beat loop.
12-beat secondary clock.
Coil of conductor + diode starts the secondary 12-beat clock. Words cannot describe how fiddly this little piece was to sync. You have to sync the 120 and 60 beat clocks, then sync in the 12-beat and frequency halver 24-beat pseudo clocks, followed by tying back the 24-beat clock to the 120-beat clock otherwise the XOR gate doesn't work.
Phase shift.
Flip-flop. A single electron on the input hits the set line first then after a very specific amount of time, hits the reset line giving precisely one pulse in, one pulse out.
Adding humps here - on the reset line, increases the delay between set and reset on the flip-flop. Each extra hump gives an extra pulse. The flip-flop below has nine extra humps, so ten pulses between set and reset.
XOR gate for my tricky 2^1 units of minutes line.
AND-NOT gate and very specific part lengths means each electron pulse which comes past doubles back on itself and annihilates the electron behind. Frequency halver. Creates a 24-beat clock from the 12-beat secondary source.
60-beat secondary clock, which actually does most of the work. It's just easier to start a fast clock from a slower one, so the slowest clock (120-beats) is the master, even though it's barely used. The 60-beat clock is the heart of this thing.
Feedback wire which carries electrons only when the 60-beat clock is ticking. It's used in conjunction with an AND-NOT gate to stop the clock being restarted repeatedly from the 120-beat master. Otherwise many horrible things happen & Ctrl-Z is saviour.
The diode where the 60-beat clock is started from.
This whole device is a flip flop, AND gate, and AND-NOT gate combined. It gives a latch. One pulse in starts it, one pulse in stops it.
Loop of wire to calibrate the latch to 10 pulses on, 10 pulses off for a one in ten pulse input. Without it we get 12 pulses on, 8 pulses off. These ten on ten off latches form the basic components of the ten minute blocks in the same way the 6-micron (1 pulse) flip-flops formed the basic components of the minute units.
The cold start initial pulse caused all sorts of problems including being two beats out of phase with the clocks it starts. This messes up the latches. This AND gate catches and disposes of out of sync pulses - in particular the starting pulse.
This is a part of the design I somewhat regret in retrospect. It takes an electron, splits it into five and annihilates the five electrons behind, taking 111111 to 100000.
This takes an electron and stitches it on the front. Two phases ahead to be precise. It takes 100000 and makes 101000. Combined with part 16 we get 111111 -> 100000 -> 101000. In retrospect I wish I'd done 111111 -> 101010 -> 101000; it would have achieved the same effect in less space.
The above patterns are then pushed into the bottom latch to achieve 20 on, 40 off. This is split, half is phase shifted by 20 units, and then these form the two high order bit streams of the tens of minutes.

Part II: The Hour Counter
Explanation
The input to the hour counter is a single electron pulse, once an hour. The first step is to reduce this to a single electron pulse, once every twelve hours. This is achieved using several "latch & catch" primitives.
A "latch" is a 6-micron flip-flop connected to an AND-NOT and an AND gate to give a 6-micron on/off latch. A "catch" takes a continuous stream of electrons as input, allows the first through, then annihilates every other electron behind, until the stream ends at which point the catch resets.
Placing a latch, followed by a catch, in series, results in one electron in -> turns on the latch, one electron out the other end (rest caught by catch). Then second electron in -> turns off latch, catch silently resets. Net effect: first electron passes through, second electron is annihilated, and so on and so forth, irrespective of how long the delay is between those electrons.
Now chain two "latch & catch" in series, and you have only one in four electrons passing through.
Next, take a third "latch and catch", but this time embed an entire fourth latch and catch on the flip-flop SET line, between the AND-NOT gate and the flip-flop SET. I'll leave you to think about how this works, but this time only one in three electrons passes through, irrespective of how long the delay is between those electrons.
Finally, take the one in four electrons, and the one in three, combine them with an AND gate, and only one in twelve electrons pass through. This whole section is the messy squiggle of paths to the top left of the hour counter below.
Next, take the electron every twelve hours and split back into one every hour, but output each onto a different conductor wire. This is achieved using the long coiled conductor with thirteen exit points.
Take these electrons - one an hour down different conductors, and hit a flip-flop SET line. The RESET line on that same flip flop is then hit by the next hour's conductor, giving sixty pulses down each wire per hour.
Finally - take these pulses and pass them into seven and a half bytes of ROM (Read-Only Memory) to output the correct BCD bitstreams. See here for a more detailed explanation of WireWorld ROM: http://www.quinapalus.com/wires6.html
Design

One electron per hour input.
First latch.
First catch.
"Latch & catch" embedded on an outer "latch & catch" SET line.
AND gate.
AM/PM latch (turned on/off once every twelve hours).
Each loop of wire is 6x60=360 units long.
Flip/Flop turned on its side to create a smaller profile.
Seven and a half bytes of ROM.

Notes

Due to its one electron per minute, 6-micron design, run the simulation at six generations per minute (one generation every 10 seconds) for a real-time clock.
The AM/PM line is high (1) for AM, low (0) for PM. This might seem a slightly unusual way round to choose, but there is justification. During a cold start of the clock, the AM/PM line is naturally low (0) initially. As soon as the AM/PM line is pulled high (1), this indicates that the count has begun at 12:00AM. All output before this point should be disregarded, all output after this point is considered meaningful.

Useful Links

I learned the basics of WireWorld from http://www.quinapalus.com/wi-index.html. An excellent resource.

To create and simulate the cellular automaton I used Golly: http://golly.sourceforge.net/

I took the AND gate design from http://mathworld.wolfram.com/WireWorld.html

And I've only just found this webpage so didn't use it but it looks great: http://karlscherer.com/Wireworld.html

changed requirements so that always-zero outputs can be omitted. the 4s and 8s bits for the tens of hours are never used, nor the 8s bit for tens of minutes.

Solid! True engineering. Would any of the other logic gates have been useful? I'm about to brute force some.

is there a reason you're doing minutes and seconds instead of hours and minutes?

This is beautiful

Oh good grief that's just close enough now I'm compelled to try and optimize mine. I have repeating patterns I could shorten to make room to fold others in.

@Sparr I've updated my answer to include a description of how the hour part works. I might make a few small finishing tweaks to this writeup tomorrow but it's essentially done now.

I did not intend for "and start their trip in parallel" to require that all wires exit the bounding box on the same side, but I'm guessing you read it that way?

@Sparr I don't honestly think it made much difference when it came down to it. It made the wires an awful lot simpler to synchronise when they were all stacked on top of each other and they sort of naturally came out of one side anyway.

I was thinking the top section could be flipped across a southwest/northeast line, with the minutes wires coming out the top, and cut off a significant chunk of space.

Kudos @niemiro!

I don't know how active you are on meta, so this is to let you know that I've nominated this answer for the Best of PPCG 2016.

Great, now make it show on a 7-segment.

Delay line memory - 51 x 2880 = 146880

Zoomed out:

Output comes out the top of each loop.
I put all the states directly on the wire with this lua, letting golly step the electrons forward between bits so we don't have to follow the wire with a cursor.
I used this naive method to set a bar and crash course wireworld, golly and lua.
local g = golly()

local minutes_in_day = 1440 -- 60x24
local interval = 4 -- how often to send electrons

local function bcd4(num)
    num=math.floor(num)
    local t={}
    for b=4,1,-1 do
        t[b]=math.floor(math.fmod(num,2))
        num=(num-t[b])/2
    end
    return table.concat(t)
end

local function makewire(x,y1,y2)
    for y1=1,y2 do g.setcell(x,y1,3) end
end

local function makeloop(x,y,size)
    local len = size/2 - 1
    makewire(x,y+1,len); makewire(x+2,y+1,len) -- main wires
    g.setcell(x+1,y,3); g.setcell(x+1,y+len,3) -- endcape
end

local function paint(x,y,pattern)
    for v in string.gmatch(pattern,".") do
        if v=="1" then g.setcell(x, y, 1); g.setcell(x, y-1, 2) end
        x = x + 4
    end
    g.show(pattern);g.update() -- slows things down but more interesting to watch
    for i=1,interval do g.step() end
end

for x=0,63,4 do makeloop(x,0,minutes_in_day * interval) end

for hour = 0,23 do
      for minute = 0,59 do
         paint( 0, 2, bcd4(hour/10) .. bcd4(hour%10) .. bcd4(minute/10) .. bcd4(minute%10) )
      end
end

For testing I added these top wires and watched their tips.

Here's the script to collect the 4 sets of 4 wire BCD to eyeball.
-- watches 16 wires spaced 4 apart starting at (0,-4)
local ticks = 1440 -- set to match the length of your 24 hour loop
local g = golly()
local output = ""
local nums = {  ["0000"] = "0", ["0001"] = "1", ["0010"] = "2", ["0011"] = "3", ["0100"] = "4",
                ["0101"] = "5", ["0110"] = "6", ["0111"] = "7", ["1000"] = "8", ["1001"] = "9",
                ["1010"] = "A", ["1011"] = "B", ["1100"] = "C", ["1101"] = "D", ["1110"] = "E",
                ["1111"] = "F" } -- full set in case we have errors (i did)

for i=0,ticks,1 do
   local text = ""
   for i=0,48,16 do -- set your X here, change the 0 and 48
       local word = ""
       for j=0,15,4 do
            local bit = g.getcell(i+j,-4) -- set your Y here, change -4
            if bit == 0 or bit == 3 then word = word .. "0" else word = word .. "1" end
       end
       text = text .. nums[word]
   end
   g.show(text); output = output..' '..text
   g.update(); g.step();g.step();g.step();g.step()
end
g.note(output)

Final answer requires pruning the always-zero lines and routing the rest to their correct BCD inputs.

changed requirements so that always-zero outputs can be omitted. the 4s and 8s bits for the tens of hours are never used, nor the 8s bits for tens of minutes.

This is a hilarious and awesome implementation!

Ok I've been beat with another functional clock at the 11th hour. I'm going to attack the longest and shortest loops with different tricks.

I'm not going to pull it off. I can save 1/4th of the size by switching to 3 micron pulses, but it still won't coil tight enough to beat niemiro.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Only Even Bytes
The scenario
Lately you have been noticing some strange behavior with your favorite text editor. At first it seemed that it was ignoring random characters in your code when writing to disk. After a while you noticed a pattern; characters with odd ASCII values were being ignored. Under further inspection you discovered that you can only write to files properly if every eighth bit is zero.  Now you need to know if your valuable files have been affected by this strange bug.
The task
You must write a complete program that determines if a file contains any odd bytes (demonstrating it is uncorrupted).  But because of your text editor you cannot write any odd bytes in your source code. You may assume any pre-existing encoding for input, however you must still check every individual byte, not just characters.
Input
Your program will take the contents of or the path to a file from either stdin or command line.
Output
Your program will output to stdout either a truthy value if the given file contains an odd byte or a falsy if every eighth bit is zero.
Criteria
This is code golf, shortest program that completes the task wins.  To be a valid submission every eighth bit in the files source code must be a zero.  I would recommend including a copy of your source code's binaries in your submission.
Standard loopholes apply.
Test Cases
(In ASCII encoding)
    Input:
"$&(*,.02468:<>@BDFHJLNPRTVXZ\^`bdfhjlnprtvxz|~

Output:
falsy

Input:
!#%')+-/13579;=?ACEGIKMOQSUWY[]_acegikmoqsuwy{}

Output:
truthy

Input:
LOREMIPSVMDOLORSITAMETCONSECTETVRADIPISCINGELITSEDDOEIVSMODTEMPORINCIDIDVNTVTLABOREETDOLOREMAGNAALIQVA
VTENIMADMINIMVENIAMQVISNOSTRVDEXERCITATIONVLLAMCOLABORISNISIVTALIQVIPEXEACOMMODOCONSEQVAT
DVISAVTEIRVREDOLORINREPREHENDERITINVOLVPTATEVELITESSECILLVMDOLOREEVFVGIATNVLLAPARIATVR
EXCEPTEVRSINTOCCAECATCVPIDATATNONPROIDENTSVNTINCVLPAQVIOFFICIADESERVNTMOLLITANIMIDESTLABORVM

Output:
truthy

Tips

Choose language wisely this challenge might not be possible in every language
The Unix command xxd -b <file name> will print the binaries of a file to the console (along with some extra formatting stuff)
You may use other encodings other than ASCII such as UTF-8 as long as all other rules are followed

Can we assume that the input doesn't contain newlines?

@Dennis No you cannot,  you should assume that you are reading from a random text file.

@Dennis If you don't mind me asking, why do you ask?  If this creates unnecessary difficulty for some reason I may consider amending the requirements.

Some languages have a hard time reading multi-line input, but it's not like this challenge is meant to be easy, so it's probably OK. :P Can the input be empty?

@Dennis it is safe to assume that the input cannot be empty.  An empty text file is hardly considered valuable.

!#%')+-/13579;=?ACEGIKMOQSUWY[]_acegikmoqsuwy{} are the banned printable ASCII characters, for anyone who cares. The allowed printable ASCII characters are " $&(*,.02468:<>@BDFHJLNPRTVXZ\^`bdfhjlnprtvxz|~

My function is encoded in the classic Dyalog encoding so that I can have 1 byte/char. But it analyzes the input according to evenness of UCS point. Is this OK?

@Adám I am sorry I do not know what you mean by UCS point.

@EamonOlive In Unicode, every character is assigned an integer, called a code point. They are roughly the same concept as ordinals in other encoding schemes (like ASCII), but can take a much larger range of values (specifically, in UCS-2, code points range from 0-65535).

@Adám No If I am understanding correctly I do not believe that this is ok.  My understanding is since UCS-2 encodes each character as two bytes you only end up checking every other byte for evenness.  Programs should check every 8th bit looking for a one.

Quite handy that all vowels are banned... ;-)

@EamonOlive I did not mean UCS - 2, only the Universal Character Set. In other words: My code is encoded in a specific encoding that is fitting for it, and in that encoding it only uses even-positioned characters. However, when it is fed ASCII text to check, it uses the position in the Universal Character Set to determine evenness.

@EamonOlive The real problem here is that if I am to judge evenness of input according to the same encoding as the code itself, then I cannot support normal 7-bit ASCII files, because only 111 of the 128 7-bit ASCII characters are in my 256 character code page.

@Adám In that case it should be fine.

determines if a file is contains any odd bytes and is thus uncorrupted – Shouldn't that be "corrupted"?

How is LOREMIPSUM... truthy? It contains both even and odd bytes (unless I just don't understand the challenge)

@Adám I think the motivation is that if a file contains odd bytes, then it must not have been saved by the broken editor (which would have removed those bytes), so it must have been saved by some other working editor, hence “uncorrupted”.

@AndersKaseorg Ah, I see. Thanks.

May we take input bytes bytes in numeric form?

@Adám you may not take bytes in numeric form.

@shooqie LOREMIPSUM... is truthy because it is "non corrupted".  It contains odd bytes and thus has not been damaged by the bad text editor.  Falsy is reserved for files that only contain even bytes, thus have been damaged.

Welp, so much for BF having a chance in this challenge.

Also note that if you have any line breaks in a DOS/Windows file, the [CR] has the odd bit.  I was hoping that WhiteSpace was safe, but alas [TAB].  If you want to go old school, EBCDIC gives you three vowels.

Can we assume the input will not contain NUL (\0) bytes?

@DomHastings Sure. That seems reasonable to me.

I think we need clarification on exactly which bytes we do need to support, if the program itself is plain ASCII.

@ØrjanJohansen You should support all the bytes other than the null byte which I have made an exception for.

@WheatWizard https://codegolf.stackexchange.com/a/155007/59376 - what is the validity of this answer lol.

GS2, 4 bytes
dΦ("

Try it online!
Hexdump
0000000: 64 e8 28 22                                      d.("

How it works
      (implicit) Read all input and push it on the stack.
 Φ    Map the previous token over all characters in the string:
d       Even; push 1 for even characters, 0 for odd ones.
  (   Take the minimum of the resulting list of Booleans.
   "  Negate the minimum.

Befunge, 36 bytes
I know this is an old question, but I wanted to give it a try because I thought it would be an interesting challenge in Befunge.
>~:0`|
>20`:>$.@
|` " "<
*8*82<^p24*

Try it online!
It outputs 1 if the input is corrupted (i.e. contains an odd byte), and 0 if it's OK.
Explanation
The problem is how to determine odd bytes without having access to the / (divide) or % (modulo) commands. The solution was to multiply the value by 128 (the sequence 28*8**), then write that result into the playfield. On a strictly standard interpreter, playfield cells are signed 8 bit values, so an odd number multiplied by 128 becomes truncated to -1 while an even number becomes 0.
The other trick was in reading the -1 or 0 back from the playfield without having access to the g (get) command. The workaround for this was to write the value into the middle of an existing string sequence (" "), then execute that sequence to push the enclosed value onto the stack. At that point, determining the oddness of the byte is a simple less-than-zero test.
One final aspect worth discussing is the output. In the false case, we reach the >$. sequence with just one value on the stack, so $ clears the stack making the . output a zero. In the true case, we follow the path 20`:>$.. Since two is greater than zero, the comparison pushes a one onto the stack, and the : makes a duplicate copy so the $ won't drop it before it gets output.

This may be late and new but it is already my favorite answer.

@WheatWizard I only just realised now why this answer has been getting so much attention. Thank you for the bounty!

CJam (11 bytes)
"r2":(~f&2b

Online demo
Stripping away the tricks to avoid odd bytes, this reduces to
q1f&2b

which reads the input, maps a bitwise AND with 1, and then performs a base conversion, giving zero iff all of the ANDs were zero.

This code is sad :(

Because it can only have half of the chars @betseg

Printable .COM file, 100 bytes
^FZjfDXVL\,LPXD$$4"PXD,lHPXDjJXDRDX@PXDjtXDH,nPXDj@XD4`@PXD,ZHPXD4,@PXD4:4"PXDH,\PXD4"PXD,hPXDRDX@P\

Hexdump:
00000000  5e 46 5a 6a 66 44 58 56  4c 5c 2c 4c 50 58 44 24  |^FZjfDXVL\,LPXD$|
00000010  24 34 22 50 58 44 2c 6c  48 50 58 44 6a 4a 58 44  |$4"PXD,lHPXDjJXD|
00000020  52 44 58 40 50 58 44 6a  74 58 44 48 2c 6e 50 58  |RDX@PXDjtXDH,nPX|
00000030  44 6a 40 58 44 34 60 40  50 58 44 2c 5a 48 50 58  |Dj@XD4`@PXD,ZHPX|
00000040  44 34 2c 40 50 58 44 34  3a 34 22 50 58 44 48 2c  |D4,@PXD4:4"PXDH,|
00000050  5c 50 58 44 34 22 50 58  44 2c 68 50 58 44 52 44  |\PXD4"PXD,hPXDRD|
00000060  58 40 50 5c                                       |X@P\|
00000064

Using a very loose definition of source as something that can be reasonably typed by a human, and inspired by EICAR Standard Antivirus Test File (more info at "Let's have fun with EICAR test file" at Bugtraq).
Using only printable non-odd ASCII bytes (side note: opcodes affecting words tend to be odd, the W bit is the lsb of some opcodes), it constructs a fragment of code at SP (which we conveniently set just past our generating code), and execution ends up falling through to the generated code.
It uses the fact that the stack initially contains a near pointer to the start of the PSP, and that the start of the PSP contains the INT 20h instruction (more info on this at https://stackoverflow.com/questions/12591673/).
Real source:
; we want to generate the following fragment of code

;  5E                pop si             ; zero SI (pop near pointer to start of PSP)
;  46                inc si             ; set SI to 1
; loop:
;  B406              mov ah,0x6         ; \
;  99                cwd                ; >
;  4A                dec dx             ; > D-2106--DLFF
;  CD21              int 0x21           ; > DIRECT CONSOLE INPUT
;  7405              jz end             ; > jump if no more input
;  40                inc ax             ; > lsb 0/1 odd/even
;  21C6              and si,ax          ; > zero SI on first odd byte
;  EBF3              jmp short loop     ; /
; end:
;  96                xchg ax,si         ; return code
;  B44C              mov ah,0x4c        ; D-214C
;  CD21              int 0x21           ; TERMINATE WITH RETURN CODE

 pop si             ; this two opcodes don't need to be encoded
 inc si

 pop dx             ; DX = 20CD (int 0x20 at start of PSP)
 push byte +0x66
 inc sp
 pop ax
 push si
 dec sp
 pop sp             ; SP = 0x0166
 sub al,0x4c        ; B4
 push ax
 pop ax
 inc sp
 and al,0x24
 xor al,0x22        ; 06
 push ax
 pop ax
 inc sp
 sub al,0x6c
 dec ax             ; 99
 push ax
 pop ax
 inc sp
 push byte +0x4a    ; 4A
 pop ax
 inc sp
 push dx            ; [20]CD
 inc sp
 pop ax
 inc ax             ; 21
 push ax
 pop ax
 inc sp
 push byte +0x74    ; 74
 pop ax
 inc sp
 dec ax
 sub al,0x6e        ; 05
 push ax
 pop ax
 inc sp
 push byte +0x40    ; 40
 pop ax
 inc sp
 xor al,0x60
 inc ax             ; 21
 push ax
 pop ax
 inc sp
 sub al,0x5a
 dec ax             ; C6
 push ax
 pop ax
 inc sp
 xor al,0x2c
 inc ax             ; EB
 push ax
 pop ax
 inc sp
 xor al,0x3a
 xor al,0x22        ; F3
 push ax
 pop ax
 inc sp
 dec ax
 sub al,0x5c        ; 96
 push ax
 pop ax
 inc sp
 xor al,0x22        ; B4
 push ax
 pop ax
 inc sp
 sub al,0x68        ; 4C
 push ax
 pop ax
 inc sp
 push dx            ; [20]CD
 inc sp
 pop ax
 inc ax
 push ax            ; 21
 pop sp             ; now get the stack out of the way

MATL, 7 bytes
l$Z$2\z

The source code uses UTF-8 encoding. So the source bytes are (in decimal)
108    36    90    36    50    92   122

The input is a file name, taken as a string enclosed in single quotes. The output is the number of odd bytes in the file, which is truthy iff nonzero.
Explanation
l    % Push a 1. We use `l` instead of `1` to have an even value
$    % Input specificication. This indicates that the next function takes 1 input
Z$   % Input file name implicitly, read its raw bytes and push them as an array of chars
2\   % Modulo 2
z    % Number of nonzero values. This gives the number of odd bytes. Implicitly display

CJam, 18 17 15 bytes
"<rj":(((*~:|X&

Assumes that the locale is set to Latin-1. Try it online!
How it works
The straightforward solution goes as follows.
q       e# Read all input from STDIN and push it as a string on the stack.
 :i     e# Cast each character to its code point.
   :|   e# Take the bitwise OR of all code points.
     X  e# Push 1.
      & e# Take the bitwise AND of the logical OR and 1.

Unfortunately, the characters q and i cannot appear in the source code. To work around this issue, we are going to create part of the above source code dynamically, then evaluate the string.
"<rj"         e# Push that string on the stack.
     :(       e# Decrement all characters, pushing ";qi".
       (      e# Shift out the first character, pushing "qi" and ';'.
        (     e# Decrement ';' to push ':'.
         *    e# Join "qi" with separator ':', pushing "q:i".
          ~   e# Evaluate the string "q:i", which behaves as explained before.

Pyth, 20 13 bytes
vj0>LhZ.BRj.z

Or in binary:
00000000: 01110110 01101010 00110000 00111110 01001100 01101000  vj0>Lh
00000006: 01011010 00101110 01000010 01010010 01101010 00101110  Z.BRj.
0000000c: 01111010                                               z

Try it online
How it works
           .z   all lines of input
          j     join on newline
       .BR      convert each character to binary
   >LhZ         take the last (0 + 1) characters of each binary string
 j0             join on 0
v               evaluate as an integer

The resulting integer is truthy (nonzero) iff any of the bytes were odd.

Jelly, 13 bytes
24‘ịØBvF|\ṪBṪ

Expects the input as a quoted command-line argument. Try it online!
Hexdump
0000000: 32 34 fc d8 12 42 76 46 7c 5c ce 42 ce           24...BvF|\.B.

If it was not for the odd byte restriction, this would equally work at 6 bytes: O%2¬Ạ¬.

Retina, 106 bytes
Removes every allowed character, then matches any remaining characters. Truthy values will be the number of characters found. Falsey values will be 0.
`"| |\$|&|\(|\*|,|\.|0|2|4|6|8|:|<|>|@|B|D|F|H|J|L|N|P|R|T|V|X|Z|\\|\^|`|b|d|f|h|j|l|n|p|r|t|v|x|z|\||~

.

Try it online
Since . doesn't match newlines by default, I don't have to remove them.

Perl 5 + -p0, 136 bytes
Similar to other answers, this removes all even bytes and leaves any odd bytes (which is truthy).
tr<
 "$&(*,.02468:<>@BDFHJLNPRTVXZ\\^`bdfhjlnprtvxz|~€‚„†ˆŠŒŽ’”–˜šœž ¢¤¦¨ª¬®°²´¶¸º¼¾ÀÂÄÆÈÊÌÎÐÒÔÖØÚÜÞàâäæèêìîðòôöøúüþ><>d

Try it online!

-0 does nothing to newlines. It only determines how to split up the input, it doesn't remove any characters.

Ouch that's too bad.

@ØrjanJohansen Yeah, you're right about -0, I wanted to do the whole block as a lump, but that shouldn't matter, but I can't get around this... Too bad! I'll clean up these comments. Thanks for the heads up though!

So it works now? Guess I should delete some of the comments. From the edit diff, I see you're now including every even byte in the program. I think you might want to say that explicitly, since not all those characters show up (for me at least).

@ØrjanJohansen yes! I think I've got it now. I don't think all other answers cover all even bytes either, I think a few only work on printable ASCII. I'm pretty confident this does what I wanted now. I hope so anyway!

Japt, 10 bytes
ø0ôH² ®dZÄ

Try it online!
Japt's codepage is ISO-8859-1. The code gives false when itself is entered as a string, therefore a valid submission.
Unpacked & How it works
Uø0ôHp2  mZ{ZdZ+1

Uø      Does input string contain any element in the following array...?
0ôHp2     Range of 0 to 32**2, inclusive
mZ{       Map...
ZdZ+1       Convert the number Z to a char having charcode 2*Z+1

Not having String.c (get charcode, or map over charcodes) was a pain, but fortunately there is Number.d (convert number to char).
Turns out that Japt wins over CJam, Pyth and Jelly :)

Without the restriction, there are a couple of ways to do it in 6 bytes (going par with CJam and Jelly again):
®c uÃn

Unpacked: UmZ{Zc u} n

UmZ{   Map on each char...
Zc u     Convert to charcode modulo 2
}
n      Convert the resulting string to number

"000..000" is converted to the number 0 (falsy) regardless of how long it is. On the other hand, anything that contains 1 is converted to a nonzero double, or Infinity if it's too big (both truthy).
¬d_c u

Unpacked: q dZ{Zc u

q    Convert to array of chars
dZ{  Is something true when mapped with...
Zc u   Convert each char to charcode modulo 2

More straightforward approach that directly yields true or false.
Or, 5 bytes solution is even possible with the help of -d flag:
¬®c u

Unpacked: q mZ{Zc u

q     Convert to array of chars
mZ{   Map...
Zc u    Convert to charcode modulo 2

      Result is array of zeros and ones
-d    Apply .some() on the resulting array