cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A225506 -2-Knödel numbers.

This page as a plain text file.
%I A225506 #25 Feb 16 2025 08:33:19
%S A225506 4,6,8,10,12,24,28,30,70,88,130,238,510,754,868,910,1330,2068,2590,
%T A225506 2728,3304,4002,5110,5406,8554,8710,12958,15748,18430,20878,21238,
%U A225506 23902,24178,32422,39928,46870,49210,53590,55678,57358,62248,67858,70414,79378,88198,95038,95758,95788,102238,114478
%N A225506 -2-Knödel numbers.
%C A225506 Extension of k-Knödel numbers to k negative, in this case equal to -2. Composite numbers n > 0 such that if 1 < a < n and gcd(n,a) = 1 then a^(n+2) = 1 mod n.
%C A225506 All terms are even numbers.
%H A225506 Gheorghe Coserea, <a href="/A225506/b225506.txt">Table of n, a(n) for n = 1..1000</a>
%H A225506 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/KnoedelNumbers.html">Knödel Numbers</a>
%p A225506 with(numtheory); ListA225506:=proc(q,k) local a,n,ok;
%p A225506 for n from 2 to q do if not isprime(n) then ok:=1; for a from 1 to n do
%p A225506 if gcd(a,n)=1 then if (a^(n-k)-1) mod n<>0 then ok:=0; break; fi; fi;
%p A225506 od; if ok=1 then print(n); fi; fi; od; end: ListA225506(10^6,-2);
%t A225506 Select[Range[10000], CompositeQ[#] && Divisible[# + 2, CarmichaelLambda[#]] &] (* _Amiram Eldar_, Mar 28 2019 *)
%o A225506 (PARI)
%o A225506 is(n) = forprime(p=3, n, if (n%p != 0 && Mod(p,n)^(n+2) != 1, return(0))); 1;
%o A225506 seq(N) = {
%o A225506   my(a=vector(N), k=0, n=4);
%o A225506   while(k < N, if(is(n), a[k++] = n); n += 2);
%o A225506   a;
%o A225506 };
%o A225506 seq(50) \\ _Gheorghe Coserea_, Dec 23 2018
%Y A225506 Cf. A208728.
%Y A225506 Cf. A225507, A225508, A225509, A225510, A225511, A225512, A225513, A225514.
%K A225506 nonn
%O A225506 1,1
%A A225506 _Paolo P. Lava_, May 09 2013
%E A225506 More terms from _Gheorghe Coserea_, Dec 23 2018