Displaying 1-10 of 18 results found.
Hannah Rollman's numbers: the numbers excluded from A048991.
+20
13
12, 23, 31, 34, 41, 42, 45, 51, 52, 53, 56, 61, 62, 63, 64, 67, 71, 72, 73, 74, 75, 78, 81, 82, 83, 84, 85, 86, 89, 91, 92, 93, 94, 95, 96, 97, 98, 101, 111, 113, 121, 122, 123, 131, 141, 151, 161, 171, 181, 191, 192, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217
COMMENTS
A116700 is a similar sequence. Note that 21 is missing from the current sequence, because we deleted 12 in computing A048991 and now 21 is no longer "earlier in the sequence". On the other hand 21 is present in A116700. - N. J. A. Sloane, Aug 05 2007
Otherwise said: Numbers which occur in the concatenation of all smaller numbers not listed in this sequence. - M. F. Hasler, Dec 29 2012
Number of terms < 10^n, n = 1, 2, ...: (0, 37, 589, 7046, ...), gives number of n-digit terms as first differences: (37, 552, 6457, ...). - M. F. Hasler, Oct 25 2019
MATHEMATICA
a[0] = 1; s = "1"; a[n_] := a[n] = For[k = a[n-1] + 1, True, k++, If[StringFreeQ[s, t = ToString[k]], s = s <> t, Return[k]]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Nov 25 2013 *)
PROG
(Python) # see Hobson link
(Haskell)
import Data.List (isInfixOf)
a048992 n = a048992_list !! (n-1)
a048992_list = g [1..] [] where
g (x:xs) ys | xs' `isInfixOf` ys = x : g xs ys
| otherwise = g xs (xs' ++ ys)
where xs' = reverse $ show x
(PARI) D=[]; for(n=1, 999, for(i=0, #D-#d=digits(n), D[i+1..i+#d]!=d || print1(n", ") || next(2)); D=concat(D, d)) \\ M. F. Hasler, Oct 25 2019
Numbers m such that there are an equal number of numbers <= m that are contained and that are not contained in the concatenation of terms <= m in A048991.
+20
3
740, 1260, 1262, 5230, 15804, 15814, 15816, 36294, 194876, 213868
COMMENTS
There are no other terms <= 600000. The plots in a105390.gif strongly suggest that the sequence is complete. - Klaus Brockhaus, Aug 15 2007
EXAMPLE
A105390(n) > n/2 for n with 740 < n < a(2)=1260;
A105390(n) < n/2 for n with 1262 < n < a(4)=5230;
A105390(n) > n/2 for n with 5230 < n < a(5)=15804;
A105390(n) < n/2 for n with 15804 < n < a(6)=15814;
A105390(n) < n/2 for n with 15816 < n < a(8)=36294;
A105390(n) > n/2 for n with 36294 < n < a(9)=194876; etc.
PROG
(JBASIC)
s$ = "" : c = 0 : d = 0
FOR n = 1 TO 40000
sn$ = str$(n)
IF instr(s$, sn$) > 0 THEN d = d+1 ELSE c = c+1 : s$ = s$ + sn$
IF c = d THEN print n ; ", " ;
"Early bird" numbers: write the natural numbers in a string 12345678910111213.... Sequence gives numbers that occur in the string ahead of their natural place, sorted into increasing order (cf. A117804).
+10
29
12, 21, 23, 31, 32, 34, 41, 42, 43, 45, 51, 52, 53, 54, 56, 61, 62, 63, 64, 65, 67, 71, 72, 73, 74, 75, 76, 78, 81, 82, 83, 84, 85, 86, 87, 89, 91, 92, 93, 94, 95, 96, 97, 98, 99, 101, 110, 111, 112, 121, 122, 123, 131, 132, 141, 142, 151, 152, 161, 162, 171
COMMENTS
Based on an idea by Argentinian puzzle creator Jaime Poniachik, these numbers were introduced by Martin Gardner in 2005 in the magazine Math. Horizons, published by the MAA.
A048992 is a similar sequence, but is different because it does not contain 21, etc. - see comments in A048992.
REFERENCES
Martin Gardner, Transcendentals and early birds, Math. Horizons, XIII(2) (2005), pp. 5, 34 (published by Math. Assoc. America).
LINKS
S. W. Golomb, Early Bird Numbers, Puzzle Column in IEEE Inform. Soc. Newsletter, 52(4) (2002), p. 10.
FORMULA
Asymptotically, the early bird numbers have density 1 [Golomb].
EXAMPLE
"12" appears at the start of the string, ahead of its position after "11", so is a member.
So are 123, 23, 1234, 234, 34, ... and sorting these into increasing order we get 12, 21, 23, 31, ... - N. J. A. Sloane, Aug 28 2019
MATHEMATICA
s = ""; Reap[For[n=1, n <= 200, n++, sn = ToString[n]; If[StringPosition[s, sn, 1] =!= {}, Sow[n]]; s = s <> sn]][[2, 1]] (* Jean-François Alcover, Nov 04 2016, after Klaus Brockhaus *)
PROG
(ARIBAS) s:= ""; for n:=1 to 200 do sn:=itoa(n);
if substr_index(s, sn) >= 0 then write(n, ", "); end;
(UBASIC)
10 X=""
20 for N=1 to 396
30 A=cutspc(str(N))
40 if instr(X, A)>0 then print N;
50 X+=A
60 next N
(Haskell)
import Data.List (isPrefixOf, find)
import Data.Maybe (fromJust)
a116700 n = a116700_list !! (n-1)
a116700_list = filter early [1 ..] where
early z = not (reverse (show (z - 1)) `isPrefixOf` fst bird) where
bird = fromJust $ find ((show z `isPrefixOf`) . snd) xys
xys = iterate (\(us, v : vs) -> (v : us, vs))
([], concatMap show [0 ..])
(Python)
def aupto(limit):
s, alst = "", []
for k in range(1, limit+1):
sk = str(k)
if sk in s: alst.append(k)
s += sk
return alst
CROSSREFS
Cf. A007908 (subsequence, apart from initial 1).
Least nonnegative integer whose binary representation does not occur in the concatenation of the binary representations of all earlier terms.
+10
17
0, 1, 2, 4, 7, 8, 11, 16, 18, 21, 22, 25, 29, 31, 32, 35, 36, 38, 40, 58, 64, 67, 68, 70, 75, 76, 78, 87, 88, 90, 93, 99, 101, 104, 107, 122, 128, 131, 133, 134, 136, 138, 140, 144, 148, 150, 152, 155, 156, 159, 161, 169, 170, 172, 178, 183, 188, 190
COMMENTS
Otherwise said: Omit numbers whose binary representation already occurs in the concatenation of the binary representation of earlier terms. As such, a binary analog of A048991 / A048992 (Hannah Rollman's numbers), rather than "early bird" binary numbers A161373. - M. F. Hasler, Jan 03 2013
MATHEMATICA
Block[{b = {{0}}, a = {0}, k, d}, Do[k = FromDigits[#, 2] &@ Last@ b + 1; While[SequenceCount[Flatten@ b, Set[d, IntegerDigits[k, 2]]] > 0, k++]; AppendTo[b, d]; AppendTo[a, k], {i, 57}]; a] (* Michael De Vlieger, Aug 19 2017 *)
PROG
(PARI) A118248(n, show=0, a=0)={my(c=[a], find(t, s, L)=L || L=#s; for(i=0, #t-L, vecextract( t, (2^L-1)<<i )==s & return(1))); for(k=1, n, show && print1(a", "); while( find(c, binary(a++)), ); c=concat(c, binary(a))); a} \\ M. F. Hasler, Jan 03 2013
(Perl) $s=""; $i=0; do{$i++; $b=sprintf("%b", $i); if(index($s, $b)<0){print("$i=$b\n"); $s.=$b}}while(1);
CROSSREFS
Cf. A118247 (concatenation of binary representations), A118250, A118252 (variants where binary representations are reversed).
"Early bird" binary numbers: write the natural numbers in binary representation in a string 011011100101110111.... Sequence gives numbers which occur in the string strictly ahead of their natural place.
+10
7
3, 5, 6, 7, 9, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65
COMMENTS
In contrast to sequences A048991, A048992 (Hannah Rollman's numbers), and binary analogs A190784 and related, the numbers listed here are repeated in their natural position when forming the concatenation of binary digits, even though they occur already earlier in the string. - M. F. Hasler, Jan 01 2013
EXAMPLE
Decimal 0 1 2 3 4 5 ... Binary 0 1 10 11 100 101 ... 3 is before its natural position ('1' + beginning of '2' -> 011...) The same for : 5: '2' + beginning of '3' -> 01101... 6: '1' + '2' -> 0110... etc. In the first 5 binary numbers we can find ahead of their natural place: 3,5,6,7,9,11,12,13,14,18,23,25,27,28,37,46,50,55,57
20 ('10100') occurs at the joint of 18 and 19: the last 2 digits of '10010' and the first three of '10011'
EXTENSIONS
"Strictly" added to definition, offset corrected as customary for lists, 20 added by Hagen von Eitzen, Jun 27 2009
Number of Hannah Rollman's numbers <= n.
+10
6
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 9, 10, 10, 10, 11, 11, 11, 11, 11, 12, 13, 14, 15, 15, 15, 16, 16, 16, 16, 17, 18, 19, 20, 21, 21, 21, 22, 22, 22, 23, 24, 25, 26, 27, 28, 28
COMMENTS
a(n) < n/2 for n < 740; a(n) > n/2 for 740 < n < 1260,
see A105391 for numbers m with a(m) = m/2.
PROG
s$ = "" : d = 0
FOR n = 1 TO 100
sn$ = str$(n)
IF instr(s$, sn$) > 0 THEN d = d+1 ELSE s$ = s$ + sn$
print d ; ", ";
NEXT
a(0)=0; for n>0, a(n) = smallest number that is not a concatenation of any number of distinct earlier terms in increasing order.
+10
4
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 20, 21, 22, 30, 31, 32, 33, 40, 41, 42, 43, 44, 50, 51, 52, 53, 54, 55, 60, 61, 62, 63, 64, 65, 66, 70, 71, 72, 73, 74, 75, 76, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105
COMMENTS
After 11 we can see 1,2 -> 12, 1,3 -> 13, etc., but not 20.
PROG
(Python)
from itertools import islice
def incats(s, L):
if s == "": return True
return any(s.startswith(w) and incats(s[len(w):], L[i+1:]) for i, w in enumerate(L))
def agen(): # generator of terms
L, an, s = ["0"], 1, "1"
yield from [0]
while True:
yield an
L.append(s)
while incats((s:=str(an)), L):
an += 1
Numbers that can be written as the product of two divisors greater than 1 such that the number is contained in the string concatenation of the divisors.
+10
4
64, 95, 110, 210, 325, 510, 624, 640, 664, 950, 995, 1010, 1100, 1110, 3250, 3325, 5134, 6240, 6400, 6640, 6664, 7125, 7616, 8145, 9500, 9950, 9995, 11000, 11100, 11110, 20100, 21052, 21175, 25100, 26208, 32500, 33250, 33325, 35126, 50100, 51020, 51204, 51340, 57125, 62400, 64000, 65114
EXAMPLE
64 is a term as 64 = 16 * 4 and "16" + "4" = "164" contains "64".
65114 is a term as 65114 = 4651 * 14 and "4651" + "14" = "465114" contains "65114".
See the attached text file for other examples.
PROG
(Python)
from sympy import divisors
def ok(n):
s, divs = str(n), divisors(n)[1:-1]
return any(s in str(d)+str(n//d) for d in divs)
CROSSREFS
Cf. A355791 (base-2), A030190, A210959, A027750, A355852, A339144, A341035, A342127, A027748, A048991, A330027, A077293.
3, 5, 6, 9, 10, 12, 13, 14, 15, 17, 19, 20, 23, 24, 26, 27, 28, 30, 33, 34, 37, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 59, 60, 61, 62, 63, 65, 66, 69, 71, 72, 73, 74, 77, 79, 80, 81, 82, 83, 84, 85, 86, 89, 91, 92, 94, 95, 96, 97, 98, 100
COMMENTS
Also: Numbers whose binary representation is a substring of the concatenation of the binary representation of all smaller nonnegative integers not listed earlier. - M. F. Hasler, Dec 29 2012
EXAMPLE
The first term is 3, smallest integer whose binary representation "11"[2] is a substring of the concatenation of the smaller numbers 0,1,2 ~> concat(0,1,10)="0110".
Next is 5="101"[2], which is a substring of concat(0,1,2="10",4="100") = "0110100". Note that 3, since it occurs earlier, is excluded from the list of numbers which are concatenated. - M. F. Hasler, Dec 29 2012
A self-describing sequence: when the sequence is read as a string of decimal digits, a(n) gives the starting position of an occurrence of n. This sequence is the lexicographically earliest one with this property.
+10
2
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, 1, 17, 130, 21, 50, 15, 28, 180, 33, 20, 37, 2, 200, 42, 52, 47, 270, 162, 60, 57, 310, 300, 3, 66, 350, 35, 73, 380, 78, 400, 41, 84, 302, 4, 91, 460, 96, 480, 22, 104, 510, 110, 530, 115, 5, 55, 122, 580, 53, 132, 146, 136
COMMENTS
The sequence does not necessarily give the earliest position of a number.
For example, 1234 first appears at position 1, but a(1234) = 28011.
EXAMPLE
The following table lists few first terms, with the corresponding digits induced in the overall sequence:
+----+------+------------------------------------------------------------+
| n | a(n) | New known digits |
+----+------+------------------------------------------------------------+
| 1 | 1 | 1 |
| 2 | 2 | 2 |
| 3 | 3 | 3 |
| 4 | 4 | 4 |
| 5 | 5 | 5 |
| 6 | 6 | 6 |
| 7 | 7 | 7 |
| 8 | 8 | 8 |
| 9 | 9 | 9 |
| 10 | 10 | 10 |
| 11 | 14 | 1411 |
| 12 | 1 | |
| 13 | 17 | 713 |
| 14 | 130 | 0 ... 14 |
| 15 | 21 | 215 |
| 16 | 50 | 0 16 |
| 17 | 15 | 15 |
| 18 | 28 | 2818 |
+----+------+------------------------------------------------------------+
PROG
(Perl) See Links section.
Search completed in 0.013 seconds
|