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.

A366962 Numbers whose difference between the largest and smallest digits is equal to 5.

This page as a plain text file.
%I A366962 #12 Nov 10 2023 12:28:09
%S A366962 16,27,38,49,50,61,72,83,94,105,116,126,136,146,150,156,161,162,163,
%T A366962 164,165,166,205,216,227,237,247,250,257,261,267,272,273,274,275,276,
%U A366962 277,305,316,327,338,348,350,358,361,368,372,378,383,384,385,386,387,388
%N A366962 Numbers whose difference between the largest and smallest digits is equal to 5.
%C A366962 The number of n-digit terms of this sequence is 29*6^(n-1) - 49*5^(n-1) + 5*4^n.
%t A366962 Select[Range[400],Max[d=IntegerDigits[#]]-Min[d]==5 &]
%o A366962 (Python)
%o A366962 def ok(n): return max(d:=list(map(int, str(n))))-min(d) == 5
%o A366962 print([k for k in range(400) if ok(k)]) # _Michael S. Branicky_, Oct 30 2023
%o A366962 (PARI) isok(n) = my(d=digits(n)); vecmax(d) - vecmin(d) == 5; \\ _Michel Marcus_, Nov 05 2023
%Y A366962 Cf. A037904.
%Y A366962 Cf. A010785 (difference = 0), A366958 (difference = 1), A366959 (difference = 2), A366960 (difference = 3), A366961 (difference = 4), A366963 (difference = 6), A366964 (difference = 7), A366965 (difference = 8), A366966 (difference = 9).
%K A366962 nonn,base,easy
%O A366962 1,1
%A A366962 _Stefano Spezia_, Oct 30 2023