OFFSET
1,2
COMMENTS
Since for some a < n, 2^a == 1 (mod n) (a consequence of Euler's Theorem), searching up to k=n is sufficient to determine whether an integer is in the sequence. - Michael B. Porter, Dec 06 2009
A195470(a(n)) > 0; A195610(n) gives the smallest k such that a(n) divides 2^k + 1. - Reinhard Zumkeller, Sep 21 2011
This sequence is the subset of odd integers > 1 as (2*n - 1) in A179480, such that the corresponding entry in A179480 is odd. Example: A179480(14) = 5, odd, with (2*14 - 1) = 27; and 5 is a term of this sequence. A014659 (odd and does not divide (2^k + 1) for any k >= 1) represents the subset of odd terms >1 corresponding to A179480 entries that are even. - Gary W. Adamson, Aug 20 2012
All prime factors of a(n) are in A091317. Sequence has asymptotic density 0. - Robert Israel, Aug 12 2014
This sequence, for m>2, is those m for which, for some e, (m-1)(2^e-1)/m is a term of A253608. Moreover, e(n) is 2*A195610(n) when m is a(n). - Donald M Davis, Jan 12 2018
From Wolfdieter Lang, Aug 22 2020: (Start)
LINKS
T. D. Noe, Table of n, a(n) for n = 1..1000
P. Moree, Appendix to V. Pless et al., Cyclic Self-Dual Z_4 Codes, Finite Fields Applic., vol. 3 pp. 48-69, 1997.
MAPLE
select(t -> [msolve(2^x+1, t)] <> [], [2*i+1 $ i=1..1000]); # Robert Israel, Aug 12 2014
MATHEMATICA
ok[n_] := Module[{k=0}, While[k<=n && Mod[2^k + 1, n] > 0, k++]; k<n]; Select[Range[265], ok] (* Jean-François Alcover, Apr 06 2011, after PARI prog *)
okQ[n_] := Module[{k = MultiplicativeOrder[2, n]}, EvenQ[k] && Mod[2^(k/2) + 1, n] == 0]; Join[{1, 2}, Select[Range[3, 265, 2], okQ]] (* T. D. Noe, Apr 06 2011 *)
PROG
(PARI) isA014657(n) = {local(r); r=0; for(k=0, n, if(Mod(2^k+1, n)==Mod(0, n), r=1)); r} \\ Michael B. Porter, Dec 06 2009
(Haskell)
import Data.List (findIndices)
a014657 n = a014657_list !! (n-1)
a014657_list = map (+ 1) $ findIndices (> 0) $ map a195470 [1..]
-- Reinhard Zumkeller, Sep 21 2011
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
EXTENSIONS
More terms from Henry Bottomley, May 19 2000
Extended and corrected by David W. Wilson, May 01 2001
STATUS
approved