login
A364722
Numbers k that divide 1 + 2^m + 4^m for some m.
2
1, 3, 7, 13, 19, 21, 37, 39, 49, 57, 61, 67, 73, 79, 91, 97, 103, 109, 111, 139, 147, 151, 163, 169, 181, 183, 193, 199, 201, 211, 219, 237, 241, 271, 273, 291, 307, 309, 313, 327, 331, 337, 343, 349, 361, 367, 373, 379, 409, 417, 421, 427, 433, 453, 463, 469, 487, 489, 507, 523, 541, 543, 547
OFFSET
1,2
COMMENTS
If k = 3*j+1 is prime and 2^j - 1 is not divisible by k, then k is a term, as 1 + 2^j + 4^j = (2^(k-1)-1)/(2^j - 1) == 0 (mod k). - Robert Israel, Aug 06 2023
LINKS
EXAMPLE
a(4) = 13 is a term because 1 + 2^4 + 4^4 = 273 = 21 * 13 is divisible by 13.
MAPLE
filter:= proc(n) local x, r;
for r in map(t -> subs(t, x), [msolve(1+x+x^2, n)]) do
try
NumberTheory:-ModularLog(r, 2, n);
catch "no solutions exist": next
end try;
return true
od;
false
end proc:
select(filter, [seq(i, i=1..1000, 2)]);
PROG
(Python)
from itertools import count, islice
from sympy import sqrt_mod_iter, discrete_log
def A364722_gen(startvalue=1): # generator of terms >= startvalue
if startvalue <= 1:
yield 1
if startvalue <= 3:
yield 3
for k in count(max(startvalue, 4)):
for d in (r>>1 for r in sqrt_mod_iter(-3, k) if r&1):
try:
discrete_log(k, d, 2)
except:
continue
yield k
break
A364722_list = list(islice(A364722_gen(), 20)) # Chai Wah Wu, May 02 2024
CROSSREFS
Subset of A034017. Cf. A364724.
Sequence in context: A034017 A034021 A216516 * A310260 A310261 A038978
KEYWORD
nonn
AUTHOR
Robert Israel, Aug 04 2023
STATUS
approved