A230495 a(n) is the minimal odd evil k, such that k^i, i=1,2,...,n, all are evil, and a(n)=0, if there is no such k.
3, 3, 3, 27, 287, 287, 287, 287, 783, 783, 783, 19099, 20249, 34391, 80577, 92589, 211183, 211183, 211183, 1995137, 4270443, 4270443, 4270443, 4270443, 17026791, 317108969, 317108969, 317108969, 979104339, 979104339, 6044000725, 21911775681, 21911775681, 26576734759
Offset: 1
Links
- Vladimir Shevelev, "Odious-evil stability" of integers, post to the SeqFan Mailing List, Oct 20 2013.
Programs
-
Mathematica
fQ[n_] := EvenQ[DigitCount[n, 2,1]]; a[n_] := Module[{k=3}, While[ LengthWhile[ Range[n], fQ[k^#] &] != n, k+=2]; k]; Array[a, 12] (* Amiram Eldar, Dec 10 2018 *)
-
PARI
isevil(n) = (hammingweight(n) % 2) == 0; \\ A000069 isok(k, n) = {if (!isevil(k), return (0)); for (i=1, n, if (!isevil(k^i), return (0));); return (1);} a(n) = {my(k=1); while(!isok(k,n), k += 2); k;}
Extensions
a(26) from Michel Marcus, Dec 10 2018
a(27)-a(34) from Amiram Eldar, Aug 03 2023
Comments