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.

A282473 Multiples of 9 which cannot be expressed as the difference between a natural number k and its digit sum s(k).

This page as a plain text file.
%I A282473 #41 Nov 27 2019 11:27:27
%S A282473 90,189,288,387,486,585,684,783,882,981,990,1089,1188,1287,1386,1485,
%T A282473 1584,1683,1782,1881,1980,1989,2088,2187,2286,2385,2484,2583,2682,
%U A282473 2781,2880,2979,2988,3087,3186,3285,3384,3483,3582,3681,3780,3879,3978,3987,4086,4185,4284,4383,4482,4581,4680,4779,4878,4977,4986
%N A282473 Multiples of 9 which cannot be expressed as the difference between a natural number k and its digit sum s(k).
%C A282473 Based on empirical observations, it can be noted that the difference between consecutive terms is usually 99. However, this breaks down when the hundreds digit is 9, in which case the difference between consecutive terms is 9. This changes back, however.
%H A282473 Charles R Greathouse IV, <a href="/A282473/b282473.txt">Table of n, a(n) for n = 1..10000</a>
%H A282473 Brilliant.org, <a href="https://brilliant.org/problems/those-are-some-nifty-numbers/?ref_id=1322236">Those are some nifty numbers</a>
%H A282473 Australian Mathematics Olympiad, <a href="https://www.amt.edu.au/wp-content/uploads/2019/07/Australian-Scene-combined-2015-1.pdf">Question 2</a>, 2015, p. 84.
%e A282473 If k=90, then k-s(k)=81. If k=100, then k-s(k)=99. This is an increasing function, so k-s(k)=90 is unachievable.
%t A282473 okQ[n_] := Catch[ Do[ If[ x- Total@ IntegerDigits@ x == n, Throw@ False], {x, n, n+ 9 IntegerLength[n]}]; True]; Select[9 Range[1000], okQ[#] &] (* _Giovanni Resta_, Feb 27 2017 *)
%o A282473 (Python)
%o A282473 from math import ceil
%o A282473 def a(n): #Outputs all numbers less than n which are in the sequence
%o A282473     def s(n):
%o A282473         r = 0
%o A282473         while n:
%o A282473             r, n = r + n% 10, n//10
%o A282473         return r
%o A282473     mult9=[]
%o A282473     if n%9==0:
%o A282473         for x in range(1, ceil(n/9)+1):
%o A282473             mult9.append(9*x)
%o A282473     else:
%o A282473         for x in range(1, ceil(n/9)):
%o A282473             mult9.append(9*x)
%o A282473     for y in range(1, ceil(n/10)+1):
%o A282473         mult9.remove(10*y-s(10*y))
%o A282473     return mult9
%o A282473 (PARI) is(n)=for(k=n,n+9*#Str(n)+9, if(k-sumdigits(k)==n, return(0))); n%9==0 \\ _Charles R Greathouse IV_, Feb 27 2017
%Y A282473 Cf. A003052, A176995.
%K A282473 nonn,base,easy
%O A282473 1,1
%A A282473 _Sharvil Kesarwani_, Feb 16 2017