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.

A376045 Complement of A325112.

This page as a plain text file.
%I A376045 #17 Sep 10 2024 19:59:21
%S A376045 3,6,9,12,13,15,16,18,19,21,23,24,26,27,29,30,31,32,33,34,35,36,37,38,
%T A376045 39,42,43,45,46,48,49,51,53,54,56,57,59,60,61,62,63,64,65,66,67,68,69,
%U A376045 72,73,75,76,78,79,81,83,84,86,87,89,90,91,92,93,94,95,96,97,98,99,102,103,105,106,108
%N A376045 Complement of A325112.
%C A376045 Numbers missing from A325112.
%C A376045 Equivalently, numbers whose decimal expansion has a subsequence which is divisible by 3.
%H A376045 Chai Wah Wu, <a href="/A376045/b376045.txt">Table of n, a(n) for n = 1..10000</a>
%o A376045 (Python)
%o A376045 from itertools import combinations
%o A376045 def A376045(n):
%o A376045     def f(x):
%o A376045         c, l = 0, len(str(x))
%o A376045         for i in range(l):
%o A376045             k = 10**i
%o A376045             for j in (1,2,4,5,7,8):
%o A376045                 if j*k<=x:
%o A376045                     c += 1
%o A376045         for a in combinations((10**i for i in range(l)),2):
%o A376045             for b in ((1, 1), (1, 4), (1, 7), (2, 2), (2, 5), (2, 8), (4, 1), (4, 4), (4, 7), (5, 2), (5, 5), (5, 8), (7, 1), (7, 4), (7, 7), (8, 2), (8, 5), (8, 8)):
%o A376045                 if a[0]*b[0]+a[1]*b[1] <= x:
%o A376045                     c += 1
%o A376045         return n+c
%o A376045     m, k = n, f(n)
%o A376045     while m != k: m, k = k, f(k)
%o A376045     return m # _Chai Wah Wu_, Sep 10 2024
%Y A376045 Cf. A325112.
%K A376045 nonn,base
%O A376045 1,1
%A A376045 _N. J. A. Sloane_, Sep 09 2024