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.

A364724 a(n) is the least k such that 1^k + 2^k + 4^k is divisible by A364722(n).

Original entry on oeis.org

0, 0, 1, 4, 6, 2, 12, 4, 7, 6, 20, 22, 3, 13, 4, 16, 17, 12, 12, 46, 14, 5, 54, 52, 60, 20, 32, 33, 22, 70, 6, 26, 8, 45, 4, 16, 34, 34, 52, 12, 10, 7, 49, 116, 114, 61, 124, 126, 68, 46, 140, 20, 24, 10, 77, 22, 81, 54, 52, 174, 180, 60, 182, 13, 38, 48, 32, 66, 101, 204, 206, 15, 70, 28, 220
Offset: 1

Views

Author

Robert Israel, Aug 04 2023

Keywords

Comments

a(n) is the least k such that 1^k + 2^k + 4^k is divisible by the n-th number for which such k exists.

Examples

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

Crossrefs

Programs

  • Maple
    f:= proc(n) local R,r,m,v;
       R:= map(t -> subs(t,x), [msolve(1+x+x^2, n)]);
       m:= infinity;
       for r in R do
         try
         v:= NumberTheory:-ModularLog(r,2,n);
         catch "no solutions exist": next
         end try;
         m:= min(m,v)
       od;
       subs(infinity=NULL,m);
    end proc:
    map(f, [seq(i,i=1..1000,2)]);
  • Python
    from itertools import count, islice
    from sympy import sqrt_mod_iter, discrete_log
    def A364724_gen(): # generator of terms
        yield 0
        for k in count(2):
            m = None
            for d in sqrt_mod_iter(-3,k):
                r = d>>1 if d&1 else d+k>>1
                try:
                    m = discrete_log(k,r,2) if m is None else min(m,discrete_log(k,r,2))
                except:
                    continue
            if m is not None: yield m
    A364724_list = list(islice(A364724_gen(),30))
Showing 1-1 of 1 results.