This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x2 | |
x1 | |
k1 | |
(x2 + x1) | |
(x2 + k1) | |
(k1 * k1) | |
(k1 * x1) | |
(k1 * x2) | |
(k1 + k1) | |
(k1 + x1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
func dupes(nums:[Int])-> Int { | |
return nums.count - Set(nums).count | |
} | |
func r10k() -> Int {Int.random(in: 1...10000)} | |
struct Solution { | |
let v:[Int] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// KickInterpreter.swift | |
// Kick | |
// | |
// Created by Bill Tozier on 10/7/21. | |
// | |
import Foundation |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{36369/3601 2, 3863/2839 2, 3845/2821 2, 3821/2797 2, 3693/2669 2, 3641/2617 2, 3639/2615 2, 3633/2609 2, 3623/2599 2, 3615/2591 2, 3473/2449 2, 3453/2429 2, 3211/2187 4, 3185/2161 2, 3081/2057 2, 2001/977 2, 1997/973 2, 1985/961 2, 1967/943 2, 1953/929 2, 1947/923 4, 1937/913 2, 1933/909 2, 1927/903 2, 1913/889 2, 1909/885 2, 1889/865 2, 1881/857 2, 1869/845 2, 1867/843 2, 1821/797 2, 1819/795 4, 1811/787 2, 1793/769 2, 1723/699 4, 1719/695 6, 1717/693 2, 1683/659 2, 1645/621 2, 1635/611 2, 1633/609 2, 1625/601 2, 1617/593 2, 1597/573 2, 1595/571 2, 1593/569 2, 1589/565 2, 1583/559 2, 1575/551 2, 1555/531 2, 1519/495 2, 1517/493 2, 1511/487 2, 1505/481 2, 1499/475 2, 1493/469 4, 1491/467 2, 1487/463 2, 1485/461 4, 1483/459 6, 1477/453 4, 1471/447 2, 1455/431 4, 1445/421 4, 1443/419 2, 1441/417 2, 1439/415 2, 1437/413 2, 1435/411 4, 1425/401 6, 1419/395 4, 1415/391 2, 1413/389 2, 1411/387 2, 1389/365 4, 1383/359 4, 1373/349 4, 1369/345 2, 1363/339 4, 1361/337 2, 1355/331 4, 1353/329 4, 1351/327 2, 1347/323 4, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# see http://oeis.org/A051362 | |
require "prime" | |
def subprimes(number) | |
digits = number.digits.reverse | |
digits.collect.with_index do |d,idx| | |
subset = digits.dup | |
subset.delete_at(idx) | |
subset.join.to_i.prime? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pp' | |
require 'prime' | |
# for integer p in the given range, find the smallest integer q such that p*q is a pandigital number (has at least one of every digit) | |
p_range = (1..10) | |
@digits = (0..9).to_a.collect {|d| d.to_s} | |
def pandigital?(number) | |
number.to_s.chars.uniq.sort == @digits |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clojush.core=> (trace-push fingers [33] 1000) | |
State after 0 steps: | |
:exec = ((in1 exec_do*while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)))))) | |
:code = nil | |
:integer = nil | |
:boolean = nil | |
:char = nil | |
:string = nil | |
:input = (33) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clojush.core=> (trace-push fingers [6] 1000) | |
State after 0 steps: | |
;; the program | |
:exec = ((in1 exec_do*while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)))))) | |
:code = nil | |
:integer = nil | |
:boolean = nil | |
:char = nil | |
:string = nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clojush.core=> (trace-push fingers [3] 1000) | |
State after 0 steps: | |
;; program on :exec | |
:exec = ((in1 exec_do*while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)))))) | |
:code = nil | |
:integer = nil | |
:boolean = nil | |
:char = nil | |
:string = nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clojush.core=> (trace-push fingers [14] 1000) | |
State after 0 steps: | |
;; program pushed to :exec | |
:exec = ((in1 exec_do*while (exec_do*count (exec_do*count (in1 "buzz" exec_yankdup) integer_div exec_when "fizz" string_take integer_yankdup boolean_frominteger string_take string_dup integer_stackdepth exec_yankdup exec_y integer_sub string_take exec_do*times (integer_lte exec_while ("fizz" "buzz" string_concat exec_flush)))))) | |
:code = nil | |
:integer = nil | |
:boolean = nil | |
:char = nil | |
:string = nil |
NewerOlder