OFFSET
1,1
COMMENTS
There are 255 Carmichael numbers below 10^8 but only 6 of them have this property.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000 (terms 1..427 from Jon E. Schoenfield)
PROG
(Magma)
XOR := func<a, b | Seqint([ (adigs[i] + bdigs[i]) mod 2 : i in [1..n]], 2)
where adigs := Intseq(a, 2, n)
where bdigs := Intseq(b, 2, n)
where n := 1 + Ilog2(Max([a, b, 1]))>;
function IsClardynum(X, i)
if i eq 1 then
return true;
else
xornum:=2^i - 2;
xorcouple:=XOR(X, xornum);
if (IsPrime(xorcouple)) then
return false;
else
return IsClardynum(X, i-1);
end if;
end if;
end function;
function Korselt(X, n);
i:=1;
while IsDefined(X, i) do
b:=(n-1)mod(X[i]-1);
if (b ne 0) then return false;
else i:=i+1;
end if;
end while;
return true;
end function;
function IsCarmichael(n);
if IsPrime(n) then return false;
end if;
A:=AssociativeArray();
if IsSquarefree(n) then
A:=PrimeDivisors(n);
if Korselt(A, n) then return true;
else return false;
end if;
else
return false;
end if;
end function;
for i:=561 to 100000001 by 2 do
if IsCarmichael(i) then
if IsClardynum(i, Ilog2(i)) then i;
end if;
end if;
end for;
(PARI) isclardynum(k, i) = {if (i == 1, return(1)); my(xornum = 1<<i - 2, xorcouple = bitxor(k, xornum)); if(isprime(xorcouple), return(0), return(isclardynum(k, i-1))); }
iscarm(k) = k > 1 && k % 2 && !isprime(k) && k % lcm(znstar(k)[2]) == 1;
isok(k) = iscarm(k) && isclardynum(k, logint(k, 2)); \\ Amiram Eldar, Feb 07 2026
CROSSREFS
KEYWORD
nonn
AUTHOR
Brad Clardy, Apr 12 2012
EXTENSIONS
a(11)-a(19) by Brad Clardy, May 10 2014
More terms and b-file (using the Magma program by Brad Clardy and the b-file of Carmichael numbers from A002997) from Jon E. Schoenfield, May 10 2014
STATUS
approved
