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.

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

This page as a plain text file.
%I A364724 #12 May 02 2024 14:29:33
%S A364724 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,
%T A364724 33,22,70,6,26,8,45,4,16,34,34,52,12,10,7,49,116,114,61,124,126,68,46,
%U A364724 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
%N A364724 a(n) is the least k such that 1^k + 2^k + 4^k is divisible by A364722(n).
%C A364724 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.
%H A364724 Robert Israel, <a href="/A364724/b364724.txt">Table of n, a(n) for n = 1..10000</a>
%e A364724 a(4) = 4 because A364722(4) = 13 and 1 + 2^4 + 4^4 = 273 = 21 * 13 is divisible by 13.
%p A364724 f:= proc(n) local R,r,m,v;
%p A364724    R:= map(t -> subs(t,x), [msolve(1+x+x^2, n)]);
%p A364724    m:= infinity;
%p A364724    for r in R do
%p A364724      try
%p A364724      v:= NumberTheory:-ModularLog(r,2,n);
%p A364724      catch "no solutions exist": next
%p A364724      end try;
%p A364724      m:= min(m,v)
%p A364724    od;
%p A364724    subs(infinity=NULL,m);
%p A364724 end proc:
%p A364724 map(f, [seq(i,i=1..1000,2)]);
%o A364724 (Python)
%o A364724 from itertools import count, islice
%o A364724 from sympy import sqrt_mod_iter, discrete_log
%o A364724 def A364724_gen(): # generator of terms
%o A364724     yield 0
%o A364724     for k in count(2):
%o A364724         m = None
%o A364724         for d in sqrt_mod_iter(-3,k):
%o A364724             r = d>>1 if d&1 else d+k>>1
%o A364724             try:
%o A364724                 m = discrete_log(k,r,2) if m is None else min(m,discrete_log(k,r,2))
%o A364724             except:
%o A364724                 continue
%o A364724         if m is not None: yield m
%o A364724 A364724_list = list(islice(A364724_gen(),30))
%Y A364724 Cf. A001576, A364722.
%K A364724 nonn,look
%O A364724 1,4
%A A364724 _Robert Israel_, Aug 04 2023