# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a297849 Showing 1-1 of 1 %I A297849 #8 Jan 24 2018 07:58:06 %S A297849 65,145,217,325,485,561,721,785,901,904,1025,1105,1157,1261,1281,1333, %T A297849 1445,1729,1765,1905,1937,2117,2305,2465,2501,2701,2705,3126,3201, %U A297849 3365,3421,3565,3601,3845,4033,4097,4369,4625,4901,5185,5777,5833,6085,6401,6499 %N A297849 Composites c where another composite d < c exists such that c and d satisfy c^(d-1) == 1 (mod d^2) and d^(c-1) == 1 (mod c) or satisfy c^(d-1) == 1 (mod d) and d^(c-1) == 1 (mod c^2). %C A297849 Are there any composites c where a composite d with d < c exists such that both c^(d-1) == 1 (mod d^2) and d^(c-1) == 1 (mod c^2)? %e A297849 The composites 8 and 65 satisfy the congruences 65^(8-1) == 1 (mod 8^2) and 8^(65-1) == 1 (mod 65), so 65 is a term of the sequence. %t A297849 With[{s = Select[Range@ 3000, CompositeQ]}, Select[s, Function[c, AnyTrue[Take[s, First@ FirstPosition[s, c]], Or[And[PowerMod[c, (# - 1), #^2] == 1, PowerMod[#, (c - 1), c] == 1], And[PowerMod[c, (# - 1), #] == 1, PowerMod[#, (c - 1), c^2] == 1]] &]]]] (* _Michael De Vlieger_, Jan 11 2018 *) %o A297849 (PARI) is(n) = forcomposite(c=1, n-1, if((Mod(n, c^2)^(c-1)==1 && Mod(c, n)^(n-1)==1) || (Mod(n, c)^(c-1)==1 && Mod(c, n^2)^(n-1)==1), return(1))); 0 %o A297849 forcomposite(c=1, , if(is(c), print1(c, ", "))) %Y A297849 Subsequence of A270574. %K A297849 nonn %O A297849 1,1 %A A297849 _Felix Fröhlich_, Jan 07 2018 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE