%I #52 Feb 09 2024 01:42:19
%S 0,16,256,8208,65536,649800,1382400,4294967296
%N Numbers m such that m^2 + 1 divides 2^m - 1.
%C Contains 2^(2^k) = A001146(k) for k >= 2. - _Robert Israel_, Dec 02 2014
%C a(9) > 10^12. - _Hiroaki Yamanouchi_, Sep 16 2018
%C For each n, a(n)^2 + 1 belongs to A176997, and thus a(n) belongs to either A005574 or A135590. - _Max Alekseyev_, Feb 08 2024
%e 0 is in this sequence because 0^2 + 1 = 1 divides 2^0 - 1 = 1.
%p select(n -> (2 &^ n - 1) mod (n^2 + 1) = 0, [$1..10^6]); # _Robert Israel_, Dec 02 2014
%t a247165[n_Integer] := Select[Range[0, n], Divisible[2^# - 1, #^2 + 1] &]; a247165[1500000] (* _Michael De Vlieger_, Nov 30 2014 *)
%o (Magma) [n: n in [1..100000] | Denominator((2^n-1)/(n^2+1)) eq 1];
%o (PARI) for(n=0,10^9,if(Mod(2,n^2+1)^n==+1,print1(n,", "))); \\ _Joerg Arndt_, Nov 30 2014
%o (Python)
%o A247165_list = [n for n in range(10**6) if n == 0 or pow(2,n,n*n+1) == 1]
%o # _Chai Wah Wu_, Dec 04 2014
%Y Cf. A247219 (n^2 - 1 divides 2^n - 1), A247220 (n^2 + 1 divides 2^n + 1).
%Y Cf. A005574, A135590, A176997.
%K nonn,more
%O 1,2
%A _Juri-Stepan Gerasimov_, Nov 30 2014
%E a(8) from _Chai Wah Wu_, Dec 04 2014
%E Edited by _Jon E. Schoenfield_, Dec 06 2014