login
a(n) = 2^n - (2^(n-1) mod n), where "mod" is the nonnegative remainder operator.
1

%I #33 Jun 08 2024 12:49:44

%S 2,4,7,16,31,62,127,256,508,1022,2047,4088,8191,16382,32764,65536,

%T 131071,262130,524287,1048568,2097148,4194302,8388607,16777208,

%U 33554416,67108862,134217715,268435448,536870911,1073741822,2147483647,4294967296,8589934588

%N a(n) = 2^n - (2^(n-1) mod n), where "mod" is the nonnegative remainder operator.

%C _Thomas Ordowski_ (private communication) observes that a(n) appears to be composite whenever n is composite. Is there any prime a(n) for composite n ?

%C Conjecture: for n > 2, a(n) is prime if and only if n is in A000043. Note that a(n) = 2^n - 1 if and only if n is an odd prime or pseudoprime to base 2 (A001567), so a counterexample cannot be a Fermat pseudoprime to base 2. - _Thomas Ordowski_, Oct 14 2018

%H Harvey P. Dale, <a href="/A320465/b320465.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = 2^(n-1) + n*floor(2^(n-1)/n). (Due to _Thomas Ordowski_).

%F For k >= 0, a(2^k) = 2^(2^k) = A001146(k). For n > 1, a(prime(n)) = 2^prime(n) - 1 = A001348(n). If p is an odd prime, then a(2p) = 4^p - 2. - _Thomas Ordowski_, Oct 14 2018

%F a(n) = 2^n - 1 = A000225(n) for n in A065091 U A001567 (odd prime or pseudoprime to base 2 = Sarrus or Poulet number).

%t Table[2^n-PowerMod[2,n-1,n],{n,40}] (* _Harvey P. Dale_, Jun 08 2024 *)

%o (PARI) A320465(n)=2^n-2^(n-1)%n

%Y A001146 is a subsequence.

%Y Cf. A000043, A001348 (the Mersenne numbers > 3 are a subsequence).

%Y Cf. A000225, A065091, A001567.

%K nonn

%O 1,1

%A _M. F. Hasler_, Oct 13 2018