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.

A366961 Numbers whose difference between the largest and smallest digits is equal to 4.

This page as a plain text file.
%I A366961 #15 Nov 10 2023 12:28:06
%S A366961 15,26,37,40,48,51,59,62,73,84,95,104,115,125,135,140,145,151,152,153,
%T A366961 154,155,204,215,226,236,240,246,251,256,262,263,264,265,266,304,315,
%U A366961 326,337,340,347,351,357,362,367,373,374,375,376,377,400,401,402,403,404,410
%N A366961 Numbers whose difference between the largest and smallest digits is equal to 4.
%C A366961 The number of n-digit terms is 29*5^(n-1) - 47*4^(n-1) + 2*3^(n+1).
%t A366961 Select[Range[410],Max[d=IntegerDigits[#]]-Min[d]==4 &]
%o A366961 (Python)
%o A366961 def ok(n): return max(d:=list(map(int, str(n))))-min(d) == 4
%o A366961 print([k for k in range(411) if ok(k)]) # _Michael S. Branicky_, Oct 30 2023
%o A366961 (PARI) isok(n) = my(d=digits(n)); vecmax(d) - vecmin(d) == 4; \\ _Michel Marcus_, Nov 05 2023
%Y A366961 Cf. A037904.
%Y A366961 Cf. A010785 (difference = 0), A366958 (difference = 1), A366959 (difference = 2), A366960 (difference = 3), A366962 (difference = 5), A366963 (difference = 6), A366964 (difference = 7), A366965 (difference = 8), A366966 (difference = 9).
%K A366961 nonn,base,easy
%O A366961 1,1
%A A366961 _Stefano Spezia_, Oct 30 2023