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.

A162943 a(n) = 2^(1-A002321(n)).

This page as a plain text file.
%I A162943 #9 Mar 31 2021 03:01:38
%S A162943 1,2,4,4,8,4,8,8,8,4,8,8,16,8,4,4,8,8,16,16,8,4,8,8,8,4,4,4,8,16,32,
%T A162943 32,16,8,4,4,8,4,2,2,4,8,16,16,16,8,16,16,16,16,8,8,16,16,8,8,4,2,4,4,
%U A162943 8,4,4,4,2,4,8,8,4,8,16,16,32,16,16,16,8
%N A162943 a(n) = 2^(1-A002321(n)).
%o A162943 (Python)
%o A162943 from functools import lru_cache
%o A162943 @lru_cache(maxsize=None)
%o A162943 def A162943(n):
%o A162943     if n == 0:
%o A162943         return 2
%o A162943     c, j = n, 2
%o A162943     k1 = n//j
%o A162943     while k1 > 1:
%o A162943         j2 = n//k1 + 1
%o A162943         c += (j2-j)*(4-len(bin(A162943(k1))))
%o A162943         j, k1 = j2, n//j2
%o A162943     return 2**(1+c-j) # _Chai Wah Wu_, Mar 30 2021
%Y A162943 Cf. A002321, first column of A162944.
%K A162943 nonn
%O A162943 1,2
%A A162943 _Mats Granvik_, Jul 18 2009