%I #79 Aug 14 2024 09:50:18
%S 9,15,21,33,39,51,57,63,69,87,93,111,123,129,141,159,177,183,195,201,
%T 213,219,237,249,267,291,303,309,315,321,327,339,381,393,399,411,417,
%U 447,453,471,489,501,519,537,543,573,579,591,597,633,669,681,687,693,699,717,723,753,771,789,807,813,819
%N 3-Knödel numbers or D-numbers: numbers m > 3 such that m | k^(m-2)-k for all k with gcd(k, m) = 1.
%C From _Max Alekseyev_, Oct 03 2016: (Start)
%C Also, composite numbers m such that A000010(p^k)=(p-1)*p^(k-1) divides m-3 for every prime power p^k dividing m (cf. A002997).
%C Properties: (i) All terms are odd. (ii) A prime power p^k with k>1 may divide a term only if p=3 and k=2. (iii) Many terms are divisible by 3. The first term not divisible by 3 is a(2000) = 50963 (cf. A277344). (End)
%C All terms satisfy the congruence 2^m == 8 (mod m) and thus belong to A015922. Sequence a(n)/3 is nearly identical to A106317, which does not contain the terms 399/3 = 133 and 195/3 = 65. - _Gary Detlefs_, May 28 2014; corrected by _Max Alekseyev_, Oct 03 2016
%C Numbers m > 3 such that A002322(m) divides m-3. - _Thomas Ordowski_, Jul 15 2017
%C Called "D numbers" by Morrow (1951), in analogy to Carmichael numbers (A002997) that were also known then as "F numbers". Called "C_3 numbers" (and in general "C_k numbers") by Knödel (1953). Makowski (1962/63) proved that there are infinitely many k-Knödel numbers for all k >= 2. The 1-Knödel numbers are the Carmichael numbers (A002997). - _Amiram Eldar_, Mar 25 2024, Apr 21 2024
%D A. Makowski, Generalization of Morrow's D-Numbers, Bull. Belg. Math. Soc. Simon Stevin, Vol. 36 (1962/63), p. 71.
%D Paulo Ribenboim, The Little Book of Bigger Primes, 2nd ed., Springer, 2004, pp. 102-103.
%H Michael De Vlieger, <a href="/A033553/b033553.txt">Table of n, a(n) for n = 1..10000</a> (First 489 terms from R. J. Mathar).
%H John H. Castillo and Jhony Fernando Caranguay Mainguez, <a href="https://doi.org/10.2140/involve.2022.15.367">The set of k-units modulo n</a>, Involve, a Journal of Mathematics, Vol. 15, No. 3 (2022), pp. 367-378; <a href="https://arxiv.org/abs/1708.06812">arXiv preprint</a>, arXiv:1708.06812 [math.NT], 2017.
%H Walter Knödel, <a href="https://doi.org/10.1002/mana.19530090603">Carmichaelsche Zahlen</a>, Math. Nachr., Vol. 9 (1953), pp. 343-350.
%H D. C. Morrow, <a href="http://www.jstor.org/stable/2307722">Some Properties of D Numbers</a>, The American Mathematical Monthly, Vol. 58, No. 5 (1951), pp. 329-330.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/D-Number.html">D-Number</a>.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/KnoedelNumbers.html">Knödel Numbers</a>.
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Kn%C3%B6del_number">Knödel number</a>.
%p isKnodel := proc(n,k)
%p local a;
%p for a from 1 to n do
%p if igcd(a,n) = 1 then
%p if modp(a&^(n-k),n) <> 1 then
%p return false;
%p end if;
%p end if;
%p end do:
%p return true;
%p end proc:
%p isA033553 := proc(n)
%p isKnodel(n,3) ;
%p end proc:
%p A033553 := proc(n)
%p option remember;
%p if n = 1 then
%p return 9;
%p else
%p for a from procname(n-1)+1 do
%p if isprime(a) then
%p next;
%p end if;
%p if isA033553(a) then
%p return a;
%p end if;
%p end do:
%p end if;
%p end proc:
%p seq(A033553(n),n=1..100) ; # _R. J. Mathar_, Aug 14 2024
%t Select[Range[4, 10^3], Divisible[# - 3, CarmichaelLambda[#]] &] (* _Michael De Vlieger_, Jul 15 2017 *)
%o (PARI) { isA033553(n) = my(p=factor(n)); for(i=1,matsize(p)[1], if( (n-3)%eulerphi(p[i,1]^p[i,2]), return(0)); ); 1; } \\ _Max Alekseyev_, Oct 04 2016
%Y Cf. A002997, A050990, A050992, A050993, A208154, A208155, A208156, A208157, A208158, A277344.
%K nonn
%O 1,1
%A _David W. Wilson_
%E Edited by _N. J. A. Sloane_, May 07 2007