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.

A051883 a(n) is the smallest number such that the concatenation of a(1)a(2)a(3)...a(n) is divisible by n.

This page as a plain text file.
%I A051883 #26 Nov 07 2022 20:27:30
%S A051883 1,0,2,0,0,0,5,6,4,0,5,16,2,4,0,0,14,4,9,20,16,26,13,6,25,22,34,4,14,
%T A051883 0,17,28,42,22,20,24,31,44,36,0,15,24,2,8,20,36,8,16,32,50,35,6,47,58,
%U A051883 40,16,4,26,12,40,51,52,38,4,5,12,74,56,2,20,11,68,44,58,75,24,7,38,87,20
%N A051883 a(n) is the smallest number such that the concatenation of a(1)a(2)a(3)...a(n) is divisible by n.
%D A051883 A. Murthy, Exploring some new ideas on Smarandache type sets, functions and sequences, Smarandache Notions Journal Vol. 11, N 1-2-3 Spring 2000
%H A051883 Paul Tek, <a href="/A051883/b051883.txt">Table of n, a(n) for n = 1..10000</a>
%e A051883 For example the third term is 2 because 102 is divisible by 3.
%t A051883 nxt[{n_,c_,a_}]:=Module[{k=0},While[!Divisible[FromDigits[Flatten[ Join[ IntegerDigits[ c],IntegerDigits[ k]]]],n+1],k++];{n+1,FromDigits[ Flatten[ Join[IntegerDigits[c],IntegerDigits[k]]]],k}]; NestList[nxt,{1,1,1},80][[All,3]] (* _Harvey P. Dale_, Jul 17 2020 *)
%o A051883 (Haskell)
%o A051883 import Data.List (findIndex)
%o A051883 import Data.Maybe (fromJust)
%o A051883 a051883 n = a051883_list !! (n-1)
%o A051883 a051883_list = 1 : f 2 "1" where
%o A051883    f :: Integer -> String -> [Int]
%o A051883    f x zs = y : f (x + 1) (zs ++ show y) where
%o A051883      y = fromJust $ findIndex
%o A051883          ((== 0) . (`mod` x) . read . (zs ++)) $ map show [0..]
%o A051883 -- _Reinhard Zumkeller_, May 26 2013
%o A051883 (Python)
%o A051883 from itertools import count, islice
%o A051883 def agen():
%o A051883     b, an = 1, 1
%o A051883     for n in count(2):
%o A051883         yield an
%o A051883         b, pow10 = b*10, 10
%o A051883         r, an = b%n, 0
%o A051883         if r == 0: continue
%o A051883         for d in count(1):
%o A051883             an = (n - r)
%o A051883             while an < pow10//10: an += n
%o A051883             if an < pow10: break
%o A051883             b, pow10 = b*10, pow10*10
%o A051883             r = b%n
%o A051883         b += an
%o A051883 print(list(islice(agen(), 80))) # _Michael S. Branicky_, Nov 07 2022
%Y A051883 See A082399 for another version.
%Y A051883 Cf. A336399.
%K A051883 nonn,easy,nice,base
%O A051883 1,3
%A A051883 _Felice Russo_, Dec 15 1999
%E A051883 Expanded and corrected from the Murthy paper.
%E A051883 More terms from Michael Lugo (mlugo(AT)thelabelguy.com), Dec 22 1999
%E A051883 Further terms from _David Wasserman_, Mar 05 2002