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.

A102491 Numbers whose base-20 representation can be written with decimal digits.

This page as a plain text file.
%I A102491 #34 Feb 16 2025 08:32:55
%S A102491 0,1,2,3,4,5,6,7,8,9,20,21,22,23,24,25,26,27,28,29,40,41,42,43,44,45,
%T A102491 46,47,48,49,60,61,62,63,64,65,66,67,68,69,80,81,82,83,84,85,86,87,88,
%U A102491 89,100,101,102,103,104,105,106,107,108,109,120,121,122,123,124,125,126
%N A102491 Numbers whose base-20 representation can be written with decimal digits.
%C A102491 a(n) = A118761(n) for n<=50. - _Reinhard Zumkeller_, May 01 2006
%H A102491 Reinhard Zumkeller, <a href="/A102491/b102491.txt">Table of n, a(n) for n = 1..10000</a>
%H A102491 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Vigesimal.html">Vigesimal</a>
%H A102491 Wikipedia, <a href="http://en.wikipedia.org/wiki/Vigesimal">Vigesimal</a>
%F A102491 From _Peter Bala_, Dec 01 2016: (Start)
%F A102491 If n = Sum_{i = 0..m} d(i)*10^i is the decimal expansion of n then a(n+1) = Sum_{i = 0..m} d(i)*20^i.
%F A102491 a(n+1) = n + 1/2*Sum_{k >= 1} 20^k*floor(n/10^k). Cf. A037454, A037462 and A007091.
%F A102491 a(1) = 0; a(n+1) = 20*a(n/10+1) if n == 0 (mod 10) else a(n+1) = a(n) + 1. (End)
%F A102491 G.f. g(x) satisfies g(x) = 20*Sum_{1<=k<=9} x^k*g(x^10)/x^9 + Sum_{1<=k<=9} k*x^(k+1)/(1-x^10). - _Robert Israel_, Dec 01 2016
%p A102491 seq(n + (1/2)*add(20^k*floor(n/10^k), k = 1..floor(ln(n)/ln(10))), n = 1..100); # _Peter Bala_, Dec 01 2016
%t A102491 Select[Range@ 126, Total@ Take[Most@ DigitCount[#, 20], -10] == 0 &] (* _Michael De Vlieger_, Apr 09 2016 *)
%o A102491 (Haskell)
%o A102491 import Data.List (unfoldr)
%o A102491 a102491 n = a102491_list !! (n-1)
%o A102491 a102491_list = filter (all (<= 9) . unfoldr
%o A102491    (\x -> if x == 0 then Nothing else Just $ swap $ divMod x 20)) [0..]
%o A102491 -- _Reinhard Zumkeller_, Jun 27 2013
%o A102491 (Python)
%o A102491 A102491_list = [int(str(x), 20) for x in range(10**6)] # _Chai Wah Wu_, Apr 09 2016
%o A102491 (PARI) isok(n) = (n==0) || ((d=digits(n, 20)) && (vecmax(d) < 10)); \\ _Michel Marcus_, Apr 09 2016
%o A102491 (PARI) a(n) = fromdigits(digits(n-1),20) \\ _Ruud H.G. van Tol_, Dec 08 2022
%Y A102491 Complement of A102492; Cf. A102487, A102489, A102493. Cf. A037454, A037462, A007091.
%K A102491 nonn,base,easy
%O A102491 1,3
%A A102491 _Reinhard Zumkeller_, Jan 12 2005