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.

A348317 a(n) = A348150(n) - A002275(n) where A002275(n) = R_n is the repunit with n times digit 1.

This page as a plain text file.
%I A348317 #22 Oct 15 2021 12:44:31
%S A348317 0,1,0,5,1,3,1,1,0,14,1,15,5,3,3,11,1,21,8,10,6,5,1,3,2,12,0,17,25,14,
%T A348317 5,13,6,74,1,54,41,12,8,14,4,105,41,55,63,33,25,13,5,103,3,33,40,63,3,
%U A348317 52,15,23,40,21,20,10,21,11,25,33,41,47,45,14,1,171
%N A348317 a(n) = A348150(n) - A002275(n) where A002275(n) = R_n is the repunit with n times digit 1.
%C A348317 a(n) measures the gap between the smallest n-digit number not containing the digit 0 and the smallest n-digit Niven number not containing the digit 0.
%C A348317 For more informations and links, see A348150.
%C A348317 a(n) = 0  iff n is in A014950.
%H A348317 Michael S. Branicky, <a href="/A348317/b348317.txt">Table of n, a(n) for n = 1..10000</a>
%F A348317 a(n) = A348150(n) - A002275(n).
%e A348317 A348150(4) = 1116 since it is the smallest 4-digit integer not containing the digit 0 that is divisible by the sum of its digits:1116 = (1+1+1+6) * 124;  A002275(4) = R_4 = 1111, hence a(4) = 1116 - 1111 = 5.
%t A348317 hQ[n_] := ! MemberQ[(d = IntegerDigits[n]), 0] && Divisible[n, Plus @@ d]; a[n_] := Module[{m= (10^n - 1)/9,k=0}, While[! hQ[m+k], k++]; k]; Array[a, 30] (* _Amiram Eldar_, Oct 13 2021 *)
%o A348317 (Python)
%o A348317 def a(n):
%o A348317     s, k = "1"*n, int("1"*n)
%o A348317     while '0' in s or k%sum(map(int, s)): k += 1; s = str(k)
%o A348317     return k - int("1"*n)
%o A348317 print([a(n) for n in range(1, 73)]) # _Michael S. Branicky_, Oct 12 2021
%o A348317 (PARI) a(n) = my(r=(10^n-1)/9); for(k=r, 10^n-1, if (vecmin(digits(k)) && !(k % sumdigits(k)), return (k-r))); \\ _Michel Marcus_, Oct 13 2021
%Y A348317 Cf. A002275, A005349, A014950, A217973, A348150.
%K A348317 nonn,base
%O A348317 1,4
%A A348317 _Bernard Schott_, Oct 12 2021
%E A348317 a(23) and beyond from _Michael S. Branicky_, Oct 12 2021