Displaying 1-10 of 26 results found.
10, 15, 40, 43, 52, 58, 66, 111, 114, 136, 170, 171, 196, 215, 271, 286, 383, 519, 571, 611, 756, 758, 809, 1651, 1889, 2234, 2560, 2750, 3153, 5078, 5126, 5876, 6075, 6382, 6472, 8531, 8876, 9112, 9598, 14847, 17085, 17300, 17700, 20964, 26478, 28019, 28459, 28964, 32407, 32804
EXAMPLE
10 is in the sequence as A030000(0) = 10.
15 is the next term after 10 as the next record in A030000 occurs at k = 7 and A030000(7) = 15. (End)
MATHEMATICA
d2k[k_] := d2k[k] = IntegerString[2^k];
A030000[n_] := Block[{d = IntegerString[n], k = -1}, While[StringFreeQ[d2k[++k], d]]; k];
Block[{upto = 10000, n = -1, a, r = -1}, Reap[While[++n <= upto, If[(a = A030000[n]) > r, Sow[r = a]]]][[2, 1]]]
0, 7, 11, 22, 50, 61, 78, 100, 121, 122, 127, 155, 263, 548, 1000, 1002, 1003, 1016, 1559, 1583, 1877, 3087, 9634, 10001, 10029, 10199, 10620, 25672, 100002, 100005, 100085, 100116, 100457, 100956, 101597, 101624, 114323, 191974, 1000004, 1000006, 1000055, 1000227, 1000517, 1000717, 1000728, 1027986, 1098714, 1127153, 1429848, 3659369
EXAMPLE
0 is a term as it is the least nonnegative integer and A030000(0) = 10.
7 is a term after 0 as 7 is the first number that is first seen at a k such that 2^k contains 7 as a substring (namely at k = 15). (End)
MATHEMATICA
d2k[k_] := d2k[k] = IntegerString[2^k];
A030000[n_] := Block[{d = IntegerString[n], k = -1}, While[StringFreeQ[d2k[++k], d]]; k];
Block[{upto = 10000, n = -1, a, r = -1}, Reap[While[++n <= upto, If[(a = A030000[n]) > r, r = a; Sow[n]]]][[2, 1]]]
10, 0, 1, 5, 2, 8, 4, 15, 3, 12, 10, 40, 7, 17, 18, 21, 4, 27, 30, 13, 11, 18, 43, 41, 10, 8
Smallest power of 2 whose decimal expansion contains n.
+10
17
1024, 1, 2, 32, 4, 256, 16, 32768, 8, 4096, 1024, 1099511627776, 128, 131072, 262144, 2097152, 16, 134217728, 1073741824, 8192, 2048, 262144, 8796093022208, 2199023255552, 1024, 256, 262144, 32768, 128, 4294967296, 4194304, 131072, 32, 33554432, 134217728, 33554432
MATHEMATICA
a[n_] := (k = 0; While[ !MatchQ[ IntegerDigits[2^k], {___, Sequence @@ IntegerDigits[n], ___}], k++]; 2^k); Table[a[n], {n, 1, 30}](* Jean-François Alcover, Nov 30 2011 *)
Module[{p2=2^Range[0, 50]}, Table[SelectFirst[p2, SequenceCount[ IntegerDigits[ #], IntegerDigits[ n]]>0&], {n, 0, 40}]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 13 2019 *)
PROG
(Haskell)
import Data.List (isInfixOf)
a030001 n = head $ filter ((show n `isInfixOf`) . show) a000079_list
(Python)
def a(n):
k, strn = 0, str(n)
while strn not in str(2**k): k += 1
return 2**k
2^a(n) is the smallest power of 2 beginning with n.
+10
12
0, 1, 5, 2, 9, 6, 46, 3, 53, 10, 50, 7, 17, 47, 77, 4, 34, 54, 84, 11, 31, 51, 61, 81, 8, 18, 38, 48, 68, 78, 98, 5, 25, 35, 45, 55, 75, 85, 95, 12, 22, 32, 42, 145, 52, 62, 72, 82, 92, 102, 9, 19, 29, 39, 142, 49, 59, 162, 69, 79, 89, 192, 99, 6, 16, 119, 26
REFERENCES
A. M. Yaglom and I. M. Yaglom, Challenging Mathematical Problems With Elementary Solutions, Vol. 1, pp. 29, 199-200, Prob. 91a, Dover, NY, 1987.
MATHEMATICA
f[n_] := Block[{k = 1, m = Floor[ Log[10, n]]}, While[ Log[10, 2^k] < Floor[ Log[10, n]], k++ ]; While[ Quotient[2^k, 10^(Floor[k*Log[10, 2]] - m)] != n, k++ ]; k]; f[1] = 0;; Array[f, 73] (* Robert G. Wilson v, Jun 02 2009 *)
PROG
(Haskell)
import Data.List (isPrefixOf, findIndex)
import Data.Maybe (fromJust)
a018856 n =
fromJust $ findIndex (show n `isPrefixOf`) $ map show a000079_list
(Python)
from itertools import count
def aupton(terms):
adict, pow2 = dict(), 1
for i in count(0):
s = str(pow2)
for j in range(len(s)):
t = int(s[:j+1])
if t > terms:
break
if t not in adict:
adict[t] = i
if len(adict) == terms:
return [adict[i+1] for i in range(terms)]
pow2 *= 2
Smallest power of 3 whose decimal expansion contains n.
+10
12
59049, 1, 27, 3, 243, 6561, 6561, 27, 81, 9, 10460353203, 1162261467, 129140163, 31381059609, 177147, 1594323, 129140163, 177147, 2187, 19683, 387420489, 2187, 1162261467, 1594323, 243, 2541865828329, 1162261467, 27, 282429536481, 729, 43046721, 531441, 1594323
FORMULA
a(n) = MIN{ A000244(i) such that n in decimal representation is a substring of A000244(i)}.
EXAMPLE
a(1) = 1 because 3^0 = 1 has "1" as a substring (not a proper substring, though).
a(2) = 27 because 3^3 = 27 has "2" as a substring.
a(10) = 10460353203 because 3^21 = 10460353203 is the smallest power of 3 whose decimal expansion contains "10" (in this case, "10" happens to be the left-hand or initial digits, but that is not generally true).
MATHEMATICA
A176763[n_] := Block[{k = -1}, While[StringFreeQ[IntegerString[3^++k], IntegerString[n]]]; 3^k]; Array[ A176763, 50, 0] (* Paolo Xausa, Apr 03 2024 *)
PROG
(Python)
def a(n):
k, strn = 0, str(n)
while strn not in str(3**k): k += 1
return 3**k
Smallest positive number k such that 2^k contains n.
+10
11
10, 4, 1, 5, 2, 8, 4, 15, 3, 12, 10, 40, 7, 17, 18, 21, 4, 27, 30, 13, 11, 18, 43, 41, 10, 8, 18, 15, 7, 32, 22, 17, 5, 25, 27, 25, 16, 30, 14, 42, 12, 22, 19, 22, 18, 28, 42, 31, 11, 32, 52, 9, 19, 16, 25, 16, 8, 20, 33, 33, 23, 58, 18, 14, 6, 16, 46, 24, 15, 34, 29, 21, 17, 30
LINKS
Popular Computing (Calabasas, CA), Two Tables, Vol. 1, (No. 9, Dec 1973), page PC9-16.
EXAMPLE
a(7) = 15 because 2^15 = 32768.
MATHEMATICA
a = {}; Do[k = 1; While[ StringPosition[ ToString[2^k], ToString[n] ] == {}, k++ ]; a = Append[a, k], {n, 0, 50} ]; a
PROG
(Python)
....s, k, k2 = str(n), 1, 2
....while True:
........if s in str(k2):
............return k
........k += 1
CROSSREFS
Apart from initial term, a duplicate of A030000.
a(n) is the smallest k such that prime(k) contains the digits of n as a substring.
+10
5
26, 5, 1, 2, 13, 3, 18, 4, 23, 8, 26, 5, 31, 6, 35, 36, 38, 7, 42, 8, 197, 47, 48, 9, 53, 54, 56, 31, 60, 10, 63, 11, 216, 51, 69, 71, 73, 12, 76, 34, 79, 13, 82, 14, 86, 88, 89, 15, 93, 35, 96, 36, 98, 16, 100, 102, 103, 37, 107, 17, 110, 18, 257, 38, 116
EXAMPLE
0 appears first in 26th prime (101), so a(0) = 26;
9 appears first in 8th prime (19), so a(9) = 8;
24 appears first in 53rd prime (241), so a(24) = 53.
MATHEMATICA
tg=101; T=0*Range[tg]; k=0; subs[n_] := Block[{d = IntegerDigits[n]}, Flatten@ Table[ FromDigits@ Take[d, {i, j}], {j, Length[d]}, {i, j}]]; While[tg > 0, s = subs[Prime[++k]]; Do[ If[e <= 100 && T[[e+1]] == 0, T[[e+1]] = k; tg--], {e, s}]]; T (* Giovanni Resta, Apr 29 2017 *)
Single-digit numbers in the order in which they first appear in the decimal expansions of powers of 2, followed by the two-digit numbers in the order in which they appear, then the three-digit numbers, and so on.
+10
4
1, 2, 4, 8, 6, 3, 5, 0, 9, 7, 16, 32, 64, 12, 28, 25, 56, 51, 10, 24, 20, 48, 40, 96, 81, 19, 92, 63, 38, 84, 27, 76, 68, 65, 55, 53, 36, 13, 31, 72, 26, 62, 21, 14, 44, 52, 42, 88, 85, 57, 97, 71, 15, 41, 94, 43, 30, 83, 86, 60, 67, 77, 33, 35, 54, 34, 17, 45
COMMENTS
Apparently this algorithm applied to most sequences will produce a fractal scatterplot graph. - David Williams, Jan 20 2019
EXAMPLE
1,2,4,8,16,32,64,128,256,512,1024, ..., 4096, ..., 32768, ... gives 1,2,4,8,6,3,5,0,9,7.
Then we get 16,32,64,12,28,25,56,51,10,24,20,48,40,96,81,19,92,...
11 does not appear until 2^40 = 1099511627776.
PROG
(PARI) See Links section.
6^a(n) is smallest nonnegative power of 6 containing the string 'n'.
+10
3
9, 0, 3, 2, 6, 6, 1, 5, 12, 4, 9, 16, 4, 13, 28, 18, 3, 10, 15, 21, 26, 3, 22, 12, 27, 26, 17, 7, 16, 4, 13, 22, 24, 12, 27, 19, 2, 21, 22, 30, 13, 14, 22, 25, 17, 15, 6, 15, 28, 15, 21, 31, 46, 23, 28, 18, 6, 15, 20, 17, 10, 8, 11, 33, 14, 6, 6, 8, 18, 9, 11, 22, 26, 17, 16, 33
MATHEMATICA
Table[k = 0; While[ StringPosition[ ToString[6^k], ToString[n] ] == {}, k++ ]; k, {n, 0, 75} ]
Module[{nn=100, p}, p=Table[{n, 6^n}, {n, 0, nn}]; Table[SelectFirst[p, SequenceCount[ IntegerDigits[ #[[2]]], IntegerDigits[k]]>0&], {k, 0, nn}]][[;; , 1]] (* Harvey P. Dale, Jun 02 2023 *)
Search completed in 0.013 seconds
|