A195470 Number of numbers k with 0 <= k < n such that 2^k + 1 is multiple of n.
1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 2, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 1, 0, 1, 0, 0, 0, 5, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0
Offset: 1
Keywords
Examples
a(1)=#{0}=1, (2^0 + 1) mod 1; a(17) = #{4, 12} = 2, (2^4 + 1) mod 17 = (2^12 + 1) mod 17 = 0; a(18) = #{} = 0; a(19) = #{9} = 1, (2^9 + 1) mod 19 = 0.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Programs
-
Haskell
a195470 n = length $ filter ((== 0) . (`mod` n)) $ take (fromInteger n) a000051_list
-
Mathematica
nn = 100; pwrs = 2^Range[0, nn] + 1; Table[cnt = 0; Do[If[Mod[pwrs[[i]], n] == 0, cnt++], {i, n}]; cnt, {n, nn}] (* T. D. Noe, Sep 30 2011 *)
Comments