login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A364722 Numbers k that divide 1 + 2^m + 4^m for some m. 2

%I #15 May 02 2024 14:29:19

%S 1,3,7,13,19,21,37,39,49,57,61,67,73,79,91,97,103,109,111,139,147,151,

%T 163,169,181,183,193,199,201,211,219,237,241,271,273,291,307,309,313,

%U 327,331,337,343,349,361,367,373,379,409,417,421,427,433,453,463,469,487,489,507,523,541,543,547

%N Numbers k that divide 1 + 2^m + 4^m for some m.

%C 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

%H Robert Israel, <a href="/A364722/b364722.txt">Table of n, a(n) for n = 1..10000</a>

%e a(4) = 13 is a term because 1 + 2^4 + 4^4 = 273 = 21 * 13 is divisible by 13.

%p filter:= proc(n) local x, r;

%p for r in map(t -> subs(t,x), [msolve(1+x+x^2, n)]) do

%p try

%p NumberTheory:-ModularLog(r,2,n);

%p catch "no solutions exist": next

%p end try;

%p return true

%p od;

%p false

%p end proc:

%p select(filter, [seq(i,i=1..1000,2)]);

%o (Python)

%o from itertools import count, islice

%o from sympy import sqrt_mod_iter, discrete_log

%o def A364722_gen(startvalue=1): # generator of terms >= startvalue

%o if startvalue <= 1:

%o yield 1

%o if startvalue <= 3:

%o yield 3

%o for k in count(max(startvalue,4)):

%o for d in (r>>1 for r in sqrt_mod_iter(-3,k) if r&1):

%o try:

%o discrete_log(k,d,2)

%o except:

%o continue

%o yield k

%o break

%o A364722_list = list(islice(A364722_gen(),20)) # _Chai Wah Wu_, May 02 2024

%Y Subset of A034017. Cf. A364724.

%K nonn

%O 1,2

%A _Robert Israel_, Aug 04 2023

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 18 10:00 EDT 2024. Contains 374378 sequences. (Running on oeis4.)