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.

A375969 Lexicographically earliest sequence of nonnegative integers with distinct digit averages.

This page as a plain text file.
%I A375969 #16 Sep 08 2024 21:41:10
%S A375969 0,1,2,3,4,5,6,7,8,9,10,12,14,16,18,29,49,69,89,100,101,103,104,106,
%T A375969 107,109,119,139,149,169,179,199,299,499,599,799,899,1000,1002,1004,
%U A375969 1006,1008,1019,1039,1059,1079,1099,1299,1499,1699,1899,2999,4999,6999
%N A375969 Lexicographically earliest sequence of nonnegative integers with distinct digit averages.
%C A375969 Equivalently, fixed points of A375968.
%C A375969 The sequence {A007953(a(n)) / A055642(a(n)), n > 0} runs uniquely through every rational number between 0 and 9.
%H A375969 Rémy Sigrist, <a href="/A375969/b375969.txt">Table of n, a(n) for n = 1..10459</a>
%H A375969 Rémy Sigrist, <a href="/A375969/a375969.gp.txt">PARI program</a>
%e A375969 The first terms, alongside the corresponding digit average, are:
%e A375969   n   a(n)  Digit average
%e A375969   --  ----  -------------
%e A375969    1     0              0
%e A375969    2     1              1
%e A375969    3     2              2
%e A375969    4     3              3
%e A375969    5     4              4
%e A375969    6     5              5
%e A375969    7     6              6
%e A375969    8     7              7
%e A375969    9     8              8
%e A375969   10     9              9
%e A375969   11    10            1/2
%e A375969   12    12            3/2
%e A375969   13    14            5/2
%e A375969   14    16            7/2
%e A375969   15    18            9/2
%t A375969 kmax=7000; avg={}; list={}; For[k=0, k<=kmax, k++,mn=Mean[IntegerDigits[k]]; If[!MemberQ[avg,mn], AppendTo[avg, mn]; AppendTo[list, k]]]; list (* _Stefano Spezia_, Sep 07 2024 *)
%o A375969 (PARI) avg(n, base = 10) = { my (d = digits(n, base)); vecsum(d) / max(1, #d) }
%o A375969 { V = Map(); k = 0; for (n = 0, 6999, v = avg(n); if (!mapisdefined(V, v), mapput(V, v, n); print1 (n", "););); }
%o A375969 (PARI) \\ See Links section.
%o A375969 (Python)
%o A375969 from math import gcd
%o A375969 from itertools import count, islice
%o A375969 def agen():
%o A375969     m = 0
%o A375969     yield 0
%o A375969     for w in count(1): # w = number of digits
%o A375969         for s in range(1, 9*w+1): # s = sum of digits
%o A375969             if gcd(s, w) == 1:
%o A375969                 d, r = [1] + [0 for _ in range(w-1)], s-1
%o A375969                 for k in range(w-1, -1, -1):
%o A375969                     d[k], r = d[k] + min(r, 9), r - min(r, 9)
%o A375969                 yield int("".join(map(str, d)))
%o A375969 print(list(islice(agen(), 54)))
%o A375969 # _Michael S. Branicky_, Sep 08 2024 after _Rémy Sigrist_ PARI in link
%Y A375969 Cf. A007953, A051885, A055642, A375968.
%K A375969 nonn,base
%O A375969 1,3
%A A375969 _Rémy Sigrist_, Sep 04 2024