If I moved them 2 by 2, or 3 by 3, or 4 by 4, or 5 by 5, or 6 by 6, then there's always 1 left.
you'll need
B4X:
n(i-2) = nrstart mod (i*i)
I guess
If I moved them 2 by 2, or 3 by 3, or 4 by 4, or 5 by 5, or 6 by 6, then there's always 1 left.
n(i-2) = nrstart mod (i*i)
I don't think that the question is: "Can you create an algorithm and a project?".
(I hope it is not so)
... and I am too young to solve it writing a b4x project ?we are too old to do the math by our self. this is why we have b4x, to do the work for us ?
Both @Jorge M A and @ilan shouldn't the increment be done in steps of 7 since we know beforehand that precedings values won't be multiples of it?
We will test 301, 308, 315... instead of 301,302,303...308,309..315..
We could optimize further, but probably it will be negligible compared to mod operator.
I agree. I'd like to see the math formula that leads to 301 as the first valid result.
It's not a single formula directly deduced from the problem, but obtained as the solution of a set of equations. Just in case someone likes recreational mathsI agree. I'd like to see the math formula that leads to 301 as the first valid result.
For x=2 To 7
Log($"301 ${x} ${301 Mod (x*x)}"$)
Next
For x=2 To 7
Log($"61201 ${x} ${61201 Mod (x*x)}"$)
Next
301 2 1
301 3 4
301 4 13
301 5 1
301 6 13
301 7 7
61201 2 1
61201 3 1
61201 4 1
61201 5 1
61201 6 1
61201 7 0
I think it is a translation issue.why do I keep seeing 301 as the valid result? it isn't as I mentioned several times before.
I think it is a translation issue.
With "2 by 2" I understand "2 each time".
If we interpret if as "2 multiplied by 2", then you are right
this is what i also understood.
not divisor of 2,3,5Isn't it the original challenge?
find the smallest divisor of 7 which is not divisor of 2,3,4,5,6