@cairdcoinheringaahing the formula for the nth triangular number can be described as $\frac{n(n+1)}{2}$, this can be simplified into $\frac{(k+0.5)(k-0.5)}{2}=\frac{k^2-0.25}{2}$ where $k$ is $n+0.5$. The Jelly program finds $k$ by doing $\sqrt{2*x+0.25}-0.5$ and then floors the result.
Hey, if I make a meta post that holds deleted posts from this OEIS answer-chaining, so people can at least see what someone spent 30 minutes on, would that be in line?
@cairdcoinheringaahing Only Leaky and Erik can grant me access, right?
CMC: Given a list and a positive integer, return all the combinations of the list with the length equal to the number. 1 ≤ integer ≤ length of the list
func bit_sum_parity(n: Int) -> Int {
var res = 0;
var test = n;
while test > 0 {
res ^= test%2;
test /= 2;
}
return res;
}
func A000028(n: Int) -> Int {
var res = 1;
var iter = n;
while iter > 0 {
var clone = res;
var p = 2;
var parity = 0;
while clone > 1 {
var count = 0;
while clone % p == 0 {
clone /= p;
count += 1;
}
parity ^= bit_sum_parity(n: count);
43. Swift, 702 bytes, A000028
func bit_sum_parity(n: Int) -> Int {
var res = 0;
var test = n;
while test > 0 {
res ^= test%2;
test /= 2;
}
return res;
}
func A000028(n: Int) -> Int {
var res = 1;
var iter = n;
while iter > 0 {
var clone ...
func bit_sum_parity(n: Int) -> Int {
var res = 0;
var test = n;
while test > 0 {
res ^= test%2;
test /= 2;
}
return res;
}
func A000028(n: Int) -> Int {
var res = 1;
var iter = n;
while iter > 0 {
var clone = res;
var p = 2;
var parity = 0;
while clone > 1 {
var count = 0;
while clone % p == 0 {
clone /= p;
count += 1;
}
parity ^= bit_sum_parity(n: count);
43. Swift, 651 bytes, A000028
func bit_sum_parity(n: Int) -> Int {
var res = 0;
var test = n;
while test > 0 {
res ^= test%2;
test /= 2;
}
return res;
}
func A000028(n: Int) -> Int {
var res = 1;
var iter = n;
while iter > 0 {
var clone ...
Dear comment section, how to say 9999999999. Today I learned how to do say 9999999999! I sang "9999999999"! That's all about how to do say 9999999999. Your faithful student, BlackCap. PS: FiM++
I gtg so, dc 10 10^1-p. bc print 10^10-1. Bash echo 9999999999. Carrot 9^*9 ><> '9999999999'>o<. Fission 2, R"9999999999". sed s/$/9999999999/. ///, 9999999999
@Downgoat I managed to solve the os is not defined issue earlier, you were missing a require('os');. Why it worked on other systems I have no idea, but after making the change and rebuilding, ./vsl -dast put me into this weird prompt thing I don't understand.