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.

A382746 If k appears, 8*k does not.

This page as a plain text file.
%I A382746 #35 May 31 2025 06:49:54
%S A382746 1,2,3,4,5,6,7,9,10,11,12,13,14,15,17,18,19,20,21,22,23,25,26,27,28,
%T A382746 29,30,31,33,34,35,36,37,38,39,41,42,43,44,45,46,47,49,50,51,52,53,54,
%U A382746 55,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,73,74,75,76,77,78,79
%N A382746 If k appears, 8*k does not.
%C A382746 Also: integers of the form 2^m*r, r odd, m congruent to 0, 1, 2 mod 6.
%C A382746 The asymptotic density of this sequence is 8/9. - _Amiram Eldar_, May 31 2025
%H A382746 Jan Snellman, <a href="/A382746/b382746.txt">Table of n, a(n) for n = 1..8889</a>
%H A382746 Jan Snellman, <a href="https://arxiv.org/abs/2504.02795">Greedy Regular Convolutions</a>, arXiv:2504.02795 [math.NT], 2025.
%e A382746 8, 16, ... , 56 are removed, but 8*8 = 64 remains.
%t A382746 Select[Range[100], Mod[IntegerExponent[#, 2], 6] < 3 &] (* _Amiram Eldar_, Apr 04 2025 *)
%o A382746 (Sage)
%o A382746 [_ for _ in range(1,100) if (valuation(_,2) % 6) < 3]
%o A382746 (Python)
%o A382746 from functools import lru_cache
%o A382746 @lru_cache(maxsize=None, typed=True)
%o A382746 def in_sieve(n, S):
%o A382746     if n == 1:
%o A382746         return True
%o A382746     elif n in S:
%o A382746         return False
%o A382746     else:
%o A382746         L = [s for s in S if (n % s) == 0]
%o A382746         return all(not in_sieve(n/ell, S) for ell in L )
%o A382746 def nth_in_sieve(n, S):
%o A382746     if n == 1:
%o A382746         return 1
%o A382746     else:
%o A382746         i, m = 1, 1
%o A382746         while i < n:
%o A382746             m = m+1
%o A382746             if in_sieve(m, S):
%o A382746                 i = i+1
%o A382746     return m
%o A382746 def a(n):
%o A382746     return nth_in_sieve(n, tuple([8]))
%o A382746 (Python)
%o A382746 def A382746(n):
%o A382746     def f(x): return n+x-sum((x>>m)+1>>1 for m in range(x.bit_length()+1) if m%6<3)
%o A382746     m, k = n, f(n)
%o A382746     while m != k: m, k = k, f(k)
%o A382746     return m # _Chai Wah Wu_, Apr 10 2025
%o A382746 (PARI) isok(k) = valuation(k, 2) % 6 < 3; \\ _Amiram Eldar_, May 31 2025
%Y A382746 Cf. A003159, A007417, A382744, A382745.
%K A382746 nonn,easy
%O A382746 1,2
%A A382746 _Jan Snellman_, Apr 04 2025