cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-1 of 1 results.

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

Original entry on oeis.org

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

Views

Author

Robert Israel, Aug 04 2023

Keywords

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

Examples

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

Crossrefs

Subset of A034017. Cf. A364724.

Programs

  • 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)]);
  • 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
Showing 1-1 of 1 results.