Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #43 Oct 05 2022 17:19:27
%S 1,5,13,29,37,61,73,157,181,193,277,313,397,421,457,541,561,613,661,
%T 673,733,757,877,997,1093,1153,1201,1213,1237,1289,1321,1381,1453,
%U 1621,1657,1753,1873,1905,1933,1993,2017,2137,2341,2473,2557,2593,2797,2857,2917
%N Numbers n such that 2^n == 2 (mod n*(n+1)).
%C a(17) = 561 is the first composite number in the sequence. - _Charles R Greathouse IV_, Sep 19 2012
%C Intersection of { A015919(n) } and { A192109(n)-1 }. - _Max Alekseyev_, Apr 22 2013
%H V. Raman and Charles R Greathouse IV, <a href="/A216822/b216822.txt">Table of n, a(n) for n = 1..10000</a> (first 2000 terms from V. Raman)
%H Mersenne Forum, <a href="http://mersenneforum.org/showthread.php?t=17198">Prime Conjecture</a>
%t Select[Range[1, 10000], Mod[2^# - 2, # (# + 1)] == 0 &] (* _T. D. Noe_, Sep 19 2012 *)
%t Join[{1},Select[Range[3000],PowerMod[2,#,#(#+1)]==2&]] (* _Harvey P. Dale_, Oct 05 2022 *)
%o (PARI) is(n)=Mod(2,n*(n+1))^n==2; \\ _Charles R Greathouse IV_, Sep 19 2012
%o (Python)
%o A216822_list = [n for n in range(1,10**6) if n == 1 or pow(2,n,n*(n+1)) == 2] # _Chai Wah Wu_, Mar 25 2021
%Y Cf. A069051 (prime n such that 2^n == 2 (mod n*(n-1))).
%Y Cf. A217466 (prime terms of the sequence).
%Y Cf. A217465 (composite terms of the sequence)
%K easy,nonn
%O 1,2
%A _V. Raman_, Sep 17 2012
%E a(1)=1 prepended by _Max Alekseyev_, Dec 29 2017