[go: up one dir, main page]

login
Search: a138166 -id:a138166
     Sort: relevance | references | number | modified | created      Format: long | short | data
Numbers k with the property that the sum of the digits of k is a substring of k.
+10
20
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 109, 119, 129, 139, 149, 159, 169, 179, 189, 199, 200, 300, 400, 500, 600, 700, 800, 900, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 1000, 1009, 1018, 1027, 1036, 1045, 1054, 1063
OFFSET
1,3
LINKS
MATHEMATICA
sdssQ[n_]:=Module[{idn=IntegerDigits[n], s, len}, s=Total[idn]; len= IntegerLength[ s]; MemberQ[Partition[idn, len, 1], IntegerDigits[s]]]; Join[{0}, Select[Range[1100], sdssQ]] (* Harvey P. Dale, Jan 02 2013 *)
PROG
(Haskell)
import Data.List (isInfixOf)
a052018 n = a052018_list !! (n-1)
a052018_list = filter f [0..] where
f x = show (a007953 x) `isInfixOf` show x
-- Reinhard Zumkeller, Jun 18 2013
(Python)
loop = (str(n) for n in range(399))
print([int(n) for n in loop if str(sum(int(k) for k in n)) in n]) # Jonathan Frech, Jun 05 2017
KEYWORD
nonn,base
AUTHOR
Patrick De Geest, Nov 15 1999
STATUS
approved
Numbers containing in decimal representation their digital root.
+10
5
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 19, 20, 29, 30, 39, 40, 49, 50, 59, 60, 69, 70, 79, 80, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 109, 118, 127, 128, 136, 138, 145, 148, 154, 158, 163, 168, 172, 178, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 198, 199, 200
OFFSET
1,3
COMMENTS
Complement of A119247.
For terms u: all digital permutations of u form terms; u*10 and all insertions of 0 are terms; if v is another term, then the concatenations uv, vu are also terms, as well as all insertions of v in u; these properties allow the construction of all terms beginning with {d:1<=d<=9}. - Reinhard Zumkeller, May 19 2006
LINKS
Eric Weisstein's World of Mathematics, Digital Root
MATHEMATICA
d[n_] := IntegerDigits[n]; Select[Range[0, 200], MemberQ[d[#1], NestWhile[Total[d[#]] &, #1, # > 9 &]] &] (* Jayanta Basu, Jul 13 2013 *)
PROG
(Haskell)
a119246 n = a119246_list !! (n-1)
a119246_list =
filter (\x -> a010888 x `elem` a031298_row (fromInteger x)) [0..]
-- Reinhard Zumkeller, Dec 16 2013, Apr 14 2011
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Reinhard Zumkeller, May 10 2006
STATUS
approved
If n has decimal expansion abc...d, with k digits, let f(n) be obtained by deleting all k's from abc...d, closing up and deleting initial 0's; sequence gives n such that f(f(f(...(n)))) = 0 or empty.
+10
3
1, 12, 20, 21, 22, 123, 132, 133, 203, 213, 223, 230, 231, 232, 300, 301, 303, 312, 313, 320, 321, 322, 330, 331, 333, 1234, 1243, 1244, 1324, 1334, 1342, 1343, 1423, 1424, 1432, 1433, 1442, 1444, 2034, 2043, 2044, 2134, 2143, 2144, 2234
OFFSET
1,2
COMMENTS
The sequence has exactly 14174521 terms, 999999999 is the last and largest. - Reinhard Zumkeller, Jul 04 2012
LINKS
FORMULA
A054055(a(n)) = A055642(a(n)). - Reinhard Zumkeller, Jul 04 2012
EXAMPLE
If n=22 (2 digits), f(n) = empty. If n=230 (3 digits), f(n)=20, f(f(n))=0. If n=301 (3 digits), f(n)=1 (1 digit), f(f(n))=empty.
The last 12 terms are: 999999333, 999999900, 999999901, 999999909, 999999912, 999999919, 999999920, 999999921, 999999922, 999999990, 999999991, 999999999.
MATHEMATICA
zeroQ[n_] := FixedPoint[ Function[{k}, DeleteCases[id = IntegerDigits[k], Length[id]] // FromDigits[#, 10]&], n] == 0; Select[Range[10^4], zeroQ] (* Jean-François Alcover, Dec 10 2014 *)
PROG
(Haskell)
import Data.List ((\\))
a038528 n = a038528_list !! (n-1)
a038528_list = gen ([1], 1) where
gen (_, 10) = []
gen (ds, len)
| len `elem` ds && chi ds
= foldr (\u v -> u + 10*v) 0 ds : gen (succ (ds, len))
| otherwise = gen (succ (ds, len))
chi xs = null ys || ys /= xs && chi ys where
ys = tr $ filter (/= length xs) xs
tr zs = if null zs || last zs > 0 then zs else tr $ init zs
succ ([], len) = ([1], len + 1)
succ (d : ds, len)
| d < len = (head (dropWhile (<= d) a002024_list \\ ds) : ds, len)
| otherwise = (0 : ds', len') where (ds', len') = succ (ds, len)
-- Reinhard Zumkeller, Jul 04 2012
CROSSREFS
Cf. A038527.
Cf. A002024, A055642, A031298, subsequence of A138166.
KEYWORD
easy,fini,nonn,base,nice
STATUS
approved
Numbers containing their length in ternary representation.
+10
3
1, 5, 6, 7, 8, 9, 10, 11, 12, 21, 31, 36, 37, 38, 39, 40, 41, 42, 43, 44, 49, 58, 66, 67, 68, 76, 86, 95, 96, 97, 98, 104, 113, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149
OFFSET
1,2
LINKS
EXAMPLE
42 ->'1120', length = 4 ->'11', therefore 42 is a term;
420 ->'120120', length = 6 ->'20', therefore 420 is a term.
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Reinhard Zumkeller, Mar 03 2008
STATUS
approved
Numbers containing their length in binary representation.
+10
3
1, 2, 6, 7, 8, 9, 12, 20, 21, 22, 23, 26, 27, 29, 38, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 71, 78, 79, 87, 92, 93, 94, 95, 103, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130
OFFSET
1,2
LINKS
EXAMPLE
20 ->'10100', length = 5 ->'101', therefore 20 is a term;
200 ->'11001000', length = 8 ->'1000', therefore 200 is a term.
MATHEMATICA
lbrQ[n_]:=Module[{idn2=IntegerDigits[n, 2]}, SequenceCount[idn2, IntegerDigits[ Length[ idn2], 2]]>0]; Select[Range[200], lbrQ] (* The program uses the SequenceCount function from Mathematica version 10 *) (* Harvey P. Dale, Oct 07 2015 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Reinhard Zumkeller, Mar 03 2008
STATUS
approved

Search completed in 0.008 seconds